text
stringlengths
3.09k
13.9k
//! The `tpu` module implements the Transaction Processing Unit, a //! multi-stage transaction processing pipeline in software. use crate::bank::Bank; use crate::banking_stage::{BankingStage, BankingStageReturnType}; use crate::broadcast_service::BroadcastService; use crate::cluster_info::ClusterInfo; use crate::fetch...
pub const PRIDE_PREJUDICE_CH2: &'static str = r#" Mr. Bennet was among the earliest of those who waited on Mr. Bingley. He had always intended to visit him, though to the last always assuring his wife that he should not go; and till the evening after the visit was paid she had no knowledge of it. It was then disclosed ...
// EdEditor program entry point + main loop extern crate sdl2; extern crate gl; use anyhow::Result; use sdl2::{ event::Event, keyboard::Keycode, mouse::MouseButton, }; use std::{ time::Duration, }; use wasmtime::*; mod component; mod renderer; use component::{Component, Imports, WrappedComponent}; u...
//! Quantel Connect //! //! A simple command line utility to headlessly connect to the captive portal of Quantic Telecom // Make clippy quite nasty #![deny(clippy::cargo)] // Checks for garbage in the Cargo TOML files #![deny(clippy::complexity)] // Checks for needlessly complex structures #![deny(clippy::c...
#![warn(missing_docs)] #![doc = include_str!("../README.md")] use anyhow::anyhow; use mdbook::{ book::{Book, Chapter}, errors::Result, preprocess::{Preprocessor, PreprocessorContext}, BookItem, }; use pulldown_cmark::{Alignment, Event, Options, Parser, Tag}; use pulldown_cmark_to_cmark::cmark; use std:...
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { fidl_fuchsia_io::{DirectoryProxy, CLONE_FLAG_SAME_RIGHTS}, fuchsia_async as fasync, fuchsia_zircon::{self as zx, HandleBased}, io_uti...
use std::ffi::CStr; use log::info; use gl33::global_loader::*; use gl33::*; use nalgebra::Matrix4; use crate::Result; use crate::errors::NightmareError; // ----------------------------------------------------------------------------- // - Default shaders - // -----------------------------------------------------...
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. //! There are many types of errors in Deno: //! - AnyError: a generic wrapper that can encapsulate any type of error. //! - JsError: a container for the error message and stack trace for exceptions //! thrown in JavaScript code. We use this t...
use {raw, panic, Oid, StashApplyProgress}; use std::ffi::{CStr}; use util::{Binding}; use libc::{c_int, c_char, size_t, c_void}; use build::{CheckoutBuilder}; use std::mem; /// Stash application progress notification function. /// /// Return `true` to continue processing, or `false` to /// abort the stash application....
use classfile_parser::field_info::FieldAccessFlags; use either::Either; use rhojvm_base::{ code::method::{DescriptorType, DescriptorTypeBasic, MethodDescriptor}, data::class_file_loader::Resource::Buffer, }; use crate::{ class_instance::{ClassInstance, Fields}, eval::{eval_method, instances::make_field...
use std::convert::TryInto; use nom::bytes::complete::take_until; use nom::character::complete::{crlf, one_of}; use nom::combinator::all_consuming; use nom::sequence::{terminated, tuple}; use nom::IResult; /// The first line of an NNTP response /// /// This struct contains data borrowed from a read buffer #[derive(Clo...
//! Utilities for the formatters themselves. use crate::config::FmtConfig; use crate::{expand_exe, expand_if_path, expand_path}; use anyhow::{anyhow, Result}; use console::style; use globset::{GlobBuilder, GlobSet, GlobSetBuilder}; use log::debug; use serde::de::{self, Visitor}; use serde::{Deserialize, Deserializer, S...
//! The general point of the optimizations provided here is to simplify something like: //! //! ```rust //! match x { //! Ok(x) => Ok(x), //! Err(x) => Err(x) //! } //! ``` //! //! into just `x`. use crate::transform::{MirPass, MirSource, simplify}; use rustc::ty::{TyCtxt, Ty}; use rustc::mir::*; use rustc_tar...
use std::time::Duration; use chrome_devtools as protocol; use futures_util::future::TryFutureExt; use futures_util::sink::SinkExt; use futures_util::stream::{SplitStream, StreamExt}; use tokio_stream::wrappers::UnboundedReceiverStream; use crate::terminal::colored_json_string; use crate::terminal::message::{Message,...
// // dc4 :: A Unix dc(1) implementation in Rust // // Copyright (c) 2015-2021 by <NAME> // #![deny(rust_2018_idioms)] mod big_real; mod dcregisters; pub mod parser; mod reader_parser; mod state; use parser::Action; use state::Dc4State; use std::io::{BufRead, Write}; /// Desk Calculator 4 pub struct Dc4 { state...
// Copyright 2019 Parity Technologies (UK) Ltd. // Copyright 2020 Netwarps Ltd. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the ...
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor 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 ...
//! Driver for rust-analyzer. //! //! Based on cli flags, either spawns an LSP server, or runs a batch analysis mod flags; mod logger; use std::{convert::TryFrom, env, fs, path::Path, process}; use lsp_server::Connection; use project_model::ProjectManifest; use rust_analyzer::{ cli::{self, AnalysisStatsCmd, Bench...
//! Top-level Pool type, methods, and tests use super::trace::TxTraceMap; use super::types::{PoolEntry, TxPoolConfig}; use crate::tx_pool::orphan::OrphanPool; use crate::tx_pool::pending::PendingQueue; use crate::tx_pool::staging::StagingPool; use ckb_core::transaction::{OutPoint, ProposalShortId, Transaction}; use ckb...
/* artifact: the requirements tracking tool made for developers * Copyright (C) 2018 <NAME> <@vitiral, <EMAIL>> * * The source code is Licensed under either of * * * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or * http://www.apache.org/licenses/LICENSE-2.0) * * MIT license ([LICENSE-MIT](L...
use dialectic::prelude::*; use dialectic_tokio_serde::codec::LengthDelimitedCodec; use dialectic_tokio_serde_bincode::Bincode; use colored::*; use std::{error::Error, fmt::Debug, future::Future, io, process}; use structopt::StructOpt; use tokio::{ io::{AsyncBufRead, AsyncBufReadExt, AsyncWrite, AsyncWriteExt, BufR...
use crate::parse_helpers::{colon, consume_until_newline, decimal, hex_u16, hex_u8, whitespace}; /// Parser for /proc/net/tcp files, which are documented /// [here](https://www.kernel.org/doc/Documentation/networking/proc_net_tcp.txt) type Ip = [u8; 4]; /// TCP connection states enum, from /// [here](https://git.kern...
//! Register constraints for instruction operands. //! //! An encoding recipe specifies how an instruction is encoded as binary machine code, but it only //! works if the operands and results satisfy certain constraints. Constraints on immediate //! operands are checked by instruction predicates when the recipe is chos...
//! Linear orders for colors. use super::source::ColorSource; use super::Rgb8; use crate::hilbert::hilbert_point; use rand::seq::SliceRandom; use rand::Rng; use std::cmp::Ordering; /// An iterator over all colors from a source. #[derive(Debug)] struct ColorSourceIter<S> { source: S, coords: Vec<usize>, } ...
#[cfg(feature = "normalize")] extern crate nalgebra; extern crate serial; #[cfg(feature = "normalize")] use nalgebra::*; use std::fs::{File, OpenOptions}; use std::str::FromStr; use std::error::Error; use std::fmt; use std::io::{BufRead, BufReader, Lines}; #[macro_use] mod calculus; use calculus::*; mod circbuf; ...
#![allow(dead_code)] use std::f32::consts::PI; const DUTY: [u8; 4] = [ 0b10000000, 0b11000000, 0b11110000, 0b11111100 ]; /* Duty cycles, 1 = on, 0 = off */ ///Generate $desired_samples samples, and place them in $buffer ///sample_rate: Sample rate in Hz ///frequency_shift: Ammount in Hz to shift the frequency of the ...
use super::abi::{self, ProcInitInfo}; use crate::arch::paging::*; use crate::fs::{FileHandle, FileLike, OpenOptions, FOLLOW_MAX_DEPTH}; use crate::ipc::SemProc; use crate::memory::{ phys_to_virt, ByFrame, Delay, File, GlobalFrameAlloc, KernelStack, MemoryAttr, MemorySet, Read, }; use crate::sync::{SpinLock, SpinNoI...
#![warn(clippy::all, clippy::pedantic, clippy::nursery, rust_2018_idioms)] #![allow( clippy::module_name_repetitions, clippy::option_if_let_else, clippy::missing_const_for_fn, clippy::cast_precision_loss, clippy::cast_sign_loss, clippy::cast_possible_truncation, clippy::redundant_pub_crate )...
/* * Copyright 2020 Fluence Labs Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or a...
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use log::warn; use std::fs::{self, File}; use std::io::{BufReader, BufWriter, Write}; use std::path::{Path, PathBuf}; use account_common::{AccountManagerE...
use libloading::{Library, Symbol}; use std::collections::HashMap; use std::fs::{self, File}; use std::io::{self, Read}; use std::path::{Path, PathBuf}; use std::process::Command; use std::sync::Arc; use tree_sitter::{Language, PropertySheet}; const PACKAGE_JSON_PATH: &'static str = "package.json"; const PARSER_C_PATH:...
#![allow(unstable)] extern crate cql_ffi; use std::ffi::CString; use std::slice; use cassandra::*; //~ uv_mutex_t mutex; //~ uv_cond_t cond; //~ Future* close_future = NULL; //~ UuidGen* uuid_gen = NULL; fn wait_exit() { uv_mutex_lock(&mutex); while (close_future == NULL) { uv_cond_wait(&cond, &mutex...
use crate::cli::connect::BridgeConfig; use tedge_config::{ConnectUrl, FilePath, TemplatesSet}; #[derive(Debug, PartialEq)] pub struct BridgeConfigC8yParams { pub connect_url: ConnectUrl, pub mqtt_tls_port: u16, pub config_file: String, pub remote_clientid: String, pub bridge_root_cert_path: FilePat...
use deku::prelude::*; /// DOS header present in all PE binaries #[derive(Debug, Default, DekuRead, DekuWrite)] pub struct ImageDosHeader { /// Magic number: 5a4d pub e_magic: u16, pub e_cblp: u16, pub e_cp: u16, pub e_crlc: u16, pub e_cparhdr: u16, pub e_minalloc: u16, pub...
use futures_util::{ future::{self, Either}, pin_mut, }; use mqtt3::ShutdownError; use tracing::{debug, error, info, info_span}; use tracing_futures::Instrument; use mqtt_util::client_io::Credentials; use crate::{ client::{ClientError, MqttClientConfig}, config_update::BridgeDiff, persist::{Persist...
use cubik::input::{InputListener, process_input_event, center_cursor}; use cubik::container::RenderContainer; use cubik::glium::glutin::event_loop::{EventLoop, ControlFlow}; use cubik::glium::glutin::event::{Event, WindowEvent, VirtualKeyCode, ElementState, StartCause}; use crate::game_client::{GameClient, GameClientEr...
// Copyright 2014 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 ...
use sp_core::H256; use sp_io::TestExternalities; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, testing::Header, Storage }; use crate as dotsama_claims; use frame_support::{ parameter_types, assert_ok, dispatch::DispatchResultWithPostInfo, traits::Everything, }; use frame_system as syste...
use crate::gameplay::{Team, TeamWrap}; use crate::physics::{check_collision, Bullet, HitBox, PhysicsComponent, TileMap}; use crate::prelude::*; use crate::sound::{SoundQueue, SoundRequest}; use crate::world_map::Item; use crate::{Event, EventQueue, UIState}; use crate::{Input, SimTime, Timer}; const PLAYER_ACCELERATIO...
use ethers_core::utils::rlp::{Decodable, DecoderError, Encodable, Rlp, RlpStream}; use serde_json::Value; use std::fmt::{Debug, Display, Formatter}; /// Arbitrarly nested data /// Item::Array(vec![]); is equivalent to [] /// Item::Array(vec![Item::Data(vec![])]); is equivalent to [""] or [null] #[derive(Debug, Clone, ...
use anyhow::anyhow; use futures::{ channel::mpsc::unbounded, channel::mpsc::{UnboundedReceiver, UnboundedSender}, }; use futures::{SinkExt, StreamExt}; use lsp_async_stub::{rpc, Server}; use std::sync::Arc; use taplo_lsp::{log_error, log_info, World}; use tokio::{ io::{AsyncBufRead, AsyncBufReadExt, AsyncRe...
use azure_core::{HttpClient, WasiHttpClient}; use azure_storage::blob::prelude::*; use azure_storage::core::prelude::*; use bytes::{BufMut, Bytes}; use futures::executor::block_on; use futures::stream::StreamExt; use std::cell::RefCell; use std::error::Error; use std::rc::Rc; use std::sync::Arc; pub fn main() { //...
use crate::lib::packet_parse::{PacketHeader, PacketParse, ParsedPacket}; use pcap::{Active, Capture, Device}; use std::fs; use std::net::IpAddr; use std::sync::{Arc, Mutex}; use threadpool::ThreadPool; pub struct PacketCapture { err_count: u64, } impl PacketCapture { pub fn new() -> PacketCapture { Pa...
use crate::exp_setup::defaults::{ PHYS_CLOSE_DIST_ONE_AT, PHYS_CLOSE_DIST_ZERO_AT, RAW_COA_PARAMS_WITH_ZERO_MAG, }; use crate::exp_setup::{ExperimentType, RgtpDistribDefs}; use crate::parameters::quantity::{Length, Quantity, Time}; use crate::world::{EulerOpts, IntegratorOpts, RkOpts}; use serde::{Deserialize, ...
use libc::*; use path::*; use utf8::*; use allegro_util::c_bool; opaque!(ALLEGRO_FILE); #[repr(C)] #[derive(Copy, Clone, Debug)] pub struct ALLEGRO_FILE_INTERFACE { pub fi_fopen: Option<unsafe extern "C" fn(path: *const c_char, mode: *const c_char) -> *mut c_void>, pub fi_fclose: Option<unsafe extern "C" fn(handl...
use crate::proto::index::query::Kind as ProtoQueryKind; use crate::proto::index::Query as ProtoQuery; use crate::search::query::create_query; use crate::search::query::QueryFactoryError; use serde::de::{self, Deserialize, Deserializer, MapAccess, SeqAccess, Unexpected, Visitor}; use std::fmt; use tantivy::query::BoostQ...
use crate::aggregate::Tag; use crate::vo::{FusenId, TagHash}; use anyhow::{Error, Result}; pub trait TagRepository { fn create(&self, entity: Tag) -> Result<(), Error>; fn delete(&self, entity: Tag) -> Result<(), Error>; fn get(&self, hash: TagHash) -> Result<Tag, Error>; fn get_by_fusen_id(&self, fsen...
use std::iter::Peekable; use std::str::CharIndices; use nu_errors::ParseError; use nu_source::{Span, Spanned, SpannedItem}; type Input<'t> = Peekable<CharIndices<'t>>; #[derive(Debug, Clone)] pub struct LiteCommand { pub name: Spanned<String>, pub args: Vec<Spanned<String>>, } impl LiteCommand { fn new(...
use crate::hosts::Host; use crate::network::InterfaceNetwork; use crate::chain::ChainedEntryIterator; use log::warn; use pnet::datalink::MacAddr; use serde_yaml::{Mapping, Value}; use std::io::{self, Write}; use std::net::IpAddr; use tabwriter::TabWriter; pub struct Entry { pub name: String, pub mac: Option<Ma...
use alloc::string::String; use core::{default::Default, fmt}; /// Returns a one-line hexdump of `source` grouped in default format without header /// and ASCII column. pub fn simple_hex<T: AsRef<[u8]>>(source: &T) -> String { let mut writer = String::new(); hex_write(&mut writer, source, HexConfig::simple()).u...
use super::*; use crate::consts::{INFORM_PER_MSEC, USEC_PER_TICK}; use crate::process::thread_manager; use crate::process::Process; use crate::syscall::TimeSpec; use crate::{processor, thread}; use alloc::collections::VecDeque; use alloc::sync::Arc; use alloc::vec::Vec; use rcore_thread::std_thread::{sleep, Thread}; p...
// M_6_1_02 // Spring.js // // Generative Gestaltung – Creative Coding im Web // ISBN: 978-3-87439-902-9, First Edition, Hermann Schmidt, Mainz, 2018 // <NAME>, <NAME>, <NAME>, <NAME> // with contributions by <NAME> and <NAME> // Copyright 2018 // // http://www.generative-gestaltung.de // // Licensed under the Apache L...
use crate::types::*; use crate::gl; use std::rc::Rc; use tobj; use std::path::Path; use nalgebra; pub struct ObjModel { vertices: nalgebra::DMatrix<f32>, indices: Vec<u32>, material: Option<String>, vao: VertexArrayObj, vbo: VertexBufferObj, eao: ElementArrayObj, shader: CompiledShaderPro...
/** * Copyright 2019-2020, <NAME> and the zenith contributors */ use serde_derive::{Deserialize, Serialize}; use std::collections::HashMap; use std::fs; use std::io::Write; use std::path::{Path, PathBuf}; use std::time::{Duration, SystemTime}; const ONE_WEEK: u64 = 60 * 60 * 24 * 7; const DB_ERROR: &str = "Couldn't ...
use crate::prelude::*; use crate::types::pointer_tagging::{ObjectTag, PointerTag}; use std::{convert, fmt}; const IMMEDIATE_TAG_MASK: u64 = 0xffff << 32; lazy_static! { static ref IMMEDIATE_TYPE_NAME: GcRef<Symbol> = { symbol_lookup::make_symbol(b"immediate") }; static ref SPECIAL_MARKER_TYPE_NAME: GcRef<Symb...
use arrsac::Arrsac; use cv_core::nalgebra::{Point2, Vector2}; use cv_geom::triangulation::LinearEigenTriangulator; use cv_pinhole::{CameraIntrinsics, CameraIntrinsicsK1Distortion}; use cv_sfm::{VSlam, VSlamSettings}; use eight_point::EightPoint; use lambda_twist::LambdaTwist; use log::*; use rand::SeedableRng; use ran...
extern crate tempdir; extern crate assert_cmd; extern crate predicates; #[allow(unused_imports)] use std::io::{Read,Write}; use std::process::{Command, Stdio}; use std::env; use std::str; use std::iter::repeat; use std::fs::File; use std::convert::AsRef; use std::path::PathBuf; use std::collections::HashMap; use sel...
#[derive(PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] enum DemoType { Manual, ManyHomogenous, ManyHeterogenous, } /// Shows off a table with dynamic layout #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] pub struct TableDemo { dem...
use super::{raw_differ_options::RawDifferOptions, skip_counter::SkipCounter}; use crate::{ call_wrapper::CallWrapper, differs::{ change_counter::{ChangeCounter, ChangeType}, json_utils::json_collapse_byte_arrays, }, }; use log::debug; use serde::Serialize; use treediff::{diff, tools::Recorder}; pub struct RawDi...
use std::fmt::{self, Display, Write, Error}; #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[repr(u8)] pub enum Digit { Zero = 0, One = 1, Two = 2, Three = 3, Four = 4, Five = 5, } use crate::Digit::*; impl Display for Digit { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ...
// This file is copied from ic-certified-map which was released under Apache V2. // Some modifications are made to improve the code quality. use serde::{ser::SerializeSeq, Serialize, Serializer}; use serde_bytes::Bytes; use sha2::{Digest, Sha256}; /// SHA-256 hash bytes. pub type Hash = [u8; 32]; #[derive(Debug)] pub...
extern crate chrono; extern crate env_logger; #[macro_use] extern crate log; extern crate yaml_rust; use std::borrow::BorrowMut; use std::error::Error; use std::io::Write; use std::thread::JoinHandle; use std::{process, thread}; use chrono::{Local, Utc}; use clap::Parser; use env_logger::Builder; use log::LevelFilter...
//! Elliptic curve crypt //! This uses the core elliptic curve operations but expresses them in //! cryptographic terms. use crate::types::{ CombinedPublicKey, CombinedSignature, IndividualSignature, Pop, PublicKey, PublicKeyBytes, SecretKey, }; use group::CurveProjective; use ic_crypto_internal_bls12381_common...
/* * Copyright (C) 2022 Open Source Robotics Foundation * * 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 appl...
use gtk::prelude::*; use gtk::{ Builder, Button, ButtonsType, DialogFlags, FileChooserAction, FileChooserDialog, Label, Menu, MenuItem, MessageDialog, MessageType, TreeStore, TreeView, TreeViewColumn, Window, }; use relm::{init, Component, Relm, Update, Widget}; use std::path::Path; use database::Database; ...
use std::collections::HashMap; use virtual_dom_rs::View; type ViewFn = Box<Fn(HashMap<String, String>) -> Box<View>>; type ParamTypes = HashMap<String, ParamType>; /// A route specifies a path to match against. When a match is found a `view_creator` is used /// to return an `impl View` that can be used to render the ...
use bincode; use geo::line_interpolate_point::LineInterpolatePoint; use geo::line_locate_point::LineLocatePoint; use geo::{point}; use geo::prelude::EuclideanDistance; use pyo3::exceptions::PyException; use pyo3::prelude::*; use pyo3::types::{PyBytes, PyDict, PyTuple, PyList}; use rayon::prelude::*; us...
//! Arch Linux binary to return input aur packages along with their //! mistrusted maintainers. Local trusted users are stored in //! /etc/aurto/trusted-users. //! //! Will output a line per package in PACKAGE_NAME:USERNAME format //! for each mistrusted package. //! //! If package is not found in the AUR will output P...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct MatchExceptionGrp { /// NoMatchExceptions #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "2772")] pub match_exceptions: Option<fix_common::RepeatingValues<MatchException>>, } #[...
mod chip8; mod keys; mod mem; mod opcode; mod rom; mod screen_buffer; use chip8::Chip8; use rom::Rom; use ggez::conf::WindowSetup; use ggez::event::{self, EventHandler}; use ggez::event::{KeyCode, KeyMods}; use ggez::graphics; use ggez::nalgebra::Point2; use ggez::{Context, ContextBuilder, GameResult}; const CYCLES_...
// spell-checker:ignore (jargon) xattributes #![cfg(feature = "feat_selinux")] use crate::common::util::*; // TODO: Check the implementation of `--compute` somehow. #[test] fn version() { new_ucmd!().arg("--version").succeeds(); new_ucmd!().arg("-V").succeeds(); } #[test] fn help() { new_ucmd!().arg("-...
pub mod bits; mod fft; mod filter; mod gen; mod samples; mod shift; use std::f64::consts::PI; use std::fs; use anyhow::anyhow; use anyhow::Error; use byteorder::ByteOrder; use num_complex::Complex; use num_traits::identities::Zero; pub use crate::samples::Samples; const TAU: f64 = PI * 2.; #[derive(Debug, Clone)] ...
extern crate route_recognizer as router; extern crate conduit; use std::collections::hash_map::{HashMap, Entry}; use std::error::Error; use std::fmt; use router::{Router, Match}; use conduit::{Method, Handler, Request, Response}; pub struct RouteBuilder { routers: HashMap<Method, Router<Box<Handler>>>, } #[deri...
//! This crate allows you to safely initialize Dynamically Sized Types (DST) using //! only safe Rust. //! //! ```ignore //! #[repr(C)] //! #[derive(DynStruct)] //! struct MyDynamicType { //! pub awesome: bool, //! pub number: u32, //! pub dynamic: [u32], //! } //! //! // the `new` function is generated b...
use std::path::PathBuf; use std::env; use std::fs; use std::fs::File; use std::fs::OpenOptions; mod utility; use utility::{ save_reader, print_extensions, print_info, get_vermintide_dir, }; mod reader; use reader::Index as Index; const VERSION: &str = env!("CARGO_PKG_VERSION"); const PROGRAM_NAME: &st...
use hyper::HeaderMap; use indicatif::ProgressBar; use reqwest::Client; use std::path::Path; use tokio::fs as tfs; use tokio::io::AsyncWriteExt; use tokio::time::{timeout, Duration}; use crate::dlm_error::DlmError; use crate::file_link::FileLink; use crate::ProgressBarManager; pub async fn download_link( raw_link:...
use crate::storage::ComponentTypeId; use std::ffi::c_void; use std::any::TypeId; use std::cell::RefMut; use std::ops::Deref; #[repr(C)] pub struct Universe { _private: [u8; 0], } #[repr(C)] pub struct World { _private: [u8; 0], } impl From<*mut World> for &mut crate::prelude::World { fn from(world: *mut W...
#![no_std] #![recursion_limit = "1024"] pub mod pins; use atsamd_hal as hal; #[cfg(feature = "rt")] pub use cortex_m_rt::entry; pub use pins::Pins; use hal::*; pub use hal::common::*; pub use hal::samd51::*; pub use hal::target_device as pac; use gpio::{Floating, Input, Output, PfC, Port, PushPull}; use hal::cloc...
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use crate::Result; use fidl::endpoints::create_request_stream; use fidl_fuchsia_media::*; use fuchsia_syslog::fx_log_warn; use futures::stream::{FusedStrea...
use std::collections::VecDeque; use std::fs::OpenOptions; use std::io::Write; use std::sync::{Arc, Condvar, Mutex, RwLock}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::{channel, Receiver}; use std::thread::{JoinHandle, spawn}; use std::time::Duration; use serde::Deserialize; use crate::bot::ma...
use crate::map::{Vector2D, BlockMap}; use winit_input_helper::WinitInputHelper; use winit::event::VirtualKeyCode; use rayon::prelude::*; use std::f64::consts::PI; pub const RENDER_WIDTH: u32 = 320 * 2; pub const RENDER_WIDTH_MID: u32 = (RENDER_WIDTH as f64 / 2.0) as u32; pub const RENDER_HEIGHT: u32 = 240 * 2; pub con...
//! Module containing data types reprsenting on-the-wire data for packages use std::collections::HashMap; use std::fmt; use std::str::FromStr; use serde::{Deserialize, Serialize}; use super::common::*; /// The package ecosystem // TODO Should be Ecosystem? #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Copy, Clone,...
use anyhow::anyhow; use heck::{CamelCase, ShoutySnakeCase, SnakeCase, TitleCase}; use serde::{Deserialize, Serialize}; use std::{collections, fs, iter, str, string}; use crate::{mms, pdr}; impl mms::DataType { fn as_pyarrow_schema_type(&self) -> String { match self { mms::DataType::Varchar { ....
use std::path::PathBuf; use anyhow::{anyhow, Error}; use image::EncodableLayout; use image::Rgba; use memeinator::{Config, MemeConfig, MemeContent, MemeField}; use structopt::{clap::Shell, StructOpt}; use std::str::FromStr; mod image_io; #[derive(Debug, StructOpt)] #[structopt( name = "meme-cli", about = "A ...
/* Copyright 2017 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,...
use crate::dns::dname::DomainName; use crate::dns::{MessageBytes, QType}; use bytes::{Buf, BufMut, Bytes, BytesMut}; #[derive(Debug, PartialEq, Clone)] pub struct ResourceRecord { pub domain_name: DomainName, // QNAME - needs to be parsed as labels pub resource_type: QType, // TYPE - 16 bits pub resourc...
#![cfg_attr(feature = "nightly-doc", feature(external_doc))] #![cfg_attr(feature = "nightly-doc", doc(include = "../README.md"))] use pm::Span; extern crate proc_macro; use proc_macro2 as pm; use quote::ToTokens; mod bigint; mod literal; /// A stream of [`TokenTree`]s. This is typically what a proc macro will receiv...
use crate::{ program::internal_events::{ patch, Dispatch }, components::{ActiveClosure, CreatedNode}, vdom, vdom::diff, vdom::Patch, }; use wasm_bindgen::JsCast; use web_sys::{self, Element, Node}; /// Used for keeping a real DOM node up to date based on the current Node /// and a new i...
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors // SPDX-License-Identifier: MIT #![allow(clippy::identity_op)] //! This sub module provides different implementations of the `repository` used to store objects. use std::convert::{TryFrom, TryInto}; use modular_bitfield::prelude::*; use serde::{...
//! Test utilites shared between integration_tests.rs and tty_tests.rs use deno_cli::colors::strip_ansi_codes; pub use deno_cli::test_util::*; use os_pipe::pipe; use std::io::Read; use std::io::Write; use std::process::Command; use std::process::Stdio; use tempfile::TempDir; lazy_static! { static ref DENO_DIR: TempD...
extern crate libc; use libc::{c_char, c_int, c_uint, c_void}; use std::sync::Arc; use ffi::{QVariant, QrsEngine, QObject}; use std::path::Path; use std::convert::AsRef; /* Re-exports */ pub use variant::{Variant, FromQVariant, ToQVariant}; pub use ffi::QVariant as OpaqueQVariant; /* Submodules */ #[allow(dead_code...
// Copyright 2021 The Hypatia Authors // All rights reserved // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. //! //! Support for x86 segmentation. In the host, we only support //! 64-bit segmentation. //! use cr...
use crate::report::IasReport; use crate::AttestationError; use anyhow::Error; use anyhow::Result; use log::debug; use sgx_types::*; use std::collections::HashMap; use std::io::{Read, Write}; use std::net::TcpStream; use std::prelude::v1::*; use std::sync::Arc; use utils; extern "C" { fn ocall_sgx_get_ias_socket(p_...
//! Static and Voyage Related Data (type 5) use super::parsers::*; use super::types::*; use super::AisMessageType; use crate::errors::Result; use nom::bits::{bits, complete::take as take_bits}; use nom::combinator::map; use nom::IResult; #[derive(Debug, PartialEq)] pub struct StaticAndVoyageRelatedData { pub messa...
use crate::{ AsKeyword, Comment, DoubleDot, Equals, ExportsKeyword, Expression, ForeignKeyword, ImportKeyword, ModuleKeyword, ModuleName, Name, PackageName, Parens, ParensList1, Pipe, ProperName, Semicolon, Type, TypeAnnotation, TypeKeyword, }; use std::iter; /// A ditto (source) module. #[derive(Debug, Cl...
extern crate proc_macro2; use std::str; use proc_macro2::{Term, Literal, TokenStream}; #[cfg(procmacro2_semver_exempt)] use proc_macro2::TokenNode; #[cfg(procmacro2_semver_exempt)] #[cfg(not(feature = "nightly"))] use proc_macro2::Span; #[test] fn symbols() { assert_eq!(Term::intern("foo").as_str(), "foo"); ...
//! This houses various NAT hole punching strategies. //! //! Currently supported strategies: //! - UPnP use crate::{NetworkConfig, NetworkMessage}; use if_addrs::get_if_addrs; use slog::{debug, info}; use std::net::{IpAddr, SocketAddr, SocketAddrV4}; use tokio::sync::mpsc; use types::EthSpec; /// Configuration requi...
use std::ops::Deref; use std::sync::atomic::{AtomicI32, AtomicI64, Ordering}; use log::{LevelFilter, Log, Metadata, Record}; use crate::appender::{Command, FastLogRecord}; use crate::error::LogError; use crate::filter::{Filter}; use std::result::Result::Ok; use std::time::{SystemTime}; use std::sync::Arc; use crossbea...
extern crate piston_window; use piston_window::*; use crate::circbuf::CircBuf; use std::time::SystemTime; // use graphics::glyph_cache::rusttype::GlyphCache; const SIZE: [f64; 2] = [1280., 720.]; const BUFFERED_SECS: usize = 10; pub fn run<I>(mut data: I) where I: Iterator<Item=(f32, f32, f32, f32)> { let frequenc...
use std::{path::Path, str::FromStr}; use ::enum_primitive_derive::Primitive; use ::num_traits::FromPrimitive; use crate::{PrmFile, PrmParseError}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Primitive)] pub enum Type { Raffa = 0, Light = 1, Microbus = 2, Atw = 3, Track = 4, Special = 5, } pu...