text
stringlengths
3.09k
13.9k
use super::*; /// The logical comparison to use when comparing the value of the filter key in /// the lobby metadata against the value provided to compare it against /// /// [API docs](https://discord.com/developers/docs/game-sdk/lobbies#data-models-lobbysearchcomparison-enum) #[derive(Copy, Clone, Debug, PartialEq, E...
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors // SPDX-License-Identifier: MIT use std::{path::PathBuf, sync::Arc}; use crate::log::print; use clap::{Parser, Subcommand}; use crypto::hash::{ContextHash, HashTrait}; use parking_lot::RwLock; use tezos_context::{ kv_store::persistent::{FileS...
use super::ring::Ring; use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; use std::convert::From; use std::fmt; use strum_macros::EnumIter; #[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Hash, Debug, EnumIter)] #[serde(try_from = "String", into = "String")] pub enum Key { Potion, Escape, ...
use ansi_term::Colour; use itertools::Itertools; use rand::seq::SliceRandom; use std::collections::{HashMap, HashSet}; use text_io::read; #[derive(Debug, Copy, Clone, PartialEq)] enum KeyResult { // Use enum to give a name to each state the key can be in CorrectPosition, IncorrectPosition, NotInWord, }...
use crate::util::heap::layout::vm_layout_constants::LOG_ADDRESS_SPACE; #[cfg(target_pointer_width = "32")] use crate::util::heap::layout::vm_layout_constants::{BYTES_IN_CHUNK, LOG_BYTES_IN_CHUNK}; use crate::util::metadata::side_metadata::SideMetadataOffset; use crate::util::Address; // This is currently not used in 3...
use crate::data::manifest::Manifest; use crate::dataflow::resolved_manifest_packages::ResolvedManifestPackages; use crate::dataflow::WapmPackageKey; use crate::util::{ create_package_dir, fully_qualified_package_display_name, get_package_namespace_and_name, }; use flate2::read::GzDecoder; use std::fs::OpenOptions; ...
use bevy::prelude::*; use crate::game::bullet::{Bullet, Damage}; use crate::game::enemy::{Enemy, EnemyFaction, Health}; use crate::game::player::{InvulnTimer, Player, PlayerFaction}; use crate::game::starfield::Star; use crate::game::{GameState, WindowSize}; pub struct CollisionPlugin; impl Plugin for CollisionPlugi...
use anyhow::Result; use crate::common::{ Solution, Day }; use super::YEAR; pub type TheDay = Day<YEAR, 5>; use regex::Regex; use lazy_static::lazy_static; use std::collections::HashMap; #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] struct Point { x: u32, y: u32 } #[derive(Debug, PartialEq, Eq)] struct ...
use crate::csv::csv_data::{reset_stream, CsvStream, CsvType}; use crate::csv::inference::ColumnInference; use crate::qsv::{csv_stream_from_mime_type, Options}; use log::debug; use stats::{Frequencies, MinMax, OnlineStats}; use std::error::Error; use std::fmt::{Display, Formatter}; use std::fs::File; use std::hash::Hash...
use regex::Regex; use std::collections::HashMap; use std::collections::HashSet; fn line_mapper(line: &str) -> i64 { line.parse().unwrap() } fn make_map(rows: Vec<Vec<char>>) -> HashMap<(i64, i64), char> { let mut d: HashMap<(i64, i64), char> = HashMap::new(); for y in 0..rows.len() { for x in 0..ro...
use core::fmt; use rustc_middle::ty::TyCtxt; #[derive(Eq, PartialEq, Clone, Debug)] pub(crate) enum Cost { Concrete(u64), Symbolic(Symbolic), Add(Box<Cost>, Box<Cost>), ConcreteMul(u64, Box<Cost>), SymbolicMul(Symbolic, Box<Cost>), Max(Box<Cost>, Box<Cost>), } #[derive(Eq, PartialEq, Clone, De...
use std::collections::{HashMap, VecDeque}; use std::str::FromStr; #[derive(Clone)] enum Instruction { Snd(Value), Set(Value, Value), Add(Value, Value), Mul(Value, Value), Mod(Value, Value), Rcv(Value), Jgz(Value, Value), } pub struct Program { registers: HashMap<char, isize>, instr...
use crate::SymbolData; use crate::parser::*; const LC_SYMTAB: u32 = 0x2; const LC_SEGMENT_64: u32 = 0x19; #[derive(Clone, Copy)] struct Cmd { kind: u32, offset: usize, } #[derive(Clone, Copy)] struct Section { address: u64, size: u64, } pub fn parse(data: &[u8]) -> (Vec<SymbolData>, u64) { let m...
#[allow(unused_imports)] use crate::*; use winapi::um::d3d11shader::*; use std::fmt::{self, Debug, Formatter}; /// \[[docs.microsoft.com](https://docs.microsoft.com/en-us/windows/win32/api/d3d11shader/ne-d3d11shader-d3d11_shader_version_type)\] /// D3D11_SHADER_VERSION_TYPE / D3D11_SHVER_\* /// /// ### Example ///...
extern crate clap; use clap::ArgMatches; use rusqlite::params; use crypto; use crypto::Key; use database; use database::Connection; use types::{Password, User}; use super::prompt_passw; mod generate; fn update_verify(user: &User, key: &Key, conn: &mut Connection) { let nuser = User { hash: user.hash, ...
/* Copyright 2020 <NAME> (github.com/erwanM974) 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 wri...
#![no_std] #![recursion_limit = "1024"] extern crate atsamd_hal as hal; #[cfg(feature = "rt")] extern crate cortex_m_rt; #[cfg(feature = "keypad-unproven")] #[macro_use] pub extern crate keypad; pub mod pins; #[cfg(feature = "rt")] pub use cortex_m_rt::entry; pub use hal::{*, atsamd51g19a::*}; use gpio::{Floating...
/// Provides encoder input format options. /// /// This is a list of all binary formats supported by the encoder. #[derive(Debug)] pub enum EncoderLit<'a> { /// Represents `binary` format of wire type `2`. Bytes(&'a Vec<u8>), /// Represents `bool` format of wire type `0`. Bool(&'a bool), /// Repr...
use core::{ fmt, ops::{Add, Rem}, }; use uom::{ fmt::DisplayStyle::Abbreviation, si::f64::*, si::{ acceleration::foot_per_second_squared, angle::{degree, revolution}, length::foot, time::second, velocity::{foot_per_minute, knot}, }, }; /// Represents the...
//! This crate implements the JSON-RPC protocol as described by `zkms-jsonrpc` use std::net::ToSocketAddrs; #[macro_use] extern crate log; use futures::{ stream::{Stream, StreamExt}, Future, FutureExt, SinkExt, }; use jsonrpc_http_server::jsonrpc_core::{BoxFuture, IoHandler, Result as RpcResult}; use host_c...
use crossbeam_channel::{bounded, Receiver, RecvTimeoutError, Sender}; use std::cmp::Reverse; use std::collections::{BinaryHeap, HashMap}; use std::sync::atomic::AtomicU32; use std::sync::{ atomic::{AtomicU64, AtomicUsize, Ordering}, Arc, RwLock, }; use std::thread::{self, JoinHandle}; use std::time::Instant; u...
use crate::common::*; use crate::backends::{LastUpdated, Probe}; use crate::gcp::bigquery::{JobBuilder, TableRef}; use crate::opt::{ Context, ContextError, ContextKey, DataType, Domain, ExprMeta, MaximumFrequency, Mode, RowCount, TableMeta, }; use crate::Result; use super::{table_ref_to_context_key, BigQuery}...
mod algo; mod data; mod textures; use std::time::Duration; use crate::data::{constants, Board, GameState, Tile}; use image::EncodableLayout; use macroquad::prelude::*; fn window_conf() -> Conf { Conf { window_width: 598, window_height: 650, window_title: "Minesweeper".to_owned(), ...
use std::{fmt, fs::File, io, io::prelude::*, process}; use crate::boids::{SimulationConfig, WindowSize}; use clap::{ self, App, Arg, ArgMatches, ErrorKind::{HelpDisplayed, VersionDisplayed}, }; use toml; const CONFIG_ARG: &str = "config"; const WINDOW_SIZE_ARG: &str = "size"; const FULLSCREEN_ARG: &str = "fu...
mod config; mod db; mod dummy; mod mesh; mod opt; mod rpc; mod sensor; mod supervisor; mod tasks; mod util; use crate::{dummy::dummy_sensors, opt::Opt}; use ble_ws_api::proto::{ self, ble_weatherstation_service_server::BleWeatherstationServiceServer, OverviewResponse, OverviewResponseField, }; use clap::Clap; ...
use futures::stream::{SplitSink, FuturesUnordered}; use crate::exchange_bot::{ExchangeBot, WsHandler, DefaultWsActor}; use crate::types::{Channel, Pair, LiveEventEnveloppe, LiveAggregatedOrderBook, LiveEvent, Orderbook}; use std::collections::{HashSet, HashMap}; use crate::coinnect::Credentials; use std::rc::Rc; use st...
use crate::error::ParseError; pub mod kwords { pub const BLOCK_OPEN: &str = "📦"; pub const BLOCK_CLOSE: &str = "🧑‍🦲"; pub const EXPR_SEP: &str = "💪"; pub const IF: &str = "❓"; pub const ELIF: &str = "😠"; pub const ELSE: &str = "😡"; pub const BREAK: &str = "💔"; pub const LOOP: &...
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. use crate::{folding::quartic, utils}; use math::{ field::{FieldElement, StarkField}, polynom, utils::get_power_series_with_off...
use log::{trace, warn}; use std::collections::BTreeMap; use std::sync::{Arc, RwLock}; use tonic::{Code, Request, Response, Status}; pub mod proto { tonic::include_proto!("fs"); } pub use crate::proto::file_system_server::{FileSystem, FileSystemServer}; use crate::proto::{ ExecRequest, ExecResponse, GetRequest...
// // Copyright 2022 The Project Oak 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 o...
// Copyright 2018-2020 argmin 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 according...
use crate::{ProgressBar, ProgressBarIter}; use rayon::iter::{ plumbing::{Consumer, Folder, Producer, ProducerCallback, UnindexedConsumer}, IndexedParallelIterator, ParallelIterator, }; use std::convert::TryFrom; /// Wraps a Rayon parallel iterator. /// /// See [`ProgressIterator`](trait.ProgressIterator.html) ...
pub mod play; pub mod sources; use std::{collections::{HashMap, hash_map::RandomState}, sync::Arc}; use serenity::{model::id::GuildId, async_trait, http::Http, model::prelude::ChannelId, framework::standard::{Args, CommandOptions, Reason, macros::check}}; use serenity::model::prelude::*; use serenity::prelude::*; us...
use ggez; use ggez::event::EventHandler; use ggez::mint::Point2; use ggez::GameResult; use ggez::{conf, graphics}; const SCREEN_SIZE: (f32, f32) = (600.0, 500.0); const BAT_SIZE: (f32, f32) = (10.0, 50.0); const BALL_RADIUS: f32 = 10.0; type Point = Point2<f32>; #[derive(Debug, Clone)] struct State { player1: Pl...
use crate::embeds; use crate::extensions::*; use crate::{abort_with, db::Db, util}; use super::checks::*; //use super::Config; use anyhow::{Context, Result}; use chrono::Utc; use itertools::Itertools; use reaction_collector::ReactionAction; use serenity::{ client, collector::reaction_collector, framework::...
use sha1::Sha1; use crate::aio; use crate::cmd::{cmd, Cmd}; use crate::connection::ConnectionLike; use crate::types::{ErrorKind, FromRedisValue, RedisError, RedisFuture, RedisResult, ToRedisArgs}; use futures::{try_ready, Async, Future, Poll}; /// Represents a lua script. pub struct Script { code: String, has...
use crate::common::{Field, YaSerdeAttribute, YaSerdeField}; use crate::ser::{implement_serializer::implement_serializer, label::build_label_name}; use proc_macro2::TokenStream; use quote::quote; use syn::DataEnum; use syn::Fields; use syn::Ident; pub fn serialize( data_enum: &DataEnum, name: &Ident, root: &str, ...
use super::builder::{ constrained_rule, date, fact, pred, s, string, Constraint, ConstraintKind, Fact, IntConstraint, Rule, Caveat, var, }; use super::Biscuit; use crate::datalog; use crate::error; use std::{convert::TryInto, time::SystemTime}; pub struct Verifier<'a> { token: &'a Biscuit, base_world: ...
use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::ty::is_type_diagnostic_item; use rustc_ast::ast::LitKind; use rustc_errors::Applicability; use rustc_hir::intravisit::{walk_expr, Visitor}; use rustc_hir::{Arm, Expr, ExprKind, MatchSource, PatKind}; use rustc_lint::{LateContext, LateLintPass}; use ru...
//! Entity is an abstraction over Profiles and Vaults, easing the use of these primitives in //! authentication and authorization APIs. #![deny(unsafe_code)] #![warn( // prevented by big_array // missing_docs, trivial_casts, trivial_numeric_casts, unused_import_braces, unused_qualifications )] ...
use std::io::{Error, ErrorKind, Read, Result, Write}; use std::net::{SocketAddr, SocketAddrV4, SocketAddrV6}; use byteorder::{BigEndian, LittleEndian, ReadBytesExt, WriteBytesExt}; pub use little::Little; pub use triad::Triad; mod little; mod triad; /// Allows the type to be encoded/decoded using RakNet binary form...
use serde::{Deserialize, Serialize}; use crate::{ error::{CommonError, CommonResponse}, wechat::WxApiRequestBuilder, SdkResult, }; #[derive(Debug, Serialize, Deserialize)] pub struct UserList { pub total: Option<i32>, pub data: OpenidList, pub count: i32, pub next_openid: String, } #[deri...
use std::{sync::Arc, time::Instant}; use crate::data_source::MappingABI; use crate::{ capabilities::NodeCapabilities, network::EthereumNetworkAdapters, Chain, DataSource, EthereumAdapter, EthereumAdapterTrait, EthereumContractCall, EthereumContractCallError, }; use anyhow::{Context, Error}; use blockchain::Hos...
use std::{env, fs, io, path::{Path, PathBuf}}; use glob::glob; use log::info; use regex::Regex; use thiserror::Error; use url::Url; #[cfg(windows)] use crate::fs_util::remove_file_after_reboot; use crate::{bundle::Bitness, version::NowVersion}; const VERSION_URL: &str = "https://devolutions.net/productinfo.htm"; con...
// 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::v1::V1Realm, files_async::readdir_with_timeout, fuchsia_zircon as zx, futures::future::{BoxFuture, FutureExt}, io_util::{d...
// --------------------------------------------------------------------- // Sender implementation // --------------------------------------------------------------------- // Copyright (C) 2007-2021 The NOC Project // See LICENSE for details // --------------------------------------------------------------------- use c...
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2017-2020 Parity Technologies (UK) Ltd. // This file is part of Frontier. // 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) an...
// 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...
//! A client for the controller's Destination service. //! //! This client is split into two primary components: A `Resolver`, that routers use to //! initiate service discovery for a given name, and a `background::Process` that //! satisfies these resolution requests. These components are separated by a channel so //!...
use alloc::alloc::{alloc, dealloc}; use core::alloc::Layout; use core::cmp::Ordering; use core::fmt; use core::fmt::{Debug, Display, Formatter}; use core::marker::PhantomData; use core::mem::{size_of}; use core::{ptr, slice}; use crate::as_string_bytes::AsStringBytes; use crate::rc::{Rc, ReferenceCounted}; #[r...
// Copyright 2022 <NAME>, 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 in wri...
//! Helper functions and useful types for interacting with WebRender use std::sync::Arc; use std::sync::atomic::{self, AtomicBool}; use gleam::gl; use glutin; use webrender; use webrender::api::*; use window::Window; use euclid::TypedPoint2D; use resources; use geometry::{Rect, Point, Size}; // Provides access to t...
extern crate clap; //extern crate fuse; extern crate secstr; extern crate colorhash256; extern crate interactor; extern crate rusterpassword; extern crate ansi_term; extern crate hex; extern crate base64; extern crate serde; extern crate serde_cbor; extern crate csv; extern crate freepass_core; mod util; mod openfile;...
//! Integration points for the moxie runtime. Generally not called directly by //! applications. //! //! To integrate moxie with an existing system, a `Runtime` must be created with //! a user-provided root closure to execute each `Revision`. If the embedding //! system will change its scheduling based on mutations of ...
use crate::error::Result; use postgres::Connection; use std::collections::BTreeMap; use std::time::Duration; #[derive(Debug, PartialEq)] pub(crate) struct Limits { memory: usize, targets: usize, timeout: Duration, networking: bool, max_log_size: usize, } impl Default for Limits { fn default() ...
#![allow(unused_imports)] use geometry::prim::{Prim}; use geometry::prims::{Plane, Sphere, Triangle}; use light::light::{Light}; use light::lights::{PointLight, SphereLight}; use material::materials::{CookTorranceMaterial, FlatMaterial, PhongMaterial}; use material::Texture; use material::textures::{CheckerTexture, Cu...
use std::borrow::Cow; use std::io::Write; use std::ops::DerefMut; use std::path::{Path, PathBuf}; use std::time::Instant; use crate::app::window::AppWindow; use image::codecs::gif::GifEncoder as Encoder; use image::RgbaImage; use tokio::time::Interval; use super::window::Target; use super::{ canvas::Bound2, ...
use std::path::PathBuf; use super::{Color, Hsl}; #[derive(Debug, confique::Config)] pub(crate) struct ThemeConfig { #[config(default = 50)] pub(crate) header_height: u32, /// Path to CSS file that includes all used font files and sets the variable /// `--main-font` in the `:root` selector. For examp...
// Copyright 2019-2021 Thales Inc. // This file is part of Thales. // Thales is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // Th...
use std::{any::Any, sync::Arc}; use async_trait::async_trait; use datafusion::{ arrow::{ array::{ Array, ArrayRef, BooleanBuilder, Int32Builder, ListBuilder, StringBuilder, UInt32Builder, }, datatypes::{DataType, Field, Schema, SchemaRef}, record_batch::Reco...
//! Components for the SI7021 Temperature/Humidity Sensor. //! //! This provides three Components, SI7021Component, which provides //! access to the SI7021 over I2C, TemperatureComponent, which //! provides a temperature system call driver, and HumidityComponent, //! which provides a humidity system call driver. SI7021...
#![no_std] #![feature(alloc_prelude)] #[macro_use] extern crate alloc; use alloc::collections::btree_map::BTreeMap; use dyndl_types::*; use icecap_core::prelude::*; mod cregion; mod allocator; mod utils; mod model_view; mod initialize_subsystem_objects; use model_view::ModelView; use utils::{blueprint_of, size_bit...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 #![forbid(unsafe_code)] //! `Semaphore` holds a set of permits. Permits are used to synchronize access //! to a shared resource. Before accessing the shared resource, callers must //! acquire a permit from the semaphore. Once the perm...
use super::Weekday::{self, Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday}; #[allow(unused_imports)] use standback::prelude::*; fn is_leap_year(year: i32) -> bool { (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)) } pub(crate) fn days_in_year(year: i32) -> u16 { 365 + is_leap_year(y...
//! The interface and implementations of LZ77 compression algorithm. //! //! LZ77 is a compression algorithm used in [DEFLATE](https://tools.ietf.org/html/rfc1951). #![warn(missing_docs)] pub use self::default::{DefaultLz77Encoder, DefaultLz77EncoderBuilder}; use rle_decode_fast::rle_decode; mod default; /// Maximum ...
use block_buffer::{block_padding::ZeroPadding, BlockBuffer}; use core::marker::PhantomData; use digest::consts::U64; use digest::generic_array::{ArrayLength, GenericArray}; use digest::{BlockInput, FixedOutputDirty, Reset, Update}; use crate::consts::{BLOCK_SIZE, C}; use crate::table::SHUFFLED_LIN_TABLE; type Block =...
use crate::{DynError, Migration, PlanExecErrorKind}; use async_trait::async_trait; use std::{ any::{self, Any}, collections::HashMap, fmt, }; /// Gives methods for creating the context for the migration. /// This should most likely create a database client, or initialize some /// state, for example ensure ...
use std::path::Path; use linked_hash_map::LinkedHashMap; use log::trace; use crate::actions::{Action, ActionId}; use crate::config::VariableInfo; use crate::rules::RulesContext; use crate::template_engine::Context; use crate::{Archetect, ArchetectError, Archetype}; #[derive(Debug, Serialize, Deserialize, Clone)] pu...
use std::{net::SocketAddr, pin::Pin}; use crate::{ async_channel::{Receiver, Sender}, async_trait, error::NetworkError, managers::NetworkProvider, NetworkPacket, }; use async_net::{TcpListener, TcpStream}; use bevy::log::{debug, error, info, trace}; use futures_lite::{AsyncReadExt, AsyncWriteExt, F...
use crate::{ core::{ efloat::EFloat, geometry::{Bounds3f, Point2f, Point3f, Ray, Vector3f}, interaction::{Interaction, InteractionDt, SurfaceInteraction}, pbrt::{clamp, radians, Float, PI}, shape::Shape, transform::Transformf, }, impl_base_shape, shapes::{...
use crate::{ light::{ AmbientLight, DirectionalLight, DirectionalLightUniform, PointLight, PointLightUniform, }, render_graph::uniform, }; use bevy_core::{AsBytes, Byteable}; use bevy_ecs::{ system::{BoxedSystem, IntoSystem, Local, Query, Res, ResMut}, world::World, }; use bevy_render::{ ...
// Modified version of https://github.com/elliotekj/DeltaE use lab::Lab; use std::f32; use std::f32::consts::PI; pub struct DE2000; pub struct KSubArgs { pub l: f32, pub c: f32, pub h: f32, } #[allow(clippy::needless_doctest_main)] impl DE2000 { /// Returns the difference between two `Lab` colors. ...
use std::clone::Clone; use std::string::ToString; use nature_common::{Executor, Meta, NatureError, Protocol, Result}; use crate::{FlowSelector, MetaCache, MetaDao, RawRelation, RelationSettings}; use crate::models::relation_target::RelationTarget; #[derive(Debug, Clone, Default, PartialEq)] pub struct Relation { ...
extern crate portus_export; extern crate slog; extern crate time; pub use crate::GenericCongAvoidAlg; pub use crate::GenericCongAvoidFlow; pub use crate::GenericCongAvoidMeasurements; #[derive(Default)] pub struct Cubic { pkt_size: u32, init_cwnd: u32, cwnd: f64, cwnd_cnt: f64, tcp_friendliness: ...
//! Tables within a wasm module. use crate::emit::{Emit, EmitContext, Section}; use crate::parse::IndicesToIds; use crate::tombstone_arena::{Id, Tombstone, TombstoneArena}; use crate::{FunctionId, GlobalId, ImportId, Module, Result, ValType}; use anyhow::bail; /// The id of a table. pub type TableId = Id<Table>; ///...
use crate::configuration::FilterConfig; use crate::filter::http::{CacheFilter, RequestState}; use crate::rand::thread_rng::{thread_rng_init_fallible, ThreadRng}; use crate::{debug, info, warn}; use proxy_wasm::{ traits::{Context, HttpContext, RootContext}, types::{ContextType, LogLevel}, }; use threescale::{ ...
use super::Prepare; use image::{DynamicImage, GrayImage, Pixel}; use std::cmp::{max, min}; /// Reduce the image to black/white by calculating local thresholds /// /// The algorithm runs the following steps: /// 1. Divide the image into blocks and count the cumulative grayscale value of all pixels in the block /// 2....
// 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 ...
use crate::prelude::*; use smallvec::SmallVec; use std::{ any::Any, cell::RefCell, fmt::{Debug, Formatter}, rc::Rc, sync::{Arc, Mutex}, }; /// Subscription returns from `Observable.subscribe(Subscriber)` to allow /// unsubscribing. pub trait SubscriptionLike { /// This allows deregistering an stream befor...
use crate::{Client, Error, Result}; use bee_common_ext::packable::Packable; use bee_message::prelude::*; use bee_signing_ext::{ binary::{BIP32Path, Ed25519PrivateKey}, Seed, Signer, }; use std::num::NonZeroU64; const TRANSACTION_ID_LENGTH: usize = 32; /// Builder of send API pub struct SendBuilder<'a> { ...
use std::path::{Path, PathBuf}; #[derive(Clone, Debug)] pub struct Config { pub delimiter: char, pub escape: bool, pub rm_whitespace: bool, pub template_dirs: Vec<PathBuf>, #[doc(hidden)] pub cache_dir: PathBuf, #[doc(hidden)] pub _non_exhaustive: (), } impl Default for Config { fn...
use regex::Regex; use std::borrow::Cow; /// An iterator over "words" in some text. A word is generally a sequence of non-whitespace /// characters bounded by either whitespace characters or the empty string. However, this is not a /// definition and the exact details are unspecified. Rather, the iterator promises to p...
use std::collections::HashMap; use std::fmt; use crate::Locker; use crate::{ exp, CallSnapshot, Exception, ExceptionValue as EV, Expression, Operator, Symbol, Value, }; #[derive(Debug, Clone)] struct ParentEnvironment { namespace: Option<String>, environment: Locker<Environment>, } #[derive(Debug, Clon...
use std::path::{Path, PathBuf}; use eyre::Context; use lsp_types::Diagnostic; use regex::Regex; mod lsp_client; #[derive(structopt::StructOpt)] pub struct Options { #[structopt(parse(from_os_str), default_value = "dada_tests")] dada_path: Vec<PathBuf>, #[structopt(long)] bless: bool, } impl Options...
use alloc::String; use alloc::Vec; use super::Evaluator; use super::ShellDisplay; use super::Traversal; pub struct KernelShell { display: ShellDisplay, initialized: bool, root: Evaluator, complete_options: Vec<String>, path: Vec<String>, control_key_held: bool, printed_count: usize, } impl KernelShell { con...
use cssparser::*; use crate::traits::{Parse, ToCss, PropertyHandler}; use crate::printer::Printer; use crate::values::length::LengthPercentage; use crate::macros::enum_property; use crate::error::{ParserError, PrinterError}; use crate::properties::{Property, PropertyId}; use crate::declaration::DeclarationList; use cra...
use std::collections::HashMap; use std::error::Error; use std::sync::{Arc, Mutex}; use std::thread; use arrayvec::ArrayVec; use bitflags::bitflags; use crate::{arp, buffer::Buffer, ip, packet, raw, util::RuntimeError}; mod frame; pub const ADDR_LEN: usize = 6; pub const ADDR_STR_LEN: usize = 18; pub const HDR_SIZE...
use anyhow::{anyhow, Result}; use chrono::{DateTime, NaiveDate, TimeZone, Utc}; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Copy, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum OrderBy { CreatedAt, UpdatedAt, } pub const SUPPORT_DATETIME_FORMAT: [&str; 2] = ["%Y/%m/%d %H...
// Copyright 2020-2021 The Datafuse Authors. // // SPDX-License-Identifier: Apache-2.0. use std::collections::HashMap; use std::sync::Arc; use common_exception::ErrorCode; use common_infallible::Mutex; use common_planners::Part; use common_planners::Statistics; use common_store_api::AppendResult; use common_store_api:...
// Copyright 2020 The OctoSQL 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 agree...
//! Contains everything that is related to the analog IO functionality. //! //! For information on whitch pins have analog IO capabilities, check [`ADC_MAP`](crate::include::ADC_MAP) //! //! # Examples //! //! ```no_run //! #![no_std] //! #![no_main] //! //! use rustuino::*; //! //! #[entry] //! fn main() -> ! { /...
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use crate::dachshund::graph_base::GraphBase; use crate::dachshund::id_types::NodeId; use crate::dachshund::node::{NodeBase, NodeEdge...
use std::sync::Arc; use std::time::{Duration, Instant}; use actix_web::client::ClientConnector; use actix_web::{client, HttpMessage}; use actix::{Actor, Addr}; use failure::Fail; use futures01::future::Either; use futures01::{Future, IntoFuture, Stream}; use parking_lot::Mutex; use tokio_retry::strategy::{jitter, Ex...
use crate::gdt; use crate::print; use crate::println; use lazy_static::lazy_static; use pic8259::ChainedPics; use spin::Mutex; use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame}; lazy_static! { static ref IDT: InterruptDescriptorTable = { let mut idt = InterruptDescriptorTable::ne...
use anyhow::Result; use async_trait::async_trait; use futures::TryStreamExt; use rust_decimal::Decimal; use std::fmt; use time::OffsetDateTime; use tokio_tasks::Tasks; use xtra::Disconnected; use xtra_productivity::xtra_productivity; pub const QUOTE_INTERVAL_MINUTES: i64 = 1; #[derive(Default)] pub struct Actor { ...
use serde_json::value::Value; use easter::expr::{Expr, ExprListItem}; use easter::obj::DotKey; use easter::id::IdExt; use easter::punc::{Unop, Binop, Assop, Logop}; use unjson::ty::{Object, TyOf}; use unjson::ExtractField; use joker::token::RegExpLiteral; use tag::{Tag, TagOf}; use id::IntoId; use result::Result; use ...
use crate::pid::{Controller, PIDController}; use crate::util; pub trait CurrentOutput { fn set_output_value(&mut self, value: i32); fn enable(&mut self, enable: bool); fn get_max_output_value(&mut self) -> i32; } pub trait CurrentDevice { fn update(&mut self, dt: u32); fn set_current(&mut self, mi...
//! TXT record creation & handling use crate::ffi::{ kDNSServiceErr_NoError, TXTRecordContainsKey, TXTRecordCreate, TXTRecordDeallocate, TXTRecordGetBytesPtr, TXTRecordGetCount, TXTRecordGetLength, TXTRecordGetValuePtr, TXTRecordRef, TXTRecordRemoveValue, TXTRecordSetValue, }; use crate::DNSServiceError; u...
//! [`MatchData#[]`](https://ruby-doc.org/core-2.6.3/MatchData.html#method-i-5B-5D) use artichoke_core::value::Value as ValueLike; use bstr::BStr; use std::convert::TryFrom; use std::mem; use crate::convert::{Convert, RustBackedValue}; use crate::extn::core::exception::{Fatal, IndexError, RubyException, TypeError}; u...