text
stringlengths
7.05k
33.9k
use crate::cryptoutil::read_u64v_be; use crate::simd::u64x2; /// Not an intrinsic, but works like an unaligned load. #[inline] fn sha512load(v0: u64x2, v1: u64x2) -> u64x2 { u64x2(v1.1, v0.0) } /// Performs 2 rounds of the SHA-512 message schedule update. fn schedule_x2(v0: u64x2, v1: u64x2, v4to5: u64x2, v7: u64...
pub(crate) mod arc; pub(crate) mod ellipse; #[cfg(image)] pub(crate) mod image; pub(crate) mod line; pub(crate) mod path; pub(crate) mod rect; pub(crate) mod state; #[cfg(text)] pub(crate) mod text; pub(crate) mod triangle; use glfw::{Action, Context, WindowEvent}; use luminance::{ context::GraphicsContext, pi...
//! The TCP stream between a client and the DAC. use ether_dream::dac; use ether_dream::protocol::{ self, command, Command as CommandTrait, ReadBytes, SizeBytes, WriteBytes, }; use futures::future::FutureExt; use futures::io::{AsyncReadExt, AsyncWriteExt}; use piper::Mutex; use smol::Async; use std::collections::V...
use crate::allocator::{Allocator, AtomBuf, NodePtr, SExp}; use crate::cost::Cost; use crate::err_utils::err; use crate::node::Node; use crate::operator_handler::OperatorHandler; use crate::reduction::{EvalErr, Reduction, Response}; use crate::number::{ptr_from_number, Number}; pub const STRICT_MODE: u32 = 1; // lowe...
use std::borrow::Cow; use std::io; use std::sync::mpsc::Sender; use std::sync::{Arc, Mutex, RwLock}; use std::thread; use std::time::{Duration, Instant}; use crate::style::{ProgressFinish, ProgressStyle}; use crate::utils::{duration_to_secs, secs_to_duration, Estimate}; use console::Term; /// The state of a progress ...
//! Storage implementation(s) backing the [`crate::Ipfs`]. use async_trait::async_trait; use cid::Cid; use core::fmt::Debug; use std::borrow::Borrow; use std::hash::{Hash, Hasher}; use std::path::PathBuf; use std::sync::{Arc, Mutex}; use std::{error, fmt, io}; use libp2p_rs::core::PeerId; use crate::error::Error; use...
use std::borrow::ToOwned; use once_cell::sync::Lazy; use regex::Regex; #[allow(unused_imports)] // For docs. use super::models::annotation::Annotation; /// Capture a 'Step Reference' e.g. `/6` `/4` /// /// <https://w3c.github.io/epub-specs/epub33/epubcfi/#sec-path-child-ref> static RE_STEP_REFERENCE: Lazy<Regex> = L...
// Copyright (c) SimpleStaking and Tezedge Contributors // SPDX-License-Identifier: MIT //! This actor responsibility is to take care of Mempool/MempoolState, //! which means, to validate operations which are not yet injected in any block. //! //! This actor listens on shell events (see [process_shell_channel_message]...
use std::borrow::Cow; use std::sync::atomic::{AtomicU64, AtomicU8, Ordering}; use std::sync::Arc; use std::time::{Duration, Instant}; use std::{fmt, io}; use crate::draw_target::ProgressDrawTarget; use crate::style::ProgressStyle; pub(crate) struct BarState { pub(crate) draw_target: ProgressDrawTarget, pub(cr...
// This file is part of Substrate. // Copyright (C) 2019-2020 Parity Technologies (UK) Ltd. // 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 // // ht...
use std::cmp::{min, Ordering}; use std::collections::{BTreeMap, HashMap}; use std::mem::size_of; use std::ops::Bound::{Excluded, Included, Unbounded}; use std::ops::RangeBounds; use std::sync::Arc; use async_channel::Sender; use executor::{Handler, ModuleRef, System}; use log::debug; use tokio::sync::Mutex; /// An id...
/* * Copyright (C) 2020 Red Hat, Inc. * * SPDX-License-Identifier: Apache-2.0 */ use anyhow::{bail, Context, Result}; use fs2::FileExt; use gio::NONE_CANCELLABLE; use nix::sys::socket as nixsocket; use openat_ext::OpenatDirExt; use serde_derive::{Deserialize, Serialize}; use std::collections::{BTreeMap, BTreeSet};...
//! A trait for implementing a foreign data wrapper. //! //! Adapted and transalated from https://github.com/slaught/dummy_fdw/blob/master/dummy_data.c //! and https://bitbucket.org/adunstan/rotfang-fdw/src/ca21c2a2e5fa6e1424b61bf0170adb3ab4ae68e7/src/rotfang_fdw.c?at=master&fileviewer=file-view-default //! For use wit...
use anyhow::Context; use async_trait::async_trait; use rand::rngs::StdRng; use serde::Serialize; use std::{convert::TryInto, fs::File, path::PathBuf}; use std::convert::Infallible; use zkabacus_crypto::{ customer::{Inactive, Requested}, ChannelId, Context as ProofContext, CustomerBalance, CustomerRandomness, ...
/*! _hypher_ separates words into syllables. # Features - All-inclusive: Hyphenation patterns are embedded into the binary as efficiently encoded finite automata at build time. - Zero load time: Hyphenation automata operate directly over the embedded binary data with no up-front decoding. - No allocations unless w...
use itertools::Itertools; use itertools::FoldWhile::{Continue, Done}; use super::simplex::{Simplex, CNS, SimplexConverter}; use std::collections::{HashSet, HashMap}; use super::rips::RichSimplex; #[derive(Debug, Clone, Copy, Eq, PartialEq)] struct PersistencePair { face_index: usize, coface_index: usize } str...
//! This module provides the user data related functionality and abstracts the //! database operations for `NickTracker`. It also handles the printing of the //! lists of matching nicknames. //! use fallible_iterator::FallibleIterator; use regex::Regex; use rusqlite::Connection; use rusqlite::functions::Context as S...
use crate::chip8::Register; use num_traits::FromPrimitive; use std::convert::From; struct Instruction(u16); impl Instruction { pub fn raw(&self) -> u16 { self.0 } /// We can use the top 4-bits of the opcode as a switch into the type of opcode for easier parsing pub fn op(&self) -> u8 { ...
//! A domain name that can be both relative or absolute. //! //! This is a private module. Its public types are re-exported by the parent. use std::{error, fmt, str}; use bytes::BufMut; use derive_more::Display; use crate::compose::Compose; use crate::master::scan::{CharSource, Scan, Scanner, ScanError, Symbol}; use s...
use image; use image::{DynamicImage, GenericImageView, Rgba}; use image::png::{PngDecoder}; use image::gif::{GifDecoder}; use image::{AnimationDecoder}; use std::fs::File; use std::collections::HashMap; use serde::{Deserialize, Serialize}; use enum_iterator::IntoEnumIterator; #[derive(Debug)] pub enum IconError { ...
//! Serializer for the [Turtle] concrete syntax of RDF. //! //! **Important**: //! the methods in this module accepting a [`Write`] //! make no effort to minimize the number of write operations. //! Hence, in most cased, they should be passed a [`BufWriter`]. //! //! [Turtle]: https://www.w3.org/TR/turtle/ //! [`Write`...
#[allow(non_camel_case_types)] #[derive(Debug, Copy, Clone, PartialEq)] pub enum CommandType { Pass, Nick, User, Server, Oper, Quit, SQuit, Join, Part, Mode, Topic, Names, List, Invite, Kick, Version, Stats, Links, Time, Connect, Trace,...
/******************************************************************************* * * kit/kernel/multiboot.rs * * vim:ft=rust:ts=4:sw=4:et:tw=80 * * Copyright (C) 2015-2021, <NAME> * Redistribution of this file is permitted under the terms of the simplified * BSD license. See LICENSE for more information. * **...
use plonky2_field::batch_util::batch_add_inplace; use plonky2_field::extension_field::{Extendable, FieldExtension}; use plonky2_field::field_types::Field; use plonky2_field::zero_poly_coset::ZeroPolyOnCoset; use crate::gates::gate::PrefixedGate; use crate::hash::hash_types::RichField; use crate::iop::ext_target::Exten...
//#![windows_subsystem = "windows"] // Tells windows compiler not to show console window #![warn(clippy::all)] mod ui { pub mod components; pub mod icons; pub mod style; } mod analysis { pub mod monte_carlo; pub mod root_sum_square; pub mod structures; } mod io { pub mod dialogs; pub ...
use crate::encrypt; use regex::Regex; use std::collections::HashMap; use reqwest::header; use reqwest::header::{HeaderName, HeaderValue}; use reqwest::blocking::Client; use form_urlencoded; use std::time::{SystemTime, UNIX_EPOCH}; use rand::RngCore; use rand::rngs::OsRng; use std::convert::TryFrom; #[derive(Debug)...
use super::{ bucket::{self, Bucket}, node::{Node, NodeHandle, NodeStatus}, }; use crate::id::{NodeId, ID_LEN}; use std::{cmp::Ordering, iter::Filter, slice::Iter}; pub const MAX_BUCKETS: usize = ID_LEN * 8; /// Routing table containing a table of routing nodes as well /// as the id of the local node participa...
use async_std::channel::Sender; use async_std::future; use async_std::io::{ErrorKind, ReadExt}; use async_std::net::{IpAddr, Shutdown, SocketAddr, TcpStream}; use async_std::sync::{Arc, Mutex}; use async_std::task::{self, JoinHandle}; use futures::stream::{FuturesUnordered, StreamExt}; use futures::Future; use std::col...
//! # Day 10: Adapter Array //! //! Patched into the aircraft's data port, you discover weather forecasts of a massive tropical storm. Before you can figure out whether it will impact your vacation plans, however, your device suddenly turns off! //! //! Its battery is dead. //! //! You'll need to plug it in. There's on...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - I2S Digital Audio Output Register. Contains control bits for the I2S transmit channel."] pub dao: DAO, #[doc = "0x04 - I2S Digital Audio Input Register. Contains control bits for the I2S receive channel."] pub dai: DAI, ...
//! Helper functions and structs for picking dates. use iced_graphics::Color; /// A color in the HSV color space. #[derive(Clone, Copy, Debug, PartialEq)] pub struct Hsv { /// HSV hue. pub(crate) hue: u16, /// HSV Saturation. pub(crate) saturation: f32, /// HSV value. pub(crate) value: f32, } ...
#[macro_use] extern crate log; use std::collections::{HashMap, HashSet}; use std::sync::{Arc, Mutex, MutexGuard, TryLockError}; use std::thread; use std::thread::JoinHandle; use std::collections::hash_map::Entry; use crossbeam::channel::{Sender, Receiver, unbounded}; const NUM_MAX_ATTEMPTS: i32 = 100; #[derive(Debug...
// A single audio channel use super::{ brr::SampleBlock, envelope::Envelope }; use crate::mem::RAM; pub struct Voice { left_vol: i8, right_vol: i8, pitch: u16, src_num: u8, // Lower byte of memory addr to use for sample. adsr: u16, gain: u8, noise: b...
// ------------------------------------------------------------------------------------------------- // joinerator | Copyright (C) 2019 eth-p // ------------------------------------------------------------------------------------------------- extern crate ansi_term; extern crate clap; extern crate failure; extern crate...
use hmac::{Hmac, Mac, NewMac}; use pbkdf2::pbkdf2; use reqwest::{Client, Response}; use sha2::{Digest, Sha256, Sha512}; use std::convert::From; use std::num::NonZeroU32; use std::str::FromStr; use thiserror::Error; enum HashFunction { Sha256, Sha512, } impl FromStr for HashFunction { type Err = ParseHashF...
use crate::common::*; use crate::errors::{Error, Result}; use crate::utils::*; use proc_macro2::{TokenStream as SynTokenStream, Span as SynSpan}; use syn::*; use syn::spanned::Spanned; use quote::{quote, ToTokens}; // TODO: Figure out what to do with elided type parameters in function arguments. // TODO: Properly hand...
//! Abstractions over the UART registers of the Tegra X1. //! //! See Chapter 36.3 in the Tegra X1 Technical Reference Manual //! for details. use register::{mmio::*, register_bitfields, register_structs}; use crate::memory_map::uart::*; /// A pointer to the UART A register block that can be accessed by dereferencin...
// Locals mod utils; // Externs extern crate rand; extern crate minifb; extern crate rodio; // Standard Library use std::env; use std::thread; use std::collections::BTreeSet; use std::fs::File; use std::io::prelude::*; use std::time::{Instant, Duration}; use std::sync::mpsc::channel; // Local use utils::*; // Extern...
#[cfg(test)] #[path = "../../../tests/unit/algorithms/gsom/network_test.rs"] mod network_test; use super::*; use crate::utils::{compare_floats, parallel_into_collect, Noise, Random}; use hashbrown::HashMap; use rand::prelude::SliceRandom; use std::cmp::Ordering; use std::ops::Deref; use std::sync::{Arc, RwLock}; /// ...
use std::io; use std::io::{Write, Read, Seek}; use std::fs::{File, OpenOptions}; use std::io::{Cursor, SeekFrom}; use std::collections::{HashMap}; use super::super::common::*; use super::super::errors::*; use super::super::paths::Host; use super::api::*; use super::volume::{PhysicalVolume}; use core::DirLock; use std::...
use crate::traits::*; use rustc_errors::ErrorReported; use rustc_middle::mir; use rustc_middle::mir::interpret::ErrorHandled; use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, TyAndLayout}; use rustc_middle::ty::{self, Instance, Ty, TypeFoldable}; use rustc_symbol_mangling::typeid_for_fnabi; use rustc_target::abi::cal...
use std::fmt::{self, Display, Formatter}; use std::str::{from_utf8, FromStr}; use std::time::{Duration, SystemTime, UNIX_EPOCH}; use crate::StatusCode; use crate::{bail, ensure, format_err}; const IMF_FIXDATE_LENGTH: usize = 29; const RFC850_MAX_LENGTH: usize = 23; const ASCTIME_LENGTH: usize = 24; const YEAR_9999_S...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 //! Remotely authenticated vs. unauthenticated network end-points: //! --------------------------------------------------- //! A network end-point operates with remote authentication if it only accepts connections //! from a known set ...
use std::borrow::Cow; use std::collections::HashMap; use std::iter::FromIterator; use std::ops::Range; use failure::Error; use crate::psd_channel::PsdChannelCompression; use crate::psd_channel::PsdChannelKind; use crate::sections::image_data_section::ChannelBytes; use crate::sections::layer_and_mask_information_secti...
/*! Indefinite article ("a" and "an") selection for nouns. */ use once_cell::sync::Lazy; use regex::Regex; static ORDINAL_AN_REGEX: Lazy<Regex> = Lazy::new(|| { Regex::new(r"(?ix) \A [aefhilmnorsx] -?th $").expect("Could not parse ordinal an regex") }); static ORDINAL_A_REGEX: Lazy<Regex> = Lazy::new(|| { R...
//! Persistent filesystem backed pin store. See [`FsDataStore`] for more information. use super::{filestem_to_pin_cid, pin_path, FsDataStore}; use crate::error::Error; use crate::repo::{PinKind, PinMode, PinModeRequirement, PinStore, References}; use async_trait::async_trait; use cid::Cid; use core::convert::TryFrom; u...
#![allow(clippy::bool_assert_comparison)] mod auth; mod buffer; mod cli; mod decoder; mod download; mod formatting; mod middleware; mod netrc; mod printer; mod redirect; mod request_items; mod session; mod to_curl; mod utils; mod vendored; use std::env; use std::fs::File; use std::io::{stdin, Read}; use std::path::Pat...
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use crate::msg::MediaType; use crate::swc_common; use crate::swc_common::comments::CommentKind; use crate::swc_common::comments::Comments; use crate::swc_common::errors::Diagnostic; use crate::swc_common::errors::DiagnosticBuilder; use crate::sw...
//! Command management and overall refactoring state. use rustc::hir; use rustc::hir::def_id::LOCAL_CRATE; use rustc::session::{self, DiagnosticOutput, Session}; use rustc_data_structures::sync::Lrc; use rustc_interface::interface; use rustc_interface::util; use rustc_metadata::cstore::CStore; use std::cell::{self, Ce...
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // TODO: get rid of this when splitting dumbo into public and internal parts. #![allow(missing_docs)] use std::convert::From; use std::net::Ipv4Addr; use std::num::NonZeroUsize; use std::result::Result; ...
// Copyright 2021 Twitter, Inc. // Licensed under the Apache License, Version 2.0 // http://www.apache.org/licenses/LICENSE-2.0 #![allow(clippy::unnecessary_unwrap)] #[macro_use] extern crate rustcommon_logger; use boring::ssl::*; use boring::x509::X509; use clap::{App, Arg}; use mio::{Events, Poll, Token}; use mpmc...
//! Java Maven plugin. use crate::{ error::JavaError, java_plugin::JavaPlugin, CompileResult, MavenStudentFilePolicy, TestRun, SEPARATOR, }; use flate2::read::GzDecoder; use j4rs::Jvm; use std::ffi::OsString; use std::io::Cursor; use std::path::{Path, PathBuf}; use std::time::Duration; use tar::Archive; use tm...
use super::*; use bit_array::BitArray; use gfx::{SoldierPart, SpriteData}; use ini::Ini; use std::str::FromStr; use typenum::U256; type BitSet = BitArray<u64, U256>; #[derive(Debug, Copy, Clone)] pub enum SoldierSprite { None, Soldier(gfx::Soldier), Weapon(gfx::Weapon), } impl SoldierSprite { pub fn ...
use crate::sentence::{BoundaryType, Sentence}; use anyhow::{anyhow, Result}; use daachorse::DoubleArrayAhoCorasick; #[derive(Debug, Hash, Clone, Copy, PartialEq, Eq)] pub enum FeatureContent<'a> { CharacterNgram(&'a str), CharacterTypeNgram(&'a [u8]), DictionaryWord(usize), } #[derive(Debug, PartialEq)] ...
mod client; mod errors; mod processor; pub mod proto; mod reader; mod transfer; mod writer; use std::io::Write; use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, TcpListener}; use std::sync::Arc; use std::{fs, io, result, str, thread}; use http_range::HttpRange; use rustls; use sstream::SStream; use url::Url; use s...
//! Generic support for input from both slice and reader sources. //! //! This module provides the abstractions that enable xt to dynamically select //! the most functional and efficient translation strategy for any given input //! regardless of how the tool is invoked. Several factors have influenced its //! design: /...
use std::{ fs::File, io::{BufRead, BufReader}, iter::Sum, ops::{Index, IndexMut}, path::{Path, PathBuf}, sync::{ atomic::{AtomicUsize, Ordering}, Mutex, }, }; use ndarray::prelude::*; use num_derive::FromPrimitive; use rayon::prelude::*; #[derive(Clone, Copy, Debug, Partial...
pub use crate::beacon_chain::{ BEACON_CHAIN_DB_KEY, ETH1_CACHE_DB_KEY, FORK_CHOICE_DB_KEY, OP_POOL_DB_KEY, }; use crate::migrate::{BlockingMigrator, Migrate, NullMigrator}; pub use crate::persisted_beacon_chain::PersistedBeaconChain; use crate::{ builder::{BeaconChainBuilder, Witness}, eth1_chain::CachingEt...
use std::cmp::Ordering; // Contains: // // half_sample_mode - Computes the half-sample mode, an estimate of the mode for weighted data. // HalfSampleInterval - internal struct // HalfSampleModeCache - Caches prior result of half_sample_mode to focus recalculation of mode on a subset of data, a time optimizatio...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - ef_cfg_0."] pub ef_cfg_0: crate::Reg<ef_cfg_0::EF_CFG_0_SPEC>, #[doc = "0x04 - ef_dbg_pwd_low."] pub ef_dbg_pwd_low: crate::Reg<ef_dbg_pwd_low::EF_DBG_PWD_LOW_SPEC>, #[doc = "0x08 - ef_dbg_pwd_high."] pub ef_dbg_pwd...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Timer_B Control Register"] pub tb0ctl: TB0CTL, #[doc = "0x02 - Timer_B Capture/Compare Control Register"] pub tb0cctl0: TB0CCTL0, #[doc = "0x04 - Timer_B Capture/Compare Control Register"] pub tb0cctl1: TB0C...
//! Reactor used to join the network. use std::fmt::{self, Display, Formatter}; use block_executor::BlockExecutor; use consensus::EraSupervisor; use derive_more::From; use prometheus::Registry; use rand::{CryptoRng, Rng}; use small_network::GossipedAddress; use tracing::{error, info, trace, warn}; use crate::{ c...
#[cfg(test)] #[path = "../../../tests/unit/format/problem/reader_test.rs"] mod reader_test; #[path = "./job_reader.rs"] mod job_reader; #[path = "./fleet_reader.rs"] mod fleet_reader; #[path = "./objective_reader.rs"] mod objective_reader; #[path = "./clustering_reader.rs"] mod clustering_reader; use self::cluster...
use rand::{CryptoRng, Rng}; use std::collections::HashMap; use std::convert::{identity, TryFrom}; use std::error::Error; use std::fmt; use std::fmt::{Display, Formatter}; use serde::{Deserialize, Serialize}; use crate::curve::GENERATOR; use crate::curve::{CurveElem, Polynomial}; use crate::elgamal::{Ciphertext, Publi...
use cgmath::{InnerSpace, Matrix4, Point2, Vector2, Zero}; use std::time::Duration; use super::{Scale, TilePos}; /// Minimum target width & height, to avoid divide-by-zero errors. const MIN_TARGET_SIZE: u32 = 10; /// Number of pixels to pan that feels equivalent to scaling by a factor of 2. /// /// Pixels are a very ...
use std::collections::HashMap; use std::hash::Hash; use std::io::{self, prelude::*}; use chrono::prelude::*; use stable_eyre::eyre::{anyhow, bail, ensure, Result}; use crate::compat::attributes::{self, Attributes}; use crate::compat::context::{Context, WorkDir}; use crate::object::*; use crate::plan::{ResourceAccesso...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct SettlementInstructionRequest { /// MsgType = AV #[serde(flatten)] pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'A', 'V'>, /// Unique message ID #[serde(...
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://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 except according to those terms. use hashbrown::{hash_map,...
#[cfg(test)] mod relay_conn_test; // client implements the API for a TURN client use super::binding::*; use super::periodic_timer::*; use super::permission::*; use super::transaction::*; use crate::proto; use crate::Error; use stun::agent::*; use stun::attributes::*; use stun::error_code::*; use stun::fingerprint::*;...
// Copyright 2018 Google 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 agreed to i...
//! Feather, a Minecraft server implementation in Rust. //! //! This is the developer documenation, and anyone wishing to contribute //! should read this first. //! //! The core of Feather is based on [`legion`](https://github.com/TomGillen/legion), //! a fast ECS for Rust, and [`tonks`](https://github.com/feather-rs/t...
//! async.rs //! //! Only tests the default platform (all devices). //! //! Does not panic on errors (use `device_check.rs` example for platform bugs). // #![allow(unused_imports, unused_variables, unused_mut)] use std::thread; use futures::{Future}; use core::Status; use ::{Platform, Device, Context, Queue, Program,...
// Copyright 2020 The Druid Authors. // // 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...
use proc_macro::TokenStream; use quote::*; use std::collections::HashMap; use syn::{parse::Parse, parse::ParseStream, token::Div, token::Gt, token::Lt, Ident, *}; mod parsers; enum HtmlElementClose { AutoClose, CloseElement, } #[derive(Debug, Clone)] enum HtmlElementContent { None, Expression(Expr), ...
extern crate env_logger; extern crate lru; use log::*; use lru::LruCache; use std::fs::create_dir_all; use std::path::Path; use std::path::PathBuf; use std::sync::{Arc, Mutex}; use glob::glob; use rayon::prelude::*; use string_error::new_err; use crate::datafile::DataFile; use crate::datafile::DataFileMetadata; use...
//! Tests for custom derive support. //! //! # Debugging with `cargo expand` //! //! To expand the Rust code generated by the proc macro when debugging //! issues related to these tests, run: //! //! $ cargo expand --test derive --all-features #![cfg(feature = "derive")] /// Custom derive test cases for the `Choice` ...
use std::ops::RangeInclusive; use crate::{ address_map::{ memory::{Memory, ReadOnly, ReadWrite}, AddressMap, Addressable, }, cpu::{register::Register, Cpu, Execute, ExecuteMut, Generate, StepState}, }; #[macro_use] pub mod microcode; #[cfg(test)] mod tests; // Address vectors pub const N...
use std::collections::BTreeSet; use std::io::{self, Read}; use std::ops::{Add, Mul, Sub}; type Coord = i16; // Row major #[derive(Clone, Debug)] struct Matrix([Coord; 9]); #[derive(Copy, Clone, PartialEq, Eq, Ord, PartialOrd, Debug)] struct Point { x: Coord, y: Coord, z: Coord, } impl Matrix { const...
//! This module contains parsing and serialization code for the different commands that can be sent //! to a PulseAudio server (along with the corresponding replies to the client). //! //! For every command, type safe wrappers are defined that handle the (de)serialization of that //! command. Differences between PulseA...
#![no_std] /* NB: THIS IS A no_std CRATE!!!!! */ #![deny(warnings)] // Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to include inner attributes from a common source. #![deny( clippy::all, clippy::def...
//! Wire protocol definitions for the Simple Network Time Protocol v4 (SNTPv4). //! //! See https://tools.ietf.org/html/rfc4330 for the SNTPv4 specification. use byteorder::{ByteOrder, NetworkEndian}; use core::convert; use smoltcp::{Error, Result}; /// The SNTP leap indicator field. #[derive(Debug, PartialEq, Eq, Cl...
use std::collections::HashMap; // self is a rust port of the https://github.com/iden3/circomlib/blob/master/src/evmasm.js tool to rust struct EVMCodeGen { code : Vec<u8>, labels: HashMap<String,usize>, pending_labels : HashMap<String,Vec<usize>>, } impl EVMCodeGen { pub fn new() -> Self { Self...
use crate::enums::{TypeHolder, Types}; use crate::types_structs::{Enum, ItemInfo, Struct, Trait, TYPE_CASE}; use crate::{Language, TypeCases}; use derive_new::new; use std::collections::{HashMap, VecDeque}; use std::fs::{DirEntry, File}; use std::io::Write; use std::path::PathBuf; use std::rc::Rc; use syn::__private::T...
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
use std::cmp; use std::error::Error as StdError; use std::hash::Hasher; use std::io; use std::io::prelude::*; use std::mem; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use lz4_compress; use twox_hash::XxHash32; use errors::{ErrorKind, Result}; pub fn compress(src: &[u8]) -> Result<Vec<u8>> { Ok(l...
//! //! Worktile接口封装 //! https://open.worktile.com //! #![allow(dead_code)] use super::AnyError; use serde::{de::DeserializeOwned, Deserialize}; use serde_json as json; use std::{ collections::HashMap, sync::{Arc, RwLock} }; const DEFAULT_API_URL: &'static str = "https://open.worktile.com"; pub struct ClientBuil...
use std::sync::Arc; use crate::inst; use crate::conf::ClusterInfo; use crate::qpaxos::*; use crate::replica::*; use crate::testutil; use crate::StorageAPI; use storage::DBColumnFamily; use storage::ObjectKV; use storage::{MemEngine, RawKV}; use pretty_assertions::assert_eq; /// Create an instance with command "set ...
//! Definitions for registers, operands, etc. Provides a thin //! interface over the register allocator so that we can more easily //! swap it out or shim it when necessary. use crate::machinst::MachInst; use alloc::{string::String, vec::Vec}; use core::{fmt::Debug, hash::Hash}; use regalloc2::{Allocation, Operand, PR...
use crate::currency::{BalanceOf, GovernanceCurrency}; use parity_codec_derive::{Decode, Encode}; use rstd::prelude::*; use runtime_io::print; use runtime_primitives::traits::{As, Bounded, MaybeDebug, Zero}; use support::traits::{ Currency, LockIdentifier, LockableCurrency, WithdrawReason, WithdrawReasons, }; use su...
// Copyright 2018-2020 <NAME> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://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 except according to those t...
pub struct BoxAndWhiskerPlot { pub parent_id: String, pub width: f64, pub data: Vec<Vec<f64>>, pub series_labels: Vec<String>, pub x_axis_label: String, pub draw_gridlines: bool, pub draw_legend: bool, pub draw_grey_background: bool, pub bar_width: f64, pub bar_gap: f64, pub ...
use crate::error::TapsError; use crate::endpoint::LocalEndpoint; use crate::endpoint::RemoteEndpoint; use crate::transport_properties::TransportProperties; use crate::connection::Connection; use crate::listener::Listener; use crate::selection_properties; use crate::selection_properties::ServiceLevel; use crate::selecti...
use crate::address_transform::AddressTransform; pub use crate::read_debuginfo::DebugInfoData; use cranelift_codegen::isa::TargetFrontendConfig; use cranelift_entity::EntityRef; use failure::Error; use std::collections::{BTreeMap, HashMap}; use std::ops::Bound::{Included, Unbounded}; use gimli; use gimli::{ Attrib...
use crate::common::{self, *}; lazy_static! { pub static ref WINDOW_CLASS: Vec<u16> = unsafe { register_window_class() }; //pub static ref INSTANCE: winuser::HINSTANCE = unsafe { kernel32::GetModuleHandleW(ptr::null()) }; } pub type LinearLayout = AMember<AControl<AContainer<AMultiContainer<ALinearLayout<Windo...
// https://github.com/rust-lang/cargo/issues/5034 #![warn(clippy::pedantic)] #![allow( clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::cast_sign_loss, clippy::map_err_ignore, clippy::missing_errors_doc, clippy::non_ascii_literal, clippy::option_if_let_else, clippy::...
#![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, Encode, HasCompact}; use frame_support::traits::Currency; use frame_system::{self as system}; use scale_info::TypeInfo; use sp_runtime::{ traits::{AtLeast32BitUnsigned, Zero}, RuntimeDebug, }; use sp_std::{ops::Add, prelude::*}; pub mod pallet; pub mod ...
use crate::mesh_list::{MeshCommand, MeshDescription, MeshList}; use engine::math::Quaternion; use engine::mesh::Mesh; use engine::mesh_gen::commands::{EditorCommandPropertyType, COMMAND_TYPES}; use imgui_sys::{ igBegin, igBeginChild, igBeginCombo, igBeginPopupContextItem, igButton, igColorEdit3, igColorEdit4, i...
/// This library contans the Kubelet shell. Use this to create a new Kubelet /// with a specific handler. (The handler included here is the WASM handler.) use crate::{ node::{create_node, update_node}, pod::KubePod, server::start_webserver, }; use k8s_openapi::api::core::v1::Container; use kube::{ api::...
//! # Ruby Exception Hierarchy //! //! The built-in subclasses of //! [`Exception`](https://ruby-doc.org/core-2.6.3/Exception.html) are: //! //! - `NoMemoryError` //! - `ScriptError` //! - `LoadError` //! - `NotImplementedError` //! - `SyntaxError` //! - `SecurityError` //! - `SignalException` //! - `Interrupt`...
// Copyright (c) 2019 Ant Financial // // SPDX-License-Identifier: Apache-2.0 // //use crate::container::Container; use crate::linux_abi::*; use crate::mount::{get_mount_fs_type, remove_mounts, TYPEROOTFS}; use crate::namespace::Namespace; use crate::namespace::NSTYPEPID; use crate::network::Network; use anyhow::{anyh...