text
stringlengths
7.05k
33.9k
use serde_derive::{Deserialize, Serialize}; use crate::error::*; use crate::io_utils::slurp; use std::collections::HashMap; use std::env; use std::path::PathBuf; fn default_posts_per_index() -> u32 { 8 } #[derive(Serialize, Deserialize, Clone, Debug)] #[serde(default, rename_all = "camelCase")] pub struct Confi...
use std::{ collections::{HashMap, HashSet}, fs, path::PathBuf, }; use async_std::task::block_on; use itertools::Itertools; use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; use sqlx::FromRow; use crate::{ config::{self, SspMonitorConfig}, database::{ plan::{self, AdConfig...
use crate::{ behavior::{commit_block, verify_block}, block_proposal::BlockProposal, network::raft::{ message::{NewBlockRequest, NewBlockResponse}, rpc::get_block_proposal, }, snapshot::Snapshot, }; use async_raft::{ raft::{Entry, EntryPayload, MembershipConfig}, storage::{Cur...
#![allow(clippy::upper_case_acronyms)] use anyhow::Error; use lancelot::{ arch::Arch, aspace::AddressSpace, loader::pe::{PEError, PE as lPE}, module::{ModuleError, Permissions}, pagemap::PageMapError, util::UtilError, VA, }; use pyo3::{self, prelude::*, types::*, wrap_pyfunction, PyNumberPr...
use crate::{ apply_patch, paths, storage::{Entry, File as FileEntry, Storage}, PartialFile, }; use erreur::{bail, ensure, Context, Help, LogAndDiscardResult, Report, Result}; use std::{ convert::TryFrom, fs::File, io::{self, BufReader, Cursor, Read}, path::Path, }; mod build; pub use build:...
use std::fmt; use piet::kurbo::{Affine, PathEl, Point, Rect, Shape, Size}; use piet::{ Color, Error, FixedGradient, FixedLinearGradient, FixedRadialGradient, Image, ImageFormat, InterpolationMode, IntoBrush, LineCap, LineJoin, RenderContext, StrokeStyle, TextLayout, }; use skia_safe; use skia_safe::canvas::Src...
use ash::vk; use ash::version::DeviceV1_0; use crate::device::DeviceMTXG; use crate::swapchain::SwapchainMTXG; use crate::pipeline::GraphicsPipelineMTXG; use crate::buffer::{ImageMemoryMTXG, BufferMemoryMTXG}; use crate::descriptors::DescriptorSetsMTXG; use crate::CleanupVkObj; pub const MAX_INFLIGHT_FRAMES: u32 = 2...
//! Address protocol implementation //! //! Address is a 64-byte string that allows anyone to deliver payment w/o exchanging Receivers. //! //! Sending funds this way incurs a bit of overhead: extra `data` entry in the transaction, //! with 73 bytes of data. Last byte is used as a distinguisher to help identify the cor...
use instant::Instant; use nalgebra_glm as glm; use std::rc::Rc; use std::time::Duration; use winit::dpi::PhysicalPosition; use winit::event::DeviceEvent; use winit::event::ElementState; use winit::event::Event; use winit::event::Touch; use winit::event::WindowEvent; use winit::event_loop::ControlFlow; use winit::window...
use std::cmp::max; use std::fmt; use std::mem::{forget, replace}; use std::pin::Pin; use std::ptr::NonNull; use crate::rt::local::scheduler::ProcessData; use crate::rt::process::ProcessId; /// Number of bits to shift per level. const LEVEL_SHIFT: usize = 4; /// Number of branches per level of the tree, must be a powe...
// Rust Bitcoin Library // Written in 2014 by // <NAME> <<EMAIL>> // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to // the public domain worldwide. This software is distributed without // any warranty. // // You should have r...
use super::{priv_s::PrivDiff, phys::*, program::StateDiff}; use crate::{arch::*, data_structures::*}; use std::{collections::HashMap, fmt, marker::PhantomData}; // Because WASM is a 32-bit target, usize doesn't cut it type VirtPn = u64; /// Maps a virtual page to a physical one. #[derive(Debug, Copy, Clone, PartialEq...
#![no_std] #![deny(missing_docs)] //! # Draw a box //! //! This crate contains constants for all 128 [unicode box-drawing characters](https://en.wikipedia.org/wiki/Box_Drawing_(Unicode_block)) //! and makes it possible to find the one you need dynamically. //! //! ## Constants //! //! The constants are separated into ...
// Copyright 2019 The Epic Developers // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
#![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; pub mod contract; use alloc::vec::Vec; use codec::{Decode, Encode}; use core::convert::{TryFrom, TryInto}; use core::fmt::Debug; use sp_core::H256; // Messages: Phase Wallet pub mod messaging { use alloc::string::String; use alloc::vec::Vec; ...
#![feature(backtrace)] ///! This implementation is based on `cargo-miri` ///! https://github.com/rust-lang/miri/blob/master/src/bin/cargo-miri.rs #[macro_use] extern crate log as log_crate; use std::env; use std::fmt::Display; use std::path::{Path, PathBuf}; use std::process::Command; use std::time::Duration; use ru...
#![cfg_attr(not(target_os = "none"), allow(dead_code))] #![cfg_attr(target_os = "none", no_std)] #![cfg_attr(target_os = "none", no_main)] mod api; use std::cmp::Reverse; use std::collections::BinaryHeap; use log::{error, info}; #[derive(Eq)] pub struct SleepRequest { msec: i64, sender: xous::MessageSender,...
use super::address_transform::AddressTransform; use anyhow::{Context, Error, Result}; use gimli::{self, write, Expression, Operation, Reader, ReaderOffset, X86_64}; use more_asserts::{assert_le, assert_lt}; use std::collections::{HashMap, HashSet}; use wasmtime_environ::entity::EntityRef; use wasmtime_environ::ir::{Sta...
// Copyright 2019 Red Hat, Inc. All Rights Reserved. // // Portions Copyright 2019 Intel Corporation. All Rights Reserved. // // Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Portions Copyright 2017 The Chromium OS Authors. All rights reserved. // // SPDX-License-Identifier: (Ap...
use std::{fmt, future::Future, io, marker, mem, net, pin::Pin, task::Context, task::Poll}; use async_channel::{unbounded, Receiver}; use async_oneshot as oneshot; use futures_core::Stream; use log::{error, info}; use socket2::{Domain, SockAddr, Socket, Type}; use crate::io::Io; use crate::rt::{spawn, Signal, System};...
use algebra::{prelude::*, BitIteratorBE}; use core::{ fmt::Debug, ops::{Add, AddAssign, Mul, MulAssign, Sub, SubAssign}, }; use r1cs_core::SynthesisError; use crate::{prelude::*, Assignment}; /// This module contains a generic implementation of cubic extension field /// variables. That is, it implements the R...
use crate::*; use crate::{syscall_defs::*}; use memory_block::{MemoryBlock, Protection}; use std::{os::raw::c_char, ffi::CStr}; use fs::{FileDescriptor, FileSystem/*, MissingFileCallback*/}; use elf::ElfLoader; use cinterface::MemoryLayoutTemplate; use goblin::elf::Elf; use context::{CALLBACK_SLOTS, Context, ExternalCa...
//! Runtime query-builder API. use std::fmt::Display; use std::fmt::Write; use std::marker::PhantomData; use crate::arguments::Arguments; use crate::database::{Database, HasArguments}; use crate::encode::Encode; use crate::query::Query; use crate::types::Type; use crate::Either; /// A builder type for constructing q...
use actions::{self, colours::UpdateActionParams}; // use collector::{CollectorItem, CollectorValue, CustomCollector}; use colours::ParsedColour; use constants::commands::roles_edit; use utils; // use COLLECTOR; use std::str::FromStr; use serenity::client::Context; use serenity::framework::standard::{Args, CommandErro...
//! NEXMark benchmark implementation. //! //! Query parameters based on http://datalab.cs.pdx.edu/niagara/NEXMark/ unless noted otherwise. extern crate clap; extern crate fnv; extern crate rand; extern crate timely; extern crate nexmark; extern crate streaming_harness; extern crate dynamic_scaling_mechanism; extern cr...
//! Main program configuration. use std::collections::HashMap; use std::ffi::OsString; use std::fmt::{Display, Formatter}; use std::io; use std::io::{stdin, BufRead, BufReader}; use std::path::PathBuf; use std::str::FromStr; use chrono::{DateTime, FixedOffset, Local}; use clap::AppSettings; use structopt::StructOpt; ...
//! This module contains types and functions related to assessing the precipitation type from a //! sounding. The types are based on the WMO Manual On Codes Vol I.1, Part A Alphanumeric Codes. //! //! The codes are drawn from table 4680 for automated weather stations. Note that not all observable //! weather types are ...
/*! # ELF Loader A dead simple crate for ELF64 parsing and loading. ## Features - This crate is `#[no_std]`, you do not even need the `alloc` crate to start having fun. - It performs a lot of bounds, alignment and other sanity checks. Don't just blindly trust a buffer containing code. =) - There is no recursion in...
// This file is part of Substrate. // Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the F...
use bytes::{Bytes, BytesMut}; use futures::sync::mpsc::{self, Receiver, Sender}; use futures::{prelude::*, sink::Sink, stream::iter_ok}; use log::{debug, trace}; use tokio::{ codec::{length_delimited::LengthDelimitedCodec, Framed}, prelude::{AsyncRead, AsyncWrite}, timer::Delay, }; use std::{ cmp::min,...
// Copyright (c) Aptos // SPDX-License-Identifier: Apache-2.0 //! This module implements an in-memory Sparse Merkle Tree that is similar to what we use in //! storage to represent world state. This tree will store only a small portion of the state -- the //! part of accounts that have been modified by uncommitted tran...
use crate::errors::prelude::*; use crate::{ hash_to_g2, GeneratorG1, GeneratorG2, HashElem, RandomElem, ToVariableLengthBytes, FR_COMPRESSED_SIZE, FR_UNCOMPRESSED_SIZE, G1_COMPRESSED_SIZE, G1_UNCOMPRESSED_SIZE, G2_COMPRESSED_SIZE, G2_UNCOMPRESSED_SIZE, }; use blake2::{digest::generic_array::GenericArray, Bl...
mod adsr_function; mod biquad_filter_function; mod channel_function; mod defer_function; mod delay_function; mod function_context; mod indexed_function; mod note_function; mod num_function; mod oscillator_function; mod sv_filter_function; mod vector_intrinsic_function; mod vector_shuffle_function; mod voices_function; ...
// todo // 1. 把 <timer> 从 <onshot> 改成 <Notify> // 2. 拆分stage逻辑 mod config; mod state; mod request; mod error; use { std::collections::HashMap, std::time::Duration, tokio::sync::mpsc::{Sender, Receiver, channel}, tokio::sync::{watch, oneshot}, tokio::time::sleep, }; use { config::Config, ...
// Copyright 2021 <NAME> (<EMAIL>) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
// Copyright 2017 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use std::fmt::{self, Display}; use std::os::unix::io::{AsRawFd, RawFd}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; use std::th...
//! This module defines the sender of a SPMC channel. use crate::{ error::NoReceivers, spmc::{ node::{Node, NodeData, NodeDataPtr, OrphanData, SenderSubs, SubsData}, shared::Shared, }, }; use std::{ fmt, ptr::NonNull, sync::{atomic::Ordering::*, Arc}, }; /// The sender handle o...
use std::sync::Arc; use derive_more::{Display, Error}; use std::pin::Pin; use vulkano::{ buffer::BufferAccess, command_buffer::pool::UnsafeCommandPool, device::{Device, Queue}, instance::PhysicalDevice, sync::Fence, SynchronizedVulkanObject, VulkanHandle, VulkanObject, }; use std::ptr::addr_of_mut; #[der...
use super::TELEM_SERVICE_NAME; use opentelemetry::{ global, metrics::{Counter, Descriptor, InstrumentKind, Meter, ValueRecorder}, sdk::{ export::metrics::{Aggregator, AggregatorSelector}, metrics::aggregators::{histogram, last_value, sum}, }, KeyValue, }; use std::{sync::Arc, time::D...
use super::*; use indicatif::ProgressIterator; use itertools::Itertools; #[cfg(target_os = "linux")] use nix::fcntl::*; #[cfg(target_os = "linux")] use std::os::unix::io::AsRawFd; use num_traits::Zero; use rayon::iter::ParallelIterator; use std::{collections::HashMap, fs::File, io::prelude::*, io::BufReader}; use cr...
//! # Random Forest Regressor //! A random forest is an ensemble estimator that fits multiple [decision trees](../../tree/index.html) to random subsets of the dataset and averages predictions //! to improve the predictive accuracy and control over-fitting. See [ensemble models](../index.html) for more details. //! //! ...
// Copyright [2020] [<NAME>] // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
// Copyright 2021 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use fuchsia_zircon::{self as zx, HandleBased}; use log::warn; use parking_lot::{Mutex, RwLockReadGuard, RwLockWriteGuard}; use std::sync::Arc; use syncio::...
/* * Copyright Stalwart Labs Ltd. See the COPYING * file at the top-level directory of this distribution. * * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or * https://www.apache.org/licenses/LICENSE-2.0> or the MIT license * <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your * optio...
//! Driver for the Microchip MCP23008 I2C GPIO extender. //! //! http://www.microchip.com/wwwproducts/en/MCP23008 //! //! Paraphrased from the website: //! //! > The MCP23008 device provides 8-bit, general purpose, parallel I/O //! > expansion for I2C bus applications. The MCP23008 has three address pins //! > and cons...
use anyhow::Result; use async_mutex::Mutex; use crossbeam::channel::{unbounded, Receiver, Sender}; use governor::{ clock::QuantaClock, state::{direct::NotKeyed, InMemoryState}, Quota, RateLimiter, }; use mlua::{ prelude::{LuaError, LuaMultiValue, LuaValue}, Function, Lua, LuaSerdeExt, RegistryKey, S...
//! Support for Program Database, the debug companion format on Windows. use std::borrow::Cow; use std::fmt; use std::io::Cursor; use std::sync::Arc; use failure::Fail; use lazycell::LazyCell; use parking_lot::RwLock; use pdb::{AddressMap, FallibleIterator, MachineType, Module, ModuleInfo, SymbolData}; use symbolic_...
pub mod featuretable { //! The `featuretable` module implements loading, extracting, and analyzing //! representations based on phonological (typically articulatory) features. use serde::Deserialize; use serde_yaml; use std::collections::HashMap; use std::fs::File; use std::path::Path; u...
//! This module contains the configuration of the application. //! //! All options are passed individually to each function and are not bundled together. //! //! # Examples //! //! ```no_run //! # use https::Options; //! let options = Options::parse(); //! println!("Directory to host: {}", options.hosted_directory.0); ...
// // Copyright 2021-Present (c) <NAME> & <NAME> // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the foll...
use std::cmp::max; use std::cmp::{min, Ordering}; use std::collections::VecDeque; use std::iter::Iterator; use std::net::SocketAddr; use std::time::Instant; use bytes::{Bytes, BytesMut}; use log::{debug, error, info, trace, warn}; use super::TimeSpan; use crate::loss_compression::compress_loss_list; use crate::packet...
// Copyright Materialize, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by ...
//! Server-sent-event server for the note viewer feature. //! This module contains also the web browser Javascript client code. extern crate parse_hyperlinks; extern crate percent_encoding; extern crate tera; extern crate url; use crate::config::CFG; use crate::config::VIEWER_SERVED_MIME_TYPES_HMAP; use crate::note::...
use super::*; use crate::error::RatsioError; use crate::nats_client::NatsClient; use crate::nuid::NUID; use crate::ops::{Publish, Subscribe}; use crate::protocol::{ Ack, CloseRequest, ConnectRequest, ConnectResponse, PubMsg, SubscriptionRequest, SubscriptionResponse, }; use futures::{ future::{self, Either}...
//! # Span Processor //! //! Span processor is an interface which allows hooks for span start and end //! method invocations. Span processors are invoked only when [`is_recording`] //! is `true`. //! Built-in span processors are responsible for batching and conversion of //! spans to exportable representation and passi...
#![recursion_limit = "1024"] use byteorder::{ByteOrder, LittleEndian as LE}; use custom_error::custom_error; use deoptloader::decompressor::{Decompressor, Error as DecompressorError, Op}; use deoptloader::fixup_converter::FixupConverter; use deoptloader::neexe::*; use nom::{do_parse, le_u16, named, named_args, tag, ta...
//! A markov chain library for Rust. //! //! # Features //! * Training sequences of arbitrary types //! * Nodes of N order //! * Specialized string generation and training //! * Serialization via serde //! * Generation utility //! //! # Examples //! In your Cargo.toml file, make sure you have the line `markov_chain =...
use crate::prelude::*; #[inline] pub fn tri_face_dir(v0: V3, v1: V3, v2: V3) -> V3 { crate::cross(v1 - v0, v2 - v1) } #[inline] pub fn tri_normal(v0: V3, v1: V3, v2: V3) -> V3 { tri_face_dir(v0, v1, v2).norm_or(0.0, 0.0, 1.0) } #[inline] pub fn tri_area(v0: V3, v1: V3, v2: V3) -> f32 { tri_face_dir(v0, v...
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
//! The client to the obs-websocket API and main entry point. #[cfg(feature = "events")] use std::sync::Weak; use std::{ collections::HashMap, future::Future, sync::{ atomic::{AtomicU64, Ordering}, Arc, }, }; #[cfg(feature = "events")] use futures_util::stream::Stream; use futures_util...
// This file is part of Webb. // Copyright (C) 2021 Webb Technologies Inc. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.o...
use crate::change::OSMObjectChange; use crate::change_iterator::OSMObjectChangeIterator; use crate::object::{OSMObject, OSMObjectFromNetwork, OSMObjectSpecifics, OSMObjectType}; use crate::utils; use crate::{Error, Result}; use chrono::{DateTime, Utc}; use geo_types::{Geometry, GeometryCollection, LineString, Point, Po...
use crate::model::{Face, Model}; use crate::{image, v2, v3, v4, InnerSpace, SquareMatrix, M4, V2, V3, V4}; pub struct Renderer { display_buf: Texture<V3>, z_buf: Texture<f64>, width: u32, height: u32, pub viewport: M4, pub projection: M4, pub modelview: M4, } impl Renderer { pub fn ne...
#[cfg(feature = "trace")] #[macro_use] extern crate trace; use std::env; use std::fs::File; use std::io::Write; use std::path::{Path, PathBuf}; use std::sync::Arc; use exitcode::ExitCode; use getopts::Options; use termcolor::{ColorChoice, ColorSpec, StandardStream, WriteColor}; mod exec; mod out; mod parser; mod sc...
use crate::api::Weak; use crate::bitmap::SpaceBitmap; use crate::gc_base::{ AllocationSpace, MarkingConstraint, MarkingConstraintRuns, NoHelp, NoReadBarrier, }; use crate::rosalloc_space::{RosAllocSpace, RosAllocTLAB}; use crate::utils::formatted_size; use crate::{ api::{vtable_of, Collectable, Gc, HeapObjectHe...
#[cfg(target_os = "linux")] fn main() { example::main(); } #[cfg(not(target_os = "linux"))] fn main() { println!("This example is currently not supported for OSes other than Linux"); } #[cfg(target_os = "linux")] mod example { use headcrab::{ symbol::{DisassemblySource, RelocatedDwarf}, ta...
use std::fs::File; use std::io::{BufReader, BufWriter, Error, Write}; use std::path::{Path, PathBuf}; use crate::xmlparser::{ XmlDicomDefinition, XmlDicomDefinitionIterator, XmlDicomDefinitionResult, XmlDicomElement, XmlDicomUid, }; static LOOKUP_PREAMBLE: &str = "//! This is an auto-generated file. Do not ma...
// Copyright (c) 2018, <NAME>. All rights reserved. // Use of this source code is governed by a ISC-style // license that can be found in the LICENSE.txt file. //! Solutions for the [Set 1]. //! //! [Set 1]: http://cryptopals.com/sets/1 extern crate base64; extern crate hex; use Result; // The English ASCII charact...
use std::collections::HashMap; use amcl_wrapper::constants::MODBYTES; use crate::errors::{BulletproofError, R1CSError}; use crate::r1cs::linear_combination::AllocatedQuantity; use crate::r1cs::{ConstraintSystem, LinearCombination, Variable}; use amcl_wrapper::field_elem::FieldElement; use super::poseidon::{PoseidonP...
use memegeom::primitive::point::Pt; use memegeom::primitive::rect::Rt; use strum::{Display as EnumDisplay, EnumString}; // Types defined in DSN specification. // <number> = [<sign>] (<positive_integer> | <real> | <fraction>) // <dimension> = <number> // <vertex> = PtF // <unit_descriptor> = (unit <dimension_unit>) /...
/* * Copyright (C) 2015 <NAME> <<EMAIL>> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or a...
//! # Day 19: Go With The Flow //! //! With the Elves well on their way constructing the North Pole base, you turn //! your attention back to understanding the inner workings of programming the //! device. //! //! You can't help but notice that the device's opcodes don't contain any flow //! control like jump instructi...
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // to suppress console with debug output for release builds /// /// swyh-rs /// /// Basic SWYH (https://www.streamwhatyouhear.com/, source repo https://github.com/StreamWhatYouHear/SWYH) clone entirely written in rust. /// /// I wrote this because I a) ...
use crate::robot_modules::robot_model_module::RobotModelModule; use crate::utils::utils_files_and_strings::robot_folder_utils::*; use crate::utils::utils_files_and_strings::file_utils::*; use crate::utils::utils_parsing::yaml_parsing_utils::*; use crate::utils::utils_se3::prelude::ImplicitDualQuaternion; use serde::{Se...
use std::fmt; use std::collections::{hash_set, hash_map, HashSet, HashMap}; use terms::{ PatternLike, PatternLikeKind }; use crate::{ utils::combinations, Symbol, State, Label, Ranked, NoLabel, Labeled, Language, //LanguageState, ConfigurationIterator }; pub mod macros;...
use crate::player::{Player, Result, SlideshowConfig}; use elementtree::Element; use failure::{format_err, Fail}; use libc; use log::{debug, info, warn}; use reqwest; use std::path::PathBuf; use std::process::Child; use std::process::Command; use std::time::Duration; use std::time::Instant; use url::Url; const VLC_VOLU...
// Copyright 2020 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any late...
use std::io::prelude::*; use std::fs::File; use std::error::Error; use std::convert::TryInto; #[derive(Debug, Copy, Clone)] struct PartitionEntry { status: u8, chs_address_first: [u8; 3], partition_type: u8, chs_address_last: [u8; 3], lba_address: u32, number_of_sectors: u32 } impl PartitionE...
// Copyright (c) 2017 <NAME> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distri...
use std::{ convert::{ From, TryFrom, }, num::Wrapping, }; use super::{ defs::*, util::mods1, }; use crate::tbits::{ binary::Byte, convert::{ log2e3, ConvertInto, ConvertIso, }, TbitSlice, TbitSliceMut, }; impl From<Trit> for Trint1 { ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Control Register"] pub smhc_ctrl: crate::Reg<smhc_ctrl::SMHC_CTRL_SPEC>, #[doc = "0x04 - Clock Control Register"] pub smhc_clkdiv: crate::Reg<smhc_clkdiv::SMHC_CLKDIV_SPEC>, #[doc = "0x08 - Time Out Register"] pub s...
pub mod hash; #[cfg(test)] mod tests; use super::CheckpointError; use hash::{ chunk_hasher, cow_chunk_hasher, cow_file_hasher, file_hasher, manifest_hasher, ManifestHash, }; use ic_cow_state::{CowMemoryManager, CowMemoryManagerImpl, MappedState}; use ic_crypto_sha256::Sha256; use ic_sys::mmap::ScopedMmap; use ic_...
/////////////////////////////////////////////////////////////////////////////// // // Copyright 2018-2021 Robonomics Network <<EMAIL>> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at ...
use crate::commands::autoview; use crate::commands::classified::{ ClassifiedCommand, ClassifiedInputStream, ClassifiedPipeline, ExternalCommand, InternalCommand, StreamNext, }; use crate::commands::plugin::JsonRpc; use crate::commands::plugin::{PluginCommand, PluginSink}; use crate::commands::whole_stream_comma...
#![recursion_limit = "512"] extern crate proc_macro; extern crate proc_macro2; extern crate quote; extern crate syn; use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote, ToTokens}; use syn::{ braced, ext::IdentExt, parenthesized, parse::{Parse, Pa...
//! This module contains the code that splits and persist chunks use super::{LockableCatalogChunk, LockableCatalogPartition, Result}; use crate::{ catalog::{chunk::CatalogChunk, partition::Partition}, lifecycle::{collect_rub, merge_schemas, write::write_chunk_to_object_store}, DbChunk, }; use data_types::{...
// Copyright 2021 Datafuse Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
//! Example of glyph_brush usage with raw OpenGL. //! //! Uses instanced rendering with 1 vertex per glyph referencing a 1 byte per pixel texture. //! //! Controls //! * Scroll to size text. //! * Type to modify text. //! * Resize window. //! //! The main operating structure is as follows: //! * Load a font //! * Initi...
// Copyright (c) 2014, 2015 <NAME> <<EMAIL>> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // excep...
// Whtcorps Inc 2022 Apache 2.0 License; All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use // this file File except in compliance with the License. You may obtain a copy of the // License at http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applica...
use crate::prelude::*; use crate::{ aead::{Aead, AeadCtx}, kdf::{labeled_extract, Kdf as KdfTrait, LabeledExpand}, kem::{self, EncappedKey, Kem as KemTrait, SharedSecret}, kex::KeyExchange, op_mode::{OpMode, OpModeR, OpModeS}, util::static_zeros, HpkeError, }; use byteorder::{BigEndian, Wri...
use crate::ast::{ BinaryOp, CallTarget, Datatype, Expr, ExprX, Function, Ident, Krate, Mode, Path, Pattern, PatternX, Stmt, StmtX, UnaryOpr, VirErr, }; use crate::ast_util::{err_str, err_string, get_field}; use crate::util::vec_map_result; use air::ast::Span; use air::scope_map::ScopeMap; use std::collections::...
// Copyright 2020 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. //! Implementation of a virtio-gpu protocol command processor which supports only display. use std::cell::RefCell; use std::cmp::{max, min}; use std::...
use crate::bitstream::LsbWriter; use crate::deflate_state::LengthBuffers; use crate::huffman_table::{ create_codes_in_place, num_extra_bits_for_distance_code, num_extra_bits_for_length_code, HuffmanTable, FIXED_CODE_LENGTHS, LENGTH_BITS_START, MAX_CODE_LENGTH, NUM_DISTANCE_CODES, NUM_LITERALS_AND_LENGTHS, }...
/* * Copyright 2018 Bitwise IO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use crate::agent::base::{ AgentError, Context as AgentContext, Invocation, InvocationResult, Lifespan, }; use crate::blueprint_definition; use crate::i...
//! Factory widget that displays a listing of the contents of a directory. use std::cell::RefCell; use std::path::{Path, PathBuf}; use anyhow::bail; use glib::translate::{from_glib_full, IntoGlib}; use glib::{clone, closure, Object}; use log::*; use panel::prelude::*; use relm4::actions::{ActionGroupName, RelmAction,...
use crate::agents::{GetSession, SaveSession}; use crate::bridges::BridgeData; use crate::config::ConfigRc; use crate::crypto::{self, SigningAlgorithm}; use crate::email_address::EmailAddress; use crate::error::{BrokerError, BrokerResult}; use crate::router::router; use crate::utils::{http::ResponseExt, real_ip, BoxErro...
use std::collections::HashMap; use std::collections::hash_map::Entry; use anyhow::anyhow; use chrono::Utc; use fst::IntoStreamer; use heed::types::ByteSlice; use roaring::RoaringBitmap; use serde_json::Value; use crate::facet::FacetType; use crate::{Index, BEU32, SmallString32, ExternalDocumentsIds}; use crate::heed_...
use std::cell::RefCell; use std::rc::Rc; use wasm_bindgen::prelude::*; use wasm_bindgen::JsCast; mod cell; mod fps; mod universe; mod utils; use crate::universe::Universe; use crate::utils::{cancel_animation_frame, element_by_id, request_animation_frame, window}; // When the `wee_alloc` feature is enabled, use `wee_...