text
stringlengths
7.05k
33.9k
#![cfg(test)] //! Module for support code for writing tests. use crate::prelude::*; use crate::executor::test_utils::TestWithLocalPoolExecutor; use crate::model::suggestion_database; use crate::model::undo_redo; use double_representation::module; use double_representation::project; use engine_protocol::binary; use e...
use super::super::blockchain::{Blockchain, BlockchainName}; use super::super::wallet::{ self, state::lookup, utils::create_wallet_state_from_logs, Wallet, WalletName, Wallets, }; use super::core::{self, StagingId, StagingTransaction}; use super::error::Error; use cardano::{ address::ExtendedAddr, coin::{sum...
//! Run Zircon user program (userboot) and manage trap/interrupt/syscall. //! //! Reference: <https://fuchsia.googlesource.com/fuchsia/+/3c234f79f71/zircon/kernel/lib/userabi/userboot.cc> use alloc::{boxed::Box, sync::Arc, vec::Vec}; use core::{future::Future, pin::Pin}; use xmas_elf::ElfFile; use kernel_hal::contex...
use crate::error::Error; use crate::error::ErrorKind; // 16 Bits /// two octets containing one of the RR TYPE codes. #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)] pub struct Kind(pub u16); impl Kind { // Note // 0 0x0000 RRTYPE zero is used as a special indicator for the SIG RR RFC2931, ...
//! Process-related functionality #[cfg(unix)] use nix::{ errno::Errno, fcntl, libc, sys::{signal, wait}, unistd::{self, Pid}, Error }; use std::process::Command; #[cfg(unix)] use std::{ os::unix::net::UnixDatagram, sync::atomic::{AtomicU8, Ordering} }; #[cfg(unix)] use crate::{file, Fd}; #[doc(inline)] #[cfg(unix...
use std::mem; use std::collections::HashMap; use prime::PrimeIterator; use fnv::FnvHashMap; /// Compute ceil(sqrt(n)). Note that this cannot be used in a simple range for things such /// as prime number sieves because it will fail if ceil(sqrt(n)) == sqrt(n). You need an upper /// bound which is one more than this. Tr...
#[cfg(test)] mod tests; use robmikh_common::universal::null_return::NullReturn; use std::{collections::VecDeque, rc::Rc}; use windows::core::{Interface, Result}; use windows::Win32::Graphics::Direct2D::D2D1_SVG_ATTRIBUTE_POD_TYPE_MATRIX; use windows::{ Foundation::Numerics::{Matrix3x2, Vector2}, Graphics::IGe...
// Copyright 2020 The BitcoinMW 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 ...
//! Module dealing with compiling the test code. use anyhow::Context; use glob::glob; use pubgrub_dependency_provider_elm::project_config::ProjectConfig; use std::collections::HashSet; use std::ffi::OsStr; use std::fs; use std::io::Write; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use walkdir:...
use crate::{ buffer::Buffer, components::{ animation_controller::AnimationController, AnimationTarget, Info, Joint, Mesh, Parent, Root, Skin, Transform, TransformMatrix, Visible, }, resources::{render_context::DescriptorSetLayouts, VulkanContext}, }; use anyhow::Result; use ash::vk; use ...
//! hil driver for Bmp280 Temperature and Pressure Sensor //! //! Written by Dorota <<EMAIL>> //! //! Based off the SHT3x code. //! //! Not implemented: pressure use core::cell::Cell; use kernel::debug; use kernel::hil; use kernel::hil::i2c; use kernel::hil::time::{Alarm, ConvertTicks}; use kernel::utilities::cells::{...
use std::collections::HashMap; use std::env; use std::fs::{self, File}; use std::io::{self, BufWriter, Write}; use std::path::{Path, PathBuf}; fn main() -> io::Result<()> { println!("cargo:rerun-if-changed=build.rs"); let mut languages = [ ("Afrikaans", "af", "Latn", "hyph-af.tex", 1, 2), ("Be...
use crate::mir::Mutability; use crate::ty::subst::GenericArgKind; use crate::ty::{self, Ty, TyCtxt, TypeFoldable}; use rustc_hir::def_id::DefId; use std::fmt::Debug; use std::hash::Hash; use std::iter; use self::SimplifiedTypeGen::*; pub type SimplifiedType = SimplifiedTypeGen<DefId>; /// See `simplify_type` /// ///...
//! # Geometry builder //! //! Tools to help with generating geometry to send to the GPU. //! //! ## Overview //! //! While it would be possible for the tessellation algorithms to manually generate vertex //! and index buffers with a certain layout, it would mean that most code using the tessellators //! would need to ...
use crate::encoding::{BooleanDecoder, Decodable, Decoder, DeltaDecoder, RLEDecoder}; use crate::encoding::{BooleanEncoder, ColData, DeltaEncoder, Encodable, RLEEncoder}; use automerge_protocol as amp; use core::fmt::Debug; use std::collections::HashMap; use std::io; use std::io::{Read, Write}; use std::ops::Range; use ...
#[cfg(all(test, feature = "vector-unit-test-tests"))] mod tests; mod unit_test_components; use std::{ collections::{HashMap, HashSet}, sync::Arc, }; use futures_util::{stream::FuturesUnordered, StreamExt}; use indexmap::IndexMap; use ordered_float::NotNan; use tokio::sync::{ oneshot::{self, Receiver}, ...
use std::{ collections::HashMap, future::Future, net::{Ipv4Addr, SocketAddr, TcpStream}, thread, time::Duration, }; use crossbeam::crossbeam_channel::bounded; use bollard::{ container::{ Config, CreateContainerOptions, ListContainersOptions, LogsOptions, ...
use alloc::{Allocator, SliceWrapper, SliceWrapperMut}; use core::marker::PhantomData; use core::mem; use core::any; #[cfg(feature="std")] use std; use super::BrotliAlloc; use super::encode::{ BrotliEncoderOperation, BrotliEncoderCreateInstance, BrotliEncoderSetCustomDictionaryWithOptionalPrecomputedHasher, Brot...
/*! Contains `DynTrait<_>`'s vtable,and related types/traits. */ use std::{ fmt::{self, Debug,Write as FmtWrite}, io, marker::PhantomData, }; use super::{ *, c_functions::*, iterator::{ IteratorFns,MakeIteratorFns, DoubleEndedIteratorFns,MakeDoubleEndedIteratorFns, }, ...
//! (TODO) Serial Communication (USART) #![macro_use] use crate::pac; use core::fmt::Write; use pac::{GPIOA, RCU, USART0}; //TODO - use the APB/RCU/GPIO primitives in this crate, rather than unsafe memory poking! // yay, math functions arn't implemented in core! fn round(n: f32) -> f32 { let int_part: i32 = n a...
//! Implements aggregation operations using [Range Minimum Query] //! (https://en.wikipedia.org/wiki/Range_minimum_query) (RMQ) pub mod lca; pub mod mix; pub mod rtl; use std::fmt::Display; use std::mem::size_of; /// Represents a Range Minimum Query (RMQ), which can efficiently return the minimal value in a /// give...
// Copyright Materialize, Inc. All rights reserved. // // 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 in the LICENSE file at the // root of this repository, or online at // // http://www.a...
use std::cmp::Ordering; use cgmath::prelude::*; use ggez::graphics::Rect; use crate::types::{Point2, Vector2}; pub struct Circle { pub center: Point2, radius: f32, } impl Circle { pub fn new<P>(center: P, radius: f32) -> Self where P: Into<Point2>, { assert!(radius >= 0.0, "Radiu...
// Copyright 2020 The xi-editor 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 ag...
use crate::dwarf::{ collect_dwarf_address_debug_data, make_address_pairs_for_root_object, AddressPair, }; use crate::error::{GetSymbolsError, Result}; use crate::path_mapper::PathMapper; use crate::shared::{ get_symbolication_result_for_addresses_from_object, object_to_map, FileAndPathHelper, FileContents, ...
//! Syz-executor driver. #![allow(clippy::or_fun_call, clippy::redundant_slicing)] pub mod features; pub mod message; pub mod serialization; mod util; use crate::{ exec::{message::*, serialization::*, util::*}, HashMap, HashSet, }; use healer_core::{prog::Prog, target::Target}; use healer_io::{thread::read_ba...
use std::process::exit; use std::str::FromStr; use log::{error, info}; use sqlite::{Connection, State}; use uuid::Uuid; use crate::item::{Item, ItemRarity, ItemType}; use crate::player::Player; #[derive(Eq, PartialEq, Copy, Clone, Debug)] pub enum LoginFailReason { Unauthorized, Unrecognized, AlreadyOnline, } #[d...
// Copyright (c) 2021 ESRLabs // // 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 agre...
mod context; mod devmgr; mod port; mod registers; mod ring; mod speed; mod trb; use core::{ mem::{ MaybeUninit, transmute }, ptr::{ null_mut, null, addr_of_mut } }; use devmgr::DeviceManager; use ring::*; use registers::*; use port::*; use trb::{ EvaluateCont...
#![allow(non_camel_case_types)] mod consts; mod mxf; use chrono::NaiveDateTime; use ffi::consts::*; use ffi::mxf::*; pub use ffi::mxf::{MXFKey, MXFUmid}; use num_rational::Rational32; use std::path::Path; fn convert_length(target_edit_rate: &Rational32, edit_rate: &Rational32, length: int64) -> int64 { ((length *...
rltk::add_wasm_support!(); use rltk::{GameState, Point, RandomNumberGenerator, Rltk, RltkBuilder}; use specs::prelude::*; use specs::saveload::{SimpleMarker, SimpleMarkerAllocator}; #[macro_use] extern crate specs_derive; extern crate serde; mod map; pub use map::*; mod color; mod components; mod gamelog; mod gui; mod ...
extern crate rayon; extern crate rand; extern crate statrs; extern crate petgraph; extern crate vec_graph; #[cfg(not(feature = "grb"))] #[macro_use] extern crate rplex; extern crate capngraph; extern crate ris; extern crate bit_set; extern crate docopt; #[macro_use] extern crate slog; extern crate slog_stream; extern c...
use crate::atomic_serial_waker::*; use crate::error::*; use crate::Shutdown; use crossbeam::atomic::AtomicConsume; use crossbeam::utils::CachePadded; use std::cell::UnsafeCell; use std::marker::PhantomData; use std::mem; use std::ptr; use std::sync::atomic::{self, AtomicUsize, Ordering::*}; use std::sync::mpsc::TryRecv...
use image::{ImageBuffer, Luma}; use std::collections::VecDeque; use std::mem; #[cfg(test)] use imageproc::gray_image; type Label = u32; #[derive(Debug, Clone, PartialEq)] pub struct FeatureVector { pub area: u32, pub bounding_box: [(u32, u32); 2], pub max_x: u32, pub valid: bool, pub merge: Augme...
// Copyright 2018 <NAME> // // 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 // except according to those...
//! Constraint that a message lies within the range `[0, 2^63)`. use crate::{ common::*, pointcheval_sanders::{KeyPair, PublicKey, Signature}, proofs::{Challenge, ChallengeBuilder, ChallengeInput, SignatureProof, SignatureProofBuilder}, }; use arrayvec::ArrayVec; use serde::*; use thiserror::Error; /// Th...
use hmac::{Hmac, Mac, NewMac}; use serde_json::Value; use sha2::Sha256; use std::{ env, fs, io::{Error, ErrorKind}, path::PathBuf, time::SystemTime, }; mod msg; use msg::*; pub use msg::{ DingTalkMessage, DingTalkMessageActionCardBtn, DingTalkMessageActionCardBtnOrientation, DingTalkMessageAct...
use rand_chacha::{ rand_core::{RngCore, SeedableRng}, ChaChaRng, }; use serde::de::DeserializeOwned as SeDeserializeOwned; use serde::ser::Serialize as SeSerialize; use serde::{Deserialize, Serialize}; use std::net::{IpAddr, SocketAddr}; use std::path::PathBuf; use tokio::{ fs::{self, OpenOptions}, io::...
use serde::de::{Deserializer, MapAccess, Visitor}; use std::collections::{HashMap, HashSet}; use std::error::Error; use std::fs::{read_to_string, File}; use std::io::{BufRead, BufReader}; use std::sync::Arc; // DAWG based on https://jbp.dev/blog/dawg-basics.html // and https://github.com/sile/rust-dawg const JSON_DIC...
use std::collections::BTreeMap; use std::rc::Rc; use std::time::Instant; use std::usize; use glommio::Local; use tracing::trace; use crate::error::Result; use crate::index::MemIndex; use crate::io::File; use crate::types::{ Bytes, Entry, EntryMeta, Offset, RickSuperBlock, TimeRange, Timest...
use crate::interface::{pcapng_build_interface, InterfaceInfo}; use chrono::{TimeZone, Utc}; use std::cmp::min; use std::convert::TryInto; use std::fs::{self, File}; use std::io::{self, Error, ErrorKind}; use std::net::{Ipv4Addr, Ipv6Addr}; use std::path::Path; use std::str; use std::time::Duration; use flate2::read::G...
extern crate libc; use std::cell::RefCell; use std::collections::HashMap; use std::sync::Arc; use std::time::Instant; use crate::file_info_mgr::FileInfoMgr; use crate::leader::Leader; use crate::message::{FsReqRead, FsReqWrite}; use common::error::Errno; use log::{error, info}; use message::file_system_op::FileInfoAd...
use std::collections::HashMap; use std::fs; use std::iter; use std::path::PathBuf; use std::str::FromStr; use std::time::SystemTime; use minidom::Element; use minidom::NSChoice::Any as AnyNS; use lazy_static::lazy_static; use regex::Regex; use crate::d2m::doxygen::CompoundKind::*; use crate::d2m::doxygen::*; fn pars...
use bot::Bot; use discord::model::Message; use hyper::{self, header::UserAgent, Client}; use module; use regex::Regex; use serde_json; use std::{ collections::{hash_map::HashMap, BTreeMap}, error, fmt, time::Duration, }; use url::Url; include!("speedruncom_types.rs"); pub struct Module<'a> { commands:...
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // // Portions 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 THIRD-PARTY file. pub mod backend; pub ...
use crate::{ annis::util::quicksort, errors::GraphAnnisError, graph::{Edge, EdgeContainer, GraphStorage, NodeID}, }; use graphannis_core::{ annostorage::ValueSearch, dfs::CycleSafeDFS, errors::ComponentTypeError, graph::{storage::union::UnionEdgeContainer, ANNIS_NS, NODE_TYPE_KEY}, types...
use crate::*; use std::borrow::Cow; use std::convert::TryFrom; use std::convert::TryInto; use std::net::Ipv6Addr; #[derive(Clone, Debug)] pub struct Ipv6Packet { pub data: PacketData, pub layer2_offset: Option<usize>, pub layer3_offset: usize, pub payload_offset: usize, } impl Ipv6Packet { pub fn ...
#![cfg_attr(not(feature = "std"), no_std)] /// Edit this file to define custom logic or remove it if it is not needed. /// Learn more about FRAME and the core library of Substrate FRAME pallets: /// https://substrate.dev/docs/en/knowledgebase/runtime/frame use frame_support::{decl_module, decl_storage, decl_event, de...
use std::fmt; use std::fs; use std::io::{self, Read, Write}; use std::path::{Path, PathBuf}; use std::process::{self, Command, Stdio}; use chrono::{Date, NaiveDate, Utc}; use colored::Colorize; use dialoguer::Select; use flate2::read::GzDecoder; use log::debug; use pbr::{ProgressBar, Units}; use reqwest::blocking::{Cl...
/* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use thi...
use crate::common::*; use crate::context::TypeLowering; use crate::llvm_util::get_version; use crate::type_::Type; use rustc_codegen_ssa::traits::*; use rustc_middle::bug; use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout}; use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths}; use rus...
// Copyright 2013 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 ...
// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0. use crate::{ compat::stream_fn, kv::codec, pd::RetryClient, store::Store, BoundRange, Config, Key, Region, RegionId, Result, SecurityManager, Timestamp, }; use async_trait::async_trait; use futures::{prelude::*, stream::BoxStream}; use grpcio::...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use super::*; #[allow(unused_imports)] use crate::{ schema::jellyfish_merkle_node::JellyfishMerkleNodeSchema, test_helper::{arb_blocks_to_commit, arb_mock_genesis}, }; use diem_crypto::hash::CryptoHash; #[allow(unused_imports)] ...
//! A number of passes which remove various redundancies in the CFG. //! //! The `SimplifyCfg` pass gets rid of unnecessary blocks in the CFG, whereas the `SimplifyLocals` //! gets rid of all the unnecessary local variable declarations. //! //! The `SimplifyLocals` pass is kinda expensive and therefore not very suitabl...
//! The optimised bitwise LMD-GHOST fork choice rule. extern crate bit_vec; use crate::{ForkChoice, ForkChoiceError}; use bit_vec::BitVec; use db::{ stores::{BeaconBlockStore, BeaconStateStore}, ClientDB, }; use log::{debug, trace}; use std::collections::HashMap; use std::sync::Arc; use types::{BeaconBlock, Ch...
use std::cmp::Ordering; /// vcf-cluster -- Cluster VCF files with structural variants. use std::collections::{BTreeMap, HashMap, HashSet}; use std::fs; use std::iter::FromIterator; use std::path::Path; use bio::data_structures::interval_tree::IntervalTree; use bio_types::genome::{AbstractInterval, Interval}; use clap:...
extern crate user32; extern crate winapi; extern crate kernel32; extern crate libc; extern crate gdi32; extern crate libloading; extern crate handmade; use std::ffi::OsStr; use std::iter::once; use std::os::windows::ffi::OsStrExt; use std::mem; use std::ptr::null_mut; use std::u32; // use std::fs::metada...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use anyhow::{self, ensure, Context, Error}; use command_line::{CommandLine, Hidden, Opt, OptDesc}; use juno::ast::{self, node_cas...
use crate::{command::studio::enter::{ARTIFACT_PATH_ENVVAR, CERT_PATH_ENVVAR, SSL_CERT_FILE_ENVVAR}, common::ui::UI, error::{Error, Result}, hcore::{crypto::CACHE_KEY_PATH_ENV_VAR, ...
//! # ft_linear_regression training module //! //! As per [subject](../../../../resources/ft_linear_regression.en.pdf) the followig formulas are used: //! - price estimation `estimatePrice(mileage) = theta0 + (theta1 * mileage)` //! - training formulas //! - `tmp_theta0 = learningRate * (1 / m) * Sum(i=0; m-1)(esti...
//! Fuzzing engine. Connects the CodeCoverageSensor //!to the [Pool] and uses an evolutionary algorithm using [Mutator] to find new interesting //! test inputs. use crate::code_coverage_sensor::CodeCoverageSensor; use crate::mutators::either::Either; use crate::sensors_and_pools::and_sensor_and_pool::{AndPool, AndSens...
use std::path::PathBuf; use std::rc::Rc; use cgmath::conv::{array3x3, array4x4}; use cgmath::{vec3, vec4, Matrix3, Matrix4}; use font_kit::font::Font; use glium::backend::Facade; use glium::index::PrimitiveType; use glium::uniforms::{MagnifySamplerFilter, MinifySamplerFilter}; use glium::{implement_vertex, uniform, In...
//! Disk header parsing. //! //! The disk header provides information on how to read a TFS disk. This module parses and //! interprets the disk header so it is meaningful to the programmer. use std::convert::TryFrom; use {little_endian, seahash, rand, disk, Error}; /// The size of the disk header. /// /// This should...
// This module contains strategies and shrinkers for: // * points // * polygons // A Strategy is a way to generate a shrinkable value. use crate::data::{ Direction, Direction_, Line, LineSoS, LineSoS_, Line_, Point, PointId, Polygon, PolygonConvex, Triangle, Vector, }; use crate::PolygonScalar; use array_init::{...
#[cfg(any(feature = "postgres", feature = "mysql"))] extern crate bigdecimal; extern crate chrono; use self::chrono::*; pub use quickcheck::quickcheck; pub use crate::schema::{connection_without_transaction, TestConnection}; pub use diesel::data_types::*; pub use diesel::result::Error; pub use diesel::serialize::ToSq...
use std::io::BufRead; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::{fs, io}; use anyhow::anyhow; use bstr::BString; use clap::Parser; use tako::common::resources::{CpuRequest, GenericResourceAmount}; use tako::messages::common::{ProgramDefinition, StdioDef}; use tako::messages::gateway::{GenericReso...
use bzip2::bufread::BzDecoder; use clap::{crate_description, crate_name, crate_version, value_t, value_t_or_exit, App, Arg}; use console::{style, Emoji}; use indicatif::{ProgressBar, ProgressStyle}; use log::*; use solana_client::rpc_client::RpcClient; use solana_core::cluster_info::{Node, VALIDATOR_PORT_RANGE}; use so...
use crate::asm_generation::{ register_sequencer::RegisterSequencer, RegisterAllocationStatus, RegisterPool, }; use crate::asm_lang::{virtual_register::*, RealizedOp, VirtualOp}; use petgraph::graph::NodeIndex; use std::collections::{BTreeSet, HashMap}; pub type InterferenceGraph = petgraph::stable_graph::Stabl...
use crate::error::{Error, Result}; use std::convert::TryInto; use std::slice::Iter; const NOTE_OFF: u8 = 0x80; const NOTE_ON: u8 = 0x90; const POLY_AFTERTOUCH: u8 = 0xa0; const CONTROL_CHANGE: u8 = 0xb0; const PROGRAM_CHANGE: u8 = 0xc0; const CHANNEL_AFTERTOUCH: u8 = 0xd0; const PITCH_BEND: u8 = 0xe0; const SYSEX: u8 ...
//! Vendored and stripped down version of triomphe use std::{ alloc::{self, Layout}, cmp::Ordering, hash::{Hash, Hasher}, marker::PhantomData, mem::{self, ManuallyDrop}, ops::Deref, ptr, sync::atomic::{ self, Ordering::{Acquire, Relaxed, Release}, }, }; use memoffset...
//! Abstractions for asynchronous programming. //! //! This crate provides a number of core abstractions for writing asynchronous code: //! //! - [Futures](::Future) (sometimes called promises), which represent a single //! asychronous computation that may result in a final value or an error. //! //! - [Streams](::Stre...
use obj::raw::{parse_obj, RawObj}; use obj::ObjResult; use std::error::Error; type TestResult = Result<(), Box<dyn Error>>; fn fixture(name: &str) -> ObjResult<RawObj> { use std::fs::File; use std::io::BufReader; let file = File::open(format!("tests/fixtures/{}", name))?; let input = BufReader::new(f...
use docopt::Docopt; use lazy_static::lazy_static; use libremarkable::appctx::ApplicationContext; use libremarkable::framebuffer::cgmath; use libremarkable::framebuffer::cgmath::EuclideanSpace; use libremarkable::framebuffer::common::*; use libremarkable::framebuffer::refresh::PartialRefreshMode; use libremarkable::fram...
//! A library for running a USB/IP server use log::*; use num_derive::FromPrimitive; use num_traits::FromPrimitive; use rusb::*; use std::any::Any; use std::collections::{HashMap, VecDeque}; use std::io::Result; use std::net::SocketAddr; use std::sync::{Arc, Mutex}; use tokio::io::AsyncReadExt; use tokio::io::AsyncWri...
//! # `VMExternRef` //! //! `VMExternRef` is a reference-counted box for any kind of data that is //! external and opaque to running Wasm. Sometimes it might hold a Wasmtime //! thing, other times it might hold something from a Wasmtime embedder and is //! opaque even to us. It is morally equivalent to `Rc<dyn Any>` in...
// Copyright 2020 Google LLC // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
//! A tool for use with the `hdrhistogram` crate, a rust port of HdrHistogram, that provides //! a clean interface with sane defaults for off-thread serialization of HdrHistogram interval //! logs to file. //! use std::sync::Arc; use std::time::{Instant, Duration, SystemTime, UNIX_EPOCH}; use std::path::{Path, PathBuf...
use adc::AdcDecoder; use bincode::Options; use bzip2::read::BzDecoder; use flate2::read::ZlibDecoder; use itertools::Itertools; use num_derive::FromPrimitive; use num_traits::FromPrimitive; use serde::{Deserialize, Serialize}; use std::cmp; use std::cmp::Ordering; use std::fmt; use std::io; use std::io::prelude::*; use...
// Copyright 2021 The piet-gpu 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
#![feature(assoc_char_funcs)] #![feature(type_alias_impl_trait)] use std::{ borrow::Cow, ffi::{ CStr, NulError, }, fmt::{ self, Write as FmtWrite, }, fs::{ rename, File, }, io::{ self, BufRead, BufReader, Wr...
use crate::prelude::*; use crate::AsFormat; use rome_formatter::{format_args, write, Argument, Arguments, GroupId, PreambleBuffer, VecBuffer}; use rome_js_syntax::{JsLanguage, JsSyntaxNode, JsSyntaxToken}; use rome_rowan::{AstNode, Direction, Language, SyntaxTriviaPiece, SyntaxTriviaPieceComments}; /// Formats a token...
use super::symbol_bindings::*; use super::bind_error::*; use super::binding_monad::*; use super::binding_monad_sugar::*; use super::compile_statement::*; use crate::meta::*; use crate::exec::*; use crate::syntax::*; use std::sync::*; use std::result::{Result}; /// /// Binds a statement to the value used for compilin...
pub mod event; pub mod generic_proto; pub mod message; use crate::config::ProtocolId; use crate::protocol::generic_proto::{GenericProto, GenericProtoOut, NotificationsSink}; use crate::protocol::message::generic::{FallbackMessage, Status}; use crate::utils::interval; use crate::{errors, DiscoveryNetBehaviour, Multiadd...
use nom::branch::alt; use nom::bytes::streaming::take_while_m_n; use nom::character::complete::{i32, u16}; use nom::combinator::{consumed, map, map_parser, map_res, opt, value, verify}; use nom::number::streaming::u8; use nom::sequence::{preceded, terminated, tuple}; use nom::Err::Incomplete; use nom::IResult; use cra...
// Copyright 2016 constrained Developers // // 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 accordin...
// 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...
#![cfg_attr(not(feature = "std"), no_std)] use sp_std::prelude::*; use sp_core::H256; use frame_support::{ codec::{Decode, Encode}, traits::{Currency, ReservableCurrency, WithdrawReasons, ExistenceRequirement}, dispatch::{DispatchResult, DispatchResultWithPostInfo}, decl_error, decl_event, decl_module, decl_storag...
#![feature(or_patterns, never_type, extend_one)] use lalrpop_util::ParseError; use codespan_reporting::diagnostic::{Diagnostic, Label}; use codespan_reporting::term; use codespan_reporting::term::termcolor::{ColorChoice, StandardStream}; use codespan_reporting::files::SimpleFile; use proc_macro2::{TokenStream, TokenTr...
//! Library for manipulating Pokémon Gen3 (Fire Red/Leaf Green, Ruby/Emerald/Sapphire) save data. #[macro_use] extern crate log; extern crate byteorder; extern crate rgen3_string; mod util { mod lower_upper; pub use self::lower_upper::LowerUpper; } mod rw; use crate::util::LowerUpper; use std::error::Error; ...
//! Rewrites https://github.com/suyash/ulid from C++ to Rust //! //! This exposes a single interface for Ulid creation //! //! ```ignore //! Ulid::new(u64, Fn() -> u8) //! ``` //! //! Takes the last 48 bits of the passed timestamp and calls the passed closure //! 10 times for a random value. //! //! In place of explici...
/* * Copyright (c) Facebook, Inc. and its affiliates. * * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ use super::util; use core::pin::Pin; use core::task::{Context, Poll}; use std::ffi::{CStr, CStri...
#![recursion_limit = "128"] extern crate colored; extern crate libc; extern crate libloading; extern crate portus; extern crate proc_macro2; extern crate quote; extern crate regex; extern crate structopt; extern crate syn; extern crate toml; extern crate walkdir; use colored::Colorize; use walkdir::WalkDir; //use cla...
use num_derive::FromPrimitive; use crate::attribute::Attribute; use crate::character::character_common_data::CharacterCommonData; use crate::character::character_sub_stat::CharacterSubStatFamily; use crate::character::{CharacterConfig, CharacterName, CharacterStaticData}; use crate::character::skill_config::CharacterSk...
//! A single assign stack managing values and enforcing linearity and borrow constraints //! //! The stacks is responsible for tracking the types of the elements as well as ensure that every element is used exactly once. //! Exception to the used exactly once rule (for example for values with the Copy or Drop capab...
mod backwards_iter { // HACK(eddyb) like `DoubleEndedIterator`, but without a (forwards) `Iterator`. // This is needed because of how events are stored in "postorder", // i.e. an interval event follows all events nested in it, meaning // that most analyses we want to do can only be done in reverse. ...
use super::{Parameter, ParameterIO, ParameterList, ParameterObject}; use binwrite::BinWrite; use indexmap::IndexMap; use std::io::{Cursor, Read, Result, Seek, SeekFrom, Write}; #[derive(Debug, Copy, Clone)] enum ParameterType { Bool = 0, F32, Int, Vec2, Vec3, Vec4, Color, String32, ...
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate 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) a...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct News { /// MsgType = B #[serde(flatten)] pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'B'>, /// OrigTime #[serde(skip_serializing_if = "Option::is_none"...
/** * Copyright 2021 Google LLC * * 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 ...