text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
extern crate extra; use extra::io::WriteExt; use std::collections::HashMap; use std::io::{self, BufRead, BufReader, Write}; use std::mem; /// The number of factors. const FACTORS: usize = 7; /// Construct a dependency in a struct-like manner. macro_rules! dep { { gdp: $gdp:expr, agb: $agb:expr, ...
the_stack
use { crate::rest::{error::RestError, visualizer::*}, anyhow::{Error, Result}, log::{info, warn}, rouille::{Request, Response, ResponseBody}, scrutiny::{ engine::dispatcher::{ControllerDispatcher, DispatcherError}, model::controller::ConnectionMode, }, serde_json::json, s...
the_stack
use failure; use gl; use nalgebra as na; use crate::render_gl::{self, buffer, data}; use crate::resources::Resources; #[derive(VertexAttribPointers, Copy, Clone, Debug)] #[repr(C, packed)] struct Vertex { #[location = "0"] pos: data::f32_f32_f32, #[location = "1"] clr: data::u2_u10_u10_u10_...
the_stack
// The multi-metaverse governance module is inspired by frame democracy of how to store hash // and preimages. Ref: https://github.com/paritytech/substrate/tree/master/frame/democracy // Copyright (C) 2020-2022 Metaverse.Network & Bit.Country . // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache Licen...
the_stack
use libc; use std::ptr::null_mut; use qvariant::*; use types::*; use qmodelindex::*; use qinthasharray::*; extern "C" { fn dos_qabstractlistmodel_qmetaobject() -> DosQMetaObject; fn dos_qabstractlistmodel_create(callbackObject: *const libc::c_void, metaObject: DosQMetaObj...
the_stack
mod stackvec; use core::cmp; use lexical_parse_float::bigint::{self, Limb, StackVec, LIMB_BITS}; use stackvec::vec_from_u32; const SIZE: usize = 50; type VecType = StackVec<SIZE>; #[test] fn simple_test() { // Test the simple properties of the stack vector. let mut x = VecType::from_u32(1); assert_eq!(x....
the_stack
#![allow(nonstandard_style)] use core::ops::Range; use gimli::{Reader, DwEhPe, Endianity, EndianSlice, constants::*, }; use FallibleIterator; /// `GccExceptTableArea` contains the contents of the Language-Specific Data Area (LSDA) /// that is used to locate cleanup (run destructors for) a given function during stack ...
the_stack
use cgmath::*; use serde::Deserialize; use std::{error::Error, path::Path, path::PathBuf, time::Duration}; use wgpu::util::DeviceExt; use crate::{timer::Timer, wgpu_utils::uniformbuffer::PaddedVector3}; use super::FluidConfig; // Data describing a model in the scene. #[derive(Deserialize, Clone)] pub struct StaticOb...
the_stack
//! # Commonly used functionality adapters. //! //! At the moment, this crate contains the declaration of various errors use { anyhow::anyhow, rust_icu_sys as sys, std::{ffi, os}, thiserror::Error, }; /// Represents a Unicode error, resulting from operations of low-level ICU libraries. /// /// This is...
the_stack
use crate::result::{Errors, Result}; use crate::storage::block::{to_record_type, Record, RecordType, Value}; use crate::traits::{ResourceKey, ResourceValue}; use buffered_offset_reader::{BufOffsetReader, OffsetReadMut}; use std::fs::{read_dir, File}; use std::path::PathBuf; pub struct SSTableValue { // byte array ...
the_stack
use stm32ral::gpio; use stm32ral::{read_reg, write_reg, modify_reg}; use crate::app::PinState; pub struct GPIO { p: gpio::Instance, } pub struct Pin<'a> { n: u8, port: &'a GPIO, } pub struct Pins<'a> { pub led: Pin<'a>, pub cs: Pin<'a>, pub fpga_rst: Pin<'a>, pub sck: Pin<'a>, pub fla...
the_stack
use enigma_types::{ContractAddress, EnclaveReturn, ExecuteResult, PubKey, RawPointer, traits::SliceCPtr}; use super::WasmResult; use crate::db::DB; use std::convert::TryInto; use failure::Error; use sgx_types::*; use crate::auto_ffi::{ecall_deploy, ecall_execute}; #[logfn(TRACE)] pub fn deploy(db: &mut DB, eid: sgx_en...
the_stack
//! Menubar use super::{Menu, SubMenu, SubMenuBuilder}; use kas::event::Command; use kas::layout::{self, RowPositionSolver, RowSetter, RowSolver, RulesSetter, RulesSolver}; use kas::prelude::*; use kas::theme::FrameStyle; impl_scope! { /// A menu-bar /// /// This widget houses a sequence of menu buttons, ...
the_stack
use std::collections::{HashMap, HashSet}; use std::fmt::{Display, Formatter}; use std::fs::File; use std::hash::{Hash, Hasher}; use std::io; use std::io::{BufRead, BufReader, ErrorKind}; use std::path::PathBuf; use std::sync::Arc; use anyhow::anyhow; use hdrhistogram::Histogram; use itertools::Itertools; use metrohash...
the_stack
extern crate abomonation_derive; extern crate abomonation; extern crate rand; extern crate timely; extern crate differential_dataflow; use std::io::BufRead; use timely::dataflow::ProbeHandle; use timely::dataflow::operators::unordered_input::UnorderedInput; use timely::dataflow::operators::Probe; use timely::progres...
the_stack
mod support; use csml_interpreter::data::context::Context; use csml_interpreter::data::event::Event; use std::collections::HashMap; use crate::support::tools::format_message; use crate::support::tools::message_to_json_value; use serde_json::Value; #[test] fn ok_addition() { let data = r#"{"memories":[], "messag...
the_stack
extern crate proc_macro; use proc_macro::TokenStream; use proc_macro2::{Span, TokenStream as TokenStream2}; use proc_macro_error::{emit_error, proc_macro_error}; use quote::quote; use std::collections::BTreeMap; use syn::{parse_macro_input, DeriveInput, Ident, LitStr, Type}; mod parse_query; use parse_query::Query; ...
the_stack
//! A fast, asynchronous terminal paging library for Rust. `minus` provides high //! level functions to easily embed a pager for any terminal application. //! //! `minus` can be used in asynchronous mode or in a blocking fashion //! //! * In asynchronous mode, the pager's data as well as it's //! configuration can be *...
the_stack
use std::{fs, io::prelude::*, path::Path}; use sigma::*; use crate::{ asset_builder::AssetBuilder, cargo_toml::*, command::Command, config::*, node_toml::*, templates::*, }; /// Builds the project with the given settings. pub struct Builder; pub fn save_template(template: String, path: impl Into<String>) { ...
the_stack
* file name: XeTeXFontInst.h * * created on: 2005-10-22 * created by: Jonathan Kew * * originally based on PortableFontInstance.h from ICU */ #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)] use crate::core_memory::xmalloc; use harfbuzz_sys::{ hb_blob_create, hb_blob_t, hb_boo...
the_stack
use std; use pyo3::*; use futures::{future, unsync, Async, Poll}; use boxfnonce::BoxFnOnce; use TokioEventLoop; use utils::{Classes, PyLogger}; use pyunsafe::{GIL, OneshotSender, OneshotReceiver}; use pyfuture::{_PyFuture, PyFuture, Callback, State}; #[py::class(weakref, freelist=250)] pub struct PyTask { fut: _...
the_stack
use bindings::{ windows::foundation::numerics::*, windows::win32::com::*, windows::win32::direct2d::*, windows::win32::direct3d11::*, windows::win32::dxgi::*, windows::win32::gdi::*, windows::win32::menus_and_resources::*, windows::win32::system_services::*, windows::win32::ui_animation::*, windows::win...
the_stack
use crate::error::InvalidArgumentError; use super::error::PikeBuilderError; use super::{Agent, AlternateId, Organization, OrganizationMetadata, Role}; /// Builder used to create a Pike Agent #[derive(Clone, Debug, Default)] pub struct AgentBuilder { public_key: Option<String>, org_id: Option<String>, acti...
the_stack
use std::cmp::Ordering; use std::sync::Arc; use anyhow::Result; use crate::algorithms::tr_unique::tr_compare; use crate::fst_impls::vector_fst::{VectorFst, VectorFstState}; use crate::fst_properties::mutable_properties::{ add_state_properties, add_tr_properties, delete_all_states_properties, delete_states_pro...
the_stack
use stm32h7xx_hal as hal; use mutex_trait::Mutex; use super::design_parameters::{SampleBuffer, MAX_SAMPLE_BUFFER_SIZE}; use super::timers; use hal::dma::{ config::Priority, dma::{DMAReq, DmaConfig}, traits::TargetAddress, DMAError, MemoryToPeripheral, PeripheralToMemory, Transfer, }; /// A type repr...
the_stack
extern crate ruby_parser; #[macro_use] mod helpers; use std::path::PathBuf; use std::rc::Rc; use ruby_parser::{Error, Level}; const OPTIONS: ruby_parser::ParserOptions = ruby_parser::ParserOptions { emit_file_vars_as_literals: false, emit_lambda: true, emit_procarg0: true, declare_env: &["foo", "bar", "baz"]...
the_stack
#![allow(non_snake_case)] #![allow(dead_code,unused_variables)] use prelude::*; use super::shim_ext::*; use super::va_list::VaList; #[no_mangle] #[linkage="external"] extern "C" fn AcpiOsInitialize() -> ACPI_STATUS { AE_OK } #[no_mangle] #[linkage="external"] extern "C" fn AcpiOsTerminate() -> ACPI_STATUS { AE_OK } ...
the_stack
#[repr(u32)] /** Log levels */ #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum SayLevel { Fatal = 0, System = 1, Error = 2, Crit = 3, Warn = 4, Info = 5, Debug = 6, } extern "C" { #[link_name = "log_level"] pub static mut log_level: ::std::os::raw::c_int; pub fn say_log_level_is_...
the_stack
use super::{BoxedFnOnce, Duration, FnOnceQueue, Instant, MaxTimerKey, MinTimerKey, Timers}; const N_COUNTS: usize = 256; struct Aux { start: Instant, now: Instant, queue: FnOnceQueue<Aux>, seed: u16, index: usize, counts: [u8; N_COUNTS], } impl Aux { fn new() -> Self { let now = Inst...
the_stack
//! Types used by size rules use super::{Align, AlignHints, AxisInfo, SizeRules}; use crate::cast::*; use crate::dir::Directional; use crate::geom::{Rect, Size, Vec2}; use kas_macros::{impl_default, impl_scope}; // for doc use #[allow(unused)] use crate::theme::SizeMgr; /// Logical (pre-scaling) pixel size /// /// A...
the_stack
extern crate ws; use self::ws::{Sender as WSSender, Message}; extern crate serde_json; use rand::{self, Rng}; use std::ops::Deref; use std::path::{PathBuf}; use std::sync::{Arc, Mutex}; use std::sync::mpsc::{self, Sender}; use std::thread::{self, JoinHandle}; use std::collections::HashSet; use super::super::indexes::...
the_stack
#[macro_use] extern crate log; extern crate env_logger; #[macro_use] extern crate futures; #[macro_use] extern crate tokio_core; extern crate byteorder; use std::rc::Rc; use std::io::{self, Read, Write, Error, ErrorKind}; use std::net::Shutdown; use futures::{Future, Poll, Async}; use tokio_core::net::{TcpStream}; us...
the_stack
use anyhow::Context; use anyhow::{anyhow, bail, Result}; use byteorder::LittleEndian; use byteorder::ReadBytesExt; use bytes::Buf; use bytes::BufMut; use bytes::Bytes; use bytes::BytesMut; use postgres_ffi::waldecoder::WalStreamDecoder; use postgres_ffi::xlog_utils::TimeLineID; use serde::{Deserialize, Serialize}; use ...
the_stack
use std::sync::Arc; use std::str; use std::path::Path; use byteorder::{ByteOrder, BigEndian}; use capnp::{serialize, message}; use rocksdb::*; use crate::storage_format_capnp::*; use crate::disk_store::interface::*; use crate::mem_store::column::{Column, DataSection, DataSource}; use crate::scheduler::inner_locustdb:...
the_stack
use as_slice::AsSlice; use core::convert::TryInto; use core::marker::PhantomData; use core::ops::Deref; use core::pin::Pin; use crate::dma; use crate::pac::{QUADSPI, RCC}; use crate::state; /// The QSPI driver interface. pub struct Qspi { /// QSPI peripheral registers. qspi: QUADSPI, /// Address size for ...
the_stack
use r_efi::efi::{self, AllocateType, MemoryType, PhysicalAddress, Status, VirtualAddress}; const PAGE_SIZE: u64 = 4096; // Copied from r_efi so we can do Default on it #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct MemoryDescriptor { pub r#type: u32, pub physical_start: PhysicalAddress, pub virtual_s...
the_stack
use futures::unsync::oneshot; pub use rain_core::common_capnp::TaskState; use rain_core::{errors::*, types::*, utils::*}; use std::fmt; use error_chain::bail; use super::{DataObjectRef, DataObjectState, GovernorRef, SessionRef}; use wrapped::WrappedRcRefCell; #[derive(Debug)] pub struct Task { /// Current state. ...
the_stack
use std; use failure::Error; use remoteprocess::ProcessMemory; use crate::python_interpreters::{StringObject, BytesObject, InterpreterState, Object, TypeObject, TupleObject, ListObject}; use crate::version::Version; /// Copies a string from a target process. Attempts to handle unicode differences, which mostly seems...
the_stack
use std::{sync::*, time::Duration}; use collections::HashMap; use concurrency_manager::ConcurrencyManager; use engine_rocks::{RocksEngine, RocksSnapshot}; use grpcio::{ChannelBuilder, ClientUnaryReceiver, Environment}; use kvproto::{kvrpcpb::*, tikvpb::TikvClient}; use online_config::ConfigValue; use raftstore::coproc...
the_stack
use serde::{Deserialize, Serialize}; use std::net::Ipv6Addr; use crate::{ decoder::{Decodable, Decoder}, encoder::{Encodable, Encoder}, error::{DecodeResult, EncodeResult}, v6::MessageType, }; // server can send multiple IA_NA options to request multiple addresses // this means we cannot represent is...
the_stack
#[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(std::clone::Clone, std::cmp::PartialEq)] pub struct UpdateVoiceConnectorGroupOutput { /// <p>The updated Amazon Chime Voice Connector group details.</p> pub voice_connector_group: std::option::Option<crate::model::VoiceConnector...
the_stack
use std::sync::Arc; use crate::protocol::packet; use crate::render::hud::{Hud, START_TICKS}; use crate::render::{hud, Renderer}; use crate::screen::{Screen, ScreenSystem, ScreenType}; use crate::ui; use crate::ui::{Container, FormattedRef, HAttach, ImageRef, TextBuilder, TextRef, VAttach}; use crate::Game; use core::c...
the_stack
use std::collections::BTreeSet; use crate::chip::*; use crate::database::TileBitsDatabase; use std::convert::TryInto; // A reference to a wire in a relatively located tile #[derive(Clone)] pub struct RelWire { pub rel_x: i32, // (bel.x + rel_x == tile.x) pub rel_y: i32, // (bel.y + rel_y == tile.y) pub...
the_stack
use crate::indexes::{PointIndex, EdgeIndex, EdgeVec, EMPTY_EDGE}; /// Represents a directed edge in a triangle graph. #[derive(Copy, Clone, Debug)] pub struct Edge { /// Source of the directed edge pub src: PointIndex, /// Destination of the directed edge pub dst: PointIndex, /// Previous edge in t...
the_stack
warnings, unused_variables, missing_docs, unsafe_code, unused_extern_crates )] #![cfg_attr(all(test, feature = "nightly"), feature(test))] //! Voca_rs is the ultimate Rust string library inspired by Voca.js and string.py //! //! Using functions: //! ```rust //! use voca_rs::*; //! let input_string = "L...
the_stack
//! Functions related to Materialize's numeric type, which is largely a wrapper //! around [`rust-dec`]. //! //! [`rust-dec`]: https://github.com/MaterializeInc/rust-dec/ use anyhow::bail; use dec::{Context, Decimal}; use lazy_static::lazy_static; use super::util; /// The maximum number of digits expressable in a nu...
the_stack
use cpp::cpp; use super::*; cpp! {{ #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // Hack to access QMetaType::registerConverterFunction which is private, but ConverterFunctor // is a friend namespace QtPrivate { template<> struct ConverterFunctor<TraitObject, TraitObject, TraitObject> : public Abst...
the_stack
mod urlencoded; mod xml; use crate::xml::try_xml_equivalent; use assert_json_diff::assert_json_eq_no_panic; use http::{Request, Uri}; use pretty_assertions::Comparison; use std::collections::HashSet; use std::fmt::{self, Debug}; use thiserror::Error; use urlencoded::try_url_encoded_form_equivalent; /// Helper trait f...
the_stack
use super::perms::*; use super::*; use sysconf::page::pagesize; extern crate test; #[cfg_attr(windows, allow(unused))] use self::test::Bencher; #[cfg_attr(windows, allow(unused))] use std::time::{Duration, Instant}; fn test_valid_map_address(ptr: NonNull<u8>) { let ptr = ptr.as_ptr(); assert!(ptr as usize > ...
the_stack
use rustc::hir; use rustc_target::spec::abi::{self, Abi}; use std::rc::Rc; use std::str; use syntax::ast::*; use syntax::attr::mk_attr_inner; use syntax::token::{self, TokenKind, Token}; use syntax::ptr::P; use syntax::source_map::{dummy_spanned, Span, Spanned, DUMMY_SP}; use syntax::tokenstream::{DelimSpan, TokenStrea...
the_stack
use super::json; /// /// Hurl AST /// #[derive(Clone, Debug, PartialEq, Eq)] pub struct HurlFile { pub entries: Vec<Entry>, pub line_terminators: Vec<LineTerminator>, } #[derive(Clone, Debug, PartialEq, Eq)] pub struct Entry { pub request: Request, pub response: Option<Response>, } #[derive(Clone, De...
the_stack
use crate::latch::CoreLatch; use crate::log::Event::*; use crate::log::Logger; use crossbeam_utils::CachePadded; use std::sync::atomic::Ordering; use std::sync::{Condvar, Mutex}; use std::thread; use std::usize; mod counters; use self::counters::{AtomicCounters, JobsEventCounter}; /// The `Sleep` struct is embedded i...
the_stack
use alloc::str::from_utf8_unchecked; use crate::{NP_Schema_Bytes, hashmap::{SEED, murmurhash3_x86_32}}; use crate::{hashmap::NP_HashMap, pointer::uuid::NP_UUID, utils::opt_err}; use crate::NP_Factory; use crate::NP_Schema; use alloc::prelude::v1::Box; use crate::json_decode; use alloc::string::String; use alloc::vec::...
the_stack
use bytes::Bytes; use h2; use http::header::HeaderValue; use http::{self, HeaderMap}; use log::{debug, trace, warn}; use percent_encoding::{percent_decode, percent_encode, EncodeSet, DEFAULT_ENCODE_SET}; use std::{error::Error, fmt}; const GRPC_STATUS_HEADER_CODE: &str = "grpc-status"; const GRPC_STATUS_MESSAGE_HEADER...
the_stack
use ink_lang as ink; use ink_prelude::{ vec::Vec, format }; use ink_env::Environment; #[ink::chain_extension] pub trait FetchPrice { type ErrorCode = FetchPriceErr; /// Note: this gives the operation a corresponding func_id (1101 in this case), /// and the chain-side chain_extension will get the func_id t...
the_stack
use super::diagnostic::{ TrustNewIntervalHandler, TrustTwinEventHandler, GOSSIP_TRUST_NEW_INTERVAL, GOSSIP_TRUST_TWIN_EVENT, }; /// Almost same as src/default_start.rs, only remove graphql service. use super::{config::Config, consts, error::MainError, memory_db::MemoryDB, Sync}; use std::collections::HashMap; ...
the_stack
use super::{ framework::{cb, nil, ns}, utils::{ core_bluetooth::{cbuuid_to_uuid, characteristic_debug, peripheral_debug, service_debug}, nsdata_to_vec, nsuuid_to_uuid, }, }; use futures::channel::mpsc::{self, Receiver, Sender}; use futures::sink::SinkExt; use libc::{c_char, c_void}; use log:...
the_stack
extern crate byteorder; extern crate petgraph; extern crate arena; extern crate env_logger; extern crate getopts; extern crate itertools; extern crate rspirv; extern crate rustc; extern crate rustc_borrowck; extern crate rustc_data_structures; extern crate rustc_driver; extern crate rustc_errors; extern crate rustc_in...
the_stack
use core::mem::swap; use std::cmp::max; use std::cmp::Ordering; use std::fmt::Debug; type Tree<K, V> = Option<Box<Node<K, V>>>; #[derive(Debug)] struct Node<K: Ord + Debug, V> { key: K, value: V, height: isize, left: Tree<K, V>, right: Tree<K, V>, } #[allow(clippy::upper_case_acronyms)] #[derive(...
the_stack
mod utils; use crate::utils::*; use flate2::read::GzDecoder; use serde_json::{json, Value}; use std::fs::{self, File}; use std::io::Read; use tempfile::TempDir; static SQL: &'static str = r" insert into telemetry values(1000, 'eps', 'voltage', '3.3'); insert into telemetry values(1001, 'eps', 'current', '3.4'); inser...
the_stack
use super::bsw::*; use super::sbac::*; use super::util::*; use crate::api::*; use crate::def::*; use crate::tbl::*; use crate::tracer::*; use crate::util::*; pub(crate) fn evce_eco_nalu(bs: &mut EvceBsw, nalu: &EvcNalu) { bs.write(nalu.nal_unit_size, 32, None); bs.write( nalu.forbidden_zero_bit as u32,...
the_stack
use crate::errors::{DelgError, DelgResult}; use crate::groth_sig::{Groth1SetupParams, Groth1Sig, Groth1Verkey, Groth2SetupParams, Groth2Sig}; use crate::issuer::{CredChain, EvenLevelVerkey, OddLevelVerkey}; use amcl_wrapper::extension_field_gt::GT; use amcl_wrapper::field_elem::{FieldElement, FieldElementVector}; use a...
the_stack
use crate::{ ty::{common::CommonInfo, BinaryFormat, Dir}, value::{IntegerValue, Value}, }; use std::{fmt::Display, ops::RangeInclusive}; /// Integer format. #[derive(Eq, PartialEq, Ord, PartialOrd, Debug, Clone, Copy, Default)] pub struct IntFormat { pub fmt: BinaryFormat, pub bitfield_off: u64, pu...
the_stack
extern crate clap; #[macro_use] extern crate log; extern crate loggerv; extern crate openssl_probe; extern crate lal; use lal::*; use clap::{Arg, App, AppSettings, SubCommand, ArgMatches}; use std::process; use std::ops::Deref; fn is_integer(v: String) -> Result<(), String> { if v.parse::<u32>().is_ok() { ...
the_stack
// The register interface uses `+` in a way that is fine for bitfields, but // looks unusual (and perhaps problematic) to a linter. We just ignore those // lints for this file. #![allow(clippy::suspicious_op_assign_impl)] #![allow(clippy::suspicious_arithmetic_impl)] use core::marker::PhantomData; use core::ops::{Add,...
the_stack
use crate::{ ack::AckManager, connection::{self, limits::Limits}, endpoint, path, space::{ keep_alive::KeepAlive, ApplicationSpace, HandshakeSpace, HandshakeStatus, InitialSpace, }, stream::AbstractStreamManager, }; use bytes::Bytes; use core::{ops::Not, task::Waker}; use s2n_codec::{Dec...
the_stack
use std::cell::{Ref, RefCell, RefMut}; use std::collections::HashMap; use std::rc::Rc; use ::cursive::view::{Identifiable, Scrollable, View}; use cursive::event::{Event, EventResult, EventTrigger}; use cursive::utils::markup::StyledString; use cursive::view::ViewWrapper; use cursive::views::{ LinearLayout, NamedVi...
the_stack
mod sound; use sdl2::image::{LoadTexture, INIT_PNG}; use sdl2::event::Event; use sdl2::keyboard::Keycode; use sdl2::rect::Rect; use sdl2::render::{WindowCanvas, Texture}; use sdl2::audio::AudioSpecDesired; use std::path::Path; use std::time::{SystemTime, UNIX_EPOCH}; use num::FromPrimitive; use ruzzt_engine::board_m...
the_stack
use crate::{ leapmap::{AtomicCell, LeapMap}, Value, }; use core::alloc::Allocator; use core::hash::{BuildHasher, Hash}; use core::sync::atomic::Ordering; /// A reference to an atomic cell in a [LeapMap], which cannot mutate /// the referenced cell value. pub struct Ref<'a, K, V, H, A: Allocator> { /// The ...
the_stack
use std; use std::collections::HashMap; use csv; use lazy_static::lazy_static; use pbr::ProgressBar; use std::error; use std::error::Error; use std::fmt; use std::fs; use std::fs::File; use std::io::prelude::*; use std::path::Path; use std::path::PathBuf; use std::process::Command; use std::str::FromStr; use x86::cpui...
the_stack
use serde::{Deserialize, Serialize}; use std::collections::{BTreeMap, HashMap}; use std::path::PathBuf; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, RwLock}; use std::time::Duration; use std::{fs, thread}; #[derive(Serialize, Deserialize, Debug, Clone, Copy)] pub struct Temperature { pub cur...
the_stack
use syn::Result; use quote::{format_ident, quote, ToTokens, TokenStreamExt}; use crate::internal::*; macro_rules! try_expand { ($x:expr) => { match $x { Ok(x) => x, Err(err) => return err.into_compile_error(), } }; } trait VersionExt { fn version(&self, version: &...
the_stack
use std::collections::HashSet; use crate::cgroup_view::CgroupState; use crate::render::ViewItem; use crate::stats_view::StateCommon; use model::{sort_queriables, CgroupModel, SingleCgroupModel}; use cursive::utils::markup::StyledString; /// Renders corresponding Fields From CgroupModel. type CgroupViewItem = ViewIt...
the_stack
//! Implements the traits found in [ecma402_traits::datetimeformat]. use ecma402_traits; use rust_icu_common as common; use rust_icu_udat as udat; use rust_icu_uloc as uloc; use rust_icu_ustring as ustring; use std::{convert::TryFrom, fmt}; #[derive(Debug)] pub struct DateTimeFormat { // The internal representati...
the_stack
use std::{ptr, sync::atomic}; use bindings::Windows::Win32::{ Foundation::{HWND, LPARAM, POINT, WPARAM}, Graphics::{Direct2D, Direct3D11, DirectComposition, Dxgi}, UI::WindowsAndMessaging, }; use windows::*; use crate::{form, form_nchittest, DEBUG}; const CONTROL_BUTTON_WIDTH: f32 = 44.; const CONTROL_BU...
the_stack
// You should have received a copy of the MIT License // along with the Jellyfish library. If not, see <https://mit-license.org/>. #![allow(missing_docs)] //! Circuit implementation of a Merkle tree. use crate::merkle_tree::{AccMemberWitness, MerklePath, MerkleTree, NodePos, NodeValue}; use ark_ec::TEModelParameters...
the_stack
use std::borrow::Cow; use std::collections::HashSet; use std::sync::Arc; use dialoguer::console::style; use dialoguer::theme::ColorfulTheme; use dialoguer::Confirm; use hypothesis::annotations::Annotation; use skim::prelude::{unbounded, Key, SkimOptionsBuilder}; use skim::{ AnsiString, DisplayContext, ItemPreview,...
the_stack
// TODO: Move this code to a separate driver as well? use std::convert::TryFrom; use std::ops::Deref; use std::{fmt, mem}; use syscall::io::Io as _; use num_derive::FromPrimitive; use num_traits::FromPrimitive; use self::drhd::DrhdPage; use crate::acpi::{AcpiContext, Sdt, SdtHeader}; pub mod drhd; #[repr(packed)]...
the_stack
extern crate libbpf; extern crate libc; extern crate nix; extern crate regex; extern crate structopt; mod bindings; mod generated_bytecode; mod pstree; use generated_bytecode::generate_execve_entry; use generated_bytecode::generate_exit_group_entry; use generated_bytecode::generate_trace_entry; use generated_bytecode...
the_stack
use chrono::{TimeZone, Utc}; use rusqlite::{named_params, params, Connection, ToSql}; use super::{ base::{CommandLineSearch, SearchDirection, SearchQuery}, History, HistoryItem, HistoryItemId, HistorySessionId, }; use crate::{ result::{ReedlineError, ReedlineErrorVariants}, Result, }; const SQLITE_APP...
the_stack
mod spec; const OPENAPI_VERSION: &str = "3.0.0"; /// A number rule to set up an enum for a given numeric type. macro_rules! number_rule { ($variants:ident, $name:ident, $convert:ident) => {{ let mut __number = spec::$name::default(); for n in $variants { let n = n.value.$convert().ok_...
the_stack
//! Serialization for BinProt following the standard serde module layout use crate::error::{Error, Result}; use crate::WriteBinProtExt; use serde::ser; use serde::Serialize; /// Serializer for writing BinProt bytes to a writer pub struct Serializer<W> { writer: W, } impl<W> Serializer<W> { /// Create a new s...
the_stack
use crate::ast::Const; use super::super::visitors::prelude::*; macro_rules! stop { ($e:expr, $leave_fn:expr) => { if $e? == VisitRes::Stop { return $leave_fn; } }; } /// Visitor for traversing all `ImutExprInt`s within the given `ImutExprInt` /// /// Implement your custom expr visi...
the_stack
use crate::{ fmt::{Error, FormattingFlags, NoEncoding, StrWriter, StrWriterMut}, utils::saturate_range, wrapper_types::{AsciiStr, PWrapper}, }; use core::ops::Range; //////////////////////////////////////////////////////////////////////////////// /// For computing how long a formatted string would be. //...
the_stack
use { anyhow::{format_err, Error}, fidl_fuchsia_input as input, fidl_fuchsia_ui_input3 as ui_input3, fidl_fuchsia_ui_shortcut as ui_shortcut, fuchsia_async as fasync, fuchsia_async::TimeoutExt, fuchsia_syslog::{fx_log_debug, fx_log_err, fx_log_info}, fuchsia_zircon as zx, futures::{lock::Mut...
the_stack
extern crate bytes; extern crate futures_await as futures; extern crate tokio_core; extern crate tokio_io; mod cmd; mod codec; mod error; mod ftp; use std::io; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::env; use std::path::{PathBuf, StripPrefixError}; use std::result; use futures::{Sink, Stream}; use fut...
the_stack
// https://github.com/rust-lang/rust-clippy/issues/702 #![allow(unknown_lints)] #![allow(clippy::all)] #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] #![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(non_upper_cas...
the_stack
use nix::sys::wait::{self, WaitStatus}; use nix::unistd; use std::borrow::Cow; use std::collections::HashMap; use std::ffi::{OsStr, OsString}; use std::io::Write; use std::os::unix::io::RawFd; use std::os::unix::process::{CommandExt, ExitStatusExt}; use std::process::{self, Child, Command, ExitStatus, Stdio}; use std:...
the_stack
use crate::token::{Primitive, Range, Token, TokenStream}; use combine::error::StringStreamError; use combine::parser::{ char::{alpha_num, char, letter, spaces, string}, choice::{choice, optional}, combinator::attempt, range::recognize, repeat::{many, skip_many1}, Parser, }; use either_n::{Either...
the_stack
use crate::{ index::{ BitEnd, BitIdx, BitMask, BitPos, BitSel, }, mem::{ bits_of, BitRegister, }, }; #[doc = include_str!("../doc/order/BitOrder.md")] pub unsafe trait BitOrder: 'static { /// Translates a semantic bit index into a real bit position. /// /// This function is the basis of the trait,...
the_stack
use crate::errors::{DelgError, DelgResult}; use crate::groth_sig::{ Groth1SetupParams, Groth1Sig, Groth1Verkey, Groth2SetupParams, Groth2Sig, Groth2Verkey, GrothS1, GrothS2, GrothSigkey, }; use amcl_wrapper::group_elem::{GroupElement, GroupElementVector}; use amcl_wrapper::group_elem_g1::{G1LookupTable, G1Vecto...
the_stack
use crate::{on_disk_cache, Queries}; use rustc_middle::dep_graph::{DepKind, DepNodeIndex, SerializedDepNodeIndex}; use rustc_middle::ty::tls::{self, ImplicitCtxt}; use rustc_middle::ty::TyCtxt; use rustc_query_system::dep_graph::HasDepContext; use rustc_query_system::query::{QueryContext, QueryJobId, QueryMap, QuerySid...
the_stack
use crate::config::{Client, Response}; use crate::ids::{ChargeId, PaymentIntentId, RefundId}; use crate::params::{Expand, Expandable, List, Metadata, Object, RangeQuery, Timestamp}; use crate::resources::{BalanceTransaction, Charge, Currency, PaymentIntent, TransferReversal}; use serde_derive::{Deserialize, Serialize};...
the_stack
#[cfg(feature = "priority_boost")] use core::sync::atomic::{AtomicBool, Ordering}; use core::{fmt, marker::PhantomData, mem::forget, num::NonZeroUsize, ops::Range}; use crate::{ time::{Duration, Time}, utils::{binary_heap::VecLike, BinUInteger, Init}, }; #[macro_use] pub mod cfg; mod error; mod event_group; m...
the_stack
use core::marker::PhantomData; use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign}; #[cfg(feature = "random")] use rand::distributions::uniform::{SampleBorrow, SampleUniform, Uniform, UniformSampler}; #[cfg(feature = "random")] use rand::distributions::{Distribution, Standard}; #[cfg(featur...
the_stack
use std::collections::HashMap; use std::fmt; use std::iter::repeat; use std::mem; use std::sync::Arc; use exec::ProgramCache; use prog::{Inst, Program}; use sparse::SparseSet; /// Return true if and only if the given program can be executed by a DFA. /// /// Generally, a DFA is always possible. A pathological case wh...
the_stack
use std::cmp::Ordering; use std::fmt::Debug; use std::mem; #[derive(Debug, Clone, Eq, PartialEq)] struct Node<T: Ord + Debug + PartialEq + Eq + Clone> { value: T, height: i32, balance_factor: i8, left: Option<Box<Node<T>>>, right: Option<Box<Node<T>>>, } impl<T: Ord + Debug + PartialEq + Eq + Clon...
the_stack
// Copyright (C) 2020-2021 Intergalactic, Limited (GIB). // 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.org/licenses/LIC...
the_stack
extern crate random_access_memory as ram; mod common; use common::create_feed; use hypercore::{generate_keypair, Feed, NodeTrait, PublicKey, SecretKey, Storage}; use random_access_storage::RandomAccess; use std::env::temp_dir; use std::fmt::Debug; use std::fs; use std::io::Write; #[async_std::test] async fn create_w...
the_stack
use std::cell::{Cell, RefCell}; use std::rc::Rc; use wayland_client as wlc; use wayland_client::protocol::wl_surface; use wayland_protocols::xdg_shell::client::xdg_popup; use wayland_protocols::xdg_shell::client::xdg_positioner; use wayland_protocols::xdg_shell::client::xdg_surface; use crate::kurbo; use crate::window...
the_stack