text
stringlengths
3.09k
13.9k
use algebra::fields::{PrimeField, Field}; use r1cs_core::{ConstraintSystem, SynthesisError}; use r1cs_std::{prelude::*}; use crate::hashing::{*, sponge::*, leafhash::*, two_to_one_hash::*}; use crate::algebra::mux::*; // TODO: Make LeafHash and NodeHash traits pub struct MerklePathGadget<F: PrimeField, FG: FieldGadget...
extern crate ransid; use std::collections::{BTreeSet, VecDeque}; use orbclient::{Event, EventOption}; use syscall::error::*; use display::Display; use screen::Screen; pub struct TextScreen { pub console: ransid::Console, pub display: Display, pub changed: BTreeSet<usize>, pub ctrl: bool, pub inp...
use crate::{cell::Cell, maze::Maze}; use pix_engine::prelude::*; use std::collections::{BinaryHeap, HashSet}; #[derive(Debug, Copy, Clone, PartialEq)] pub struct AStarCell { cell: Cell, previous: Option<usize>, g: f64, h: f64, f: f64, } impl AStarCell { fn new(cell: Cell) -> Self { Sel...
#![allow(non_snake_case)] use crate::{co, kernel}; use crate::kernel::decl::{GetLastError, path, WIN32_FIND_DATA, WinResult, WString}; use crate::kernel::privs::bool_to_winresult; use crate::prelude::Handle; impl_handle! { HFINDFILE: "kernel"; /// Handle to a /// [file search](https://docs.microsoft.com/...
use num_bigint::{BigInt, BigUint, RandBigInt, Sign}; use num_traits::identities::{One, Zero}; use rand::{self, thread_rng}; use crate::math; use crate::sha1; pub struct DSA { pub public_key: BigUint, private_key: BigUint, g: BigUint, } impl DSA { pub fn new(generator: Option<BigUint>) -> Self { ...
// Copyright 2021 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot 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 late...
use crate::{ client::Client, client::ClientConfig, meta::{APIVersion, Kind, List, ListOptions, ObjectMeta, TypeMeta}, worker::{Worker, WorkerPhase}, }; use anyhow::Error; use serde::{Deserialize, Serialize}; use serde_with::*; use std::collections::HashMap; #[skip_serializing_none] #[derive(Serialize, ...
use alloc::{vec, vec::Vec}; use core::{ cmp::Ordering, fmt, hash::Hash, num::{NonZeroU128, NonZeroUsize}, }; use necsim_core::cogs::{MathsCore, RngCore, RngSampler}; use necsim_core_bond::{NonNegativeF64, PositiveF64}; #[cfg(test)] mod tests; #[derive(Clone, Debug, PartialEq, Eq)] struct RejectionSam...
use crate::prism_autoloader; use std::collections::HashSet; use super::knots_objects::KnotsObject; use super::utils::{get_alpha_numeral, get_roman_numeral}; #[derive(Clone)] pub struct Title { pub level: u8, pub name: String, pub anchor: String, } /// A Builder used to generate HTML tags from Knots objec...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use futures::{ future::Future, ready, sink::Sink, task::{Context, Poll}, }; use std::pin::Pin; /// Future for the [`buffered_send`](super::NetworkSinkExt::buffered_send) method. #[derive(Debug)] #[must_use = "futures d...
use bevy::prelude::*; use serde::{Deserialize, Serialize}; use spectre_time::*; pub mod prelude { pub use crate::*; } pub const HEALTH_LERP_RATE: f32 = 100.; // health per second /// Contains a description of a stat buff /// set expiry to a game time to automatically remove at that time. /// set expiry to 0 to n...
use failure::Error; use futures::channel::mpsc; use futures::stream; use futures::FutureExt; use futures_util::StreamExt; use futures_util::TryStreamExt; use std::net::IpAddr; use std::str::FromStr; use tokio_postgres::types::ToSql; use tokio_postgres::{AsyncMessage, NoTls, Row}; /// The schema of the database. const ...
use chrono::{DateTime, FixedOffset, TimeZone}; use serenity::builder::CreateEmbed; use serenity::framework::standard::CommandResult; use serenity::model::channel::Embed; use serenity::model::id::GuildId; use serenity::model::misc::Mention; use serenity::model::prelude::{Message, UserId}; use serenity::prelude::{Context...
/*! * A composable structure is a function from a document context to a piece of a pretty::Doc */ #[macro_use] pub mod macros; #[macro_use] pub mod frag; #[macro_use] pub mod docs; #[macro_use] pub mod list; #[macro_use] mod join; pub mod render_context; mod renderer; mod subdoc; use derive_new::new; use std::...
use crate::{midi::MidiNote, set::IntervalSet, Interval, Pitch}; use core::{ fmt::{self, Write}, iter, }; mod builder; pub use builder::Builder; pub struct Chord { root: Pitch, builder: Builder, } impl Chord { pub fn major() -> Builder { Self::builder() .root() .int...
/* * The Jira Cloud platform REST API * * Jira Cloud platform REST API documentation * * The version of the OpenAPI document: 1001.0.0-SNAPSHOT * Contact: <EMAIL> * Generated by: https://openapi-generator.tech */ #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct JsonNode { #[serde(renam...
use std::io::{self, Read, Write}; use bellman::{self, SynthesisError}; use pairing::{bls12_381, bn256, Engine}; use serde::{Deserialize, Serialize}; use crate::{ core::cs::Circuit, core::field::Field, core::osrng::OsRng, helpers::groth16::Groth16CS, helpers::groth16::{G1PointData, G2PointData}, };...
use error::{ DecodeError, DecodeErrorKind, }; use tag::AnyTag; #[derive(Debug, Clone, Copy, PartialEq)] pub enum PhotometricInterpretation { WhiteIsZero, BlackIsZero, RGB, Palette, TransparencyMask, CMYK, YCbCr, CIELab, } impl PhotometricInterpretation { pub fn from_u16(n:...
use day_5::computer::Computer; use log::debug; use std::sync::mpsc; use std::time::Duration; pub fn find_largest_output<Phases>( intcode: Vec<isize>, phase_settings: Phases, ) -> (Vec<isize>, isize) where Phases: Iterator<Item = Vec<isize>>, { phase_settings .map(|phases| { debug!("...
use crate::diaries::DiaryId; use crate::quests::QuestId; use crate::skills::Skill; use crate::{Level, Xp}; #[derive(Debug, Clone)] pub struct CombatLevel(i32); #[derive(Debug, Clone)] pub struct Account { pub display_name: String, pub skills: Skills, pub completed_quests: Vec<QuestId>, pub completed_d...
//! Use on `impl Stream`s via the [`TryStreamAndThenExt`] trait. //! //! Why is this necessary? Consider the example below. We have a `Stream` from `try_unfold`, but //! this stream is splitting some larger stream into sub-streams, with each sub-stream //! represented by a channel. If we simply called `and_then`, that ...
//! ExtendedClass B Position Report (type 19) use super::navigation::*; use super::parsers::*; use super::types::AssignedMode; use super::types::Dte; use super::types::EpfdType; use super::AisMessageType; use crate::errors::Result; use crate::messages::types::ShipType; use nom::bits::{bits, complete::take as take_bits}...
use std::error::Error; use std::path::PathBuf; use std::process; use structopt::StructOpt; /// Calculate digests for given input data mod calculate; /// Display output nicely in the terminal mod display; /// Collect candidate hashes based on options and match them against a calculated hash mod verify; #[derive(Stru...
//! Instruction types #![allow(clippy::too_many_arguments)] use num_derive::{FromPrimitive, ToPrimitive}; use num_traits::{FromPrimitive, ToPrimitive}; use solana_program::{ instruction::{AccountMeta, Instruction}, program_error::ProgramError, program_pack::Pack, pubkey::Pubkey, }; use std::convert::T...
use crate::Msg; use anyhow::{Context, Error}; use arcs::{ components::{Dimension, DrawingObject, Geometry, Layer, Name, PointStyle}, primitives::Point, render::{Renderer, Viewport}, Vector, }; use js_sys::Function; use kurbo::Size; use piet::Color; use piet_web::WebRenderContext; use specs::prelude::*; ...
use chrono::DateTime; use chrono::SecondsFormat; use chrono::Utc; use pest::Parser; include!(concat!(env!("OUT_DIR"), "/format_cwl_log_event_parser.rs")); #[derive(thiserror::Error, Debug)] pub enum FormatCwlLogEventError { #[error(transparent)] CompileError(#[from] pest::error::Error<Rule>), #[error("un...
use async_trait::async_trait; use regex::Regex; use serde::{Deserialize, Serialize}; use crate::{column_keywords, multi_world, Database, RB}; pub struct Sqlite; #[async_trait] impl Database for Sqlite { async fn tables(&self, table_names: &[&str]) -> Vec<crate::Table> { let ts = tables(table_names).await...
#![recursion_limit = "1024"] use futures::select; use futures::FutureExt; use log::{error, info, trace}; use notify_rust::NotificationHandle; use signal_hook::SIGWINCH; use smol::io::AsyncReadExt; use smol::net::unix::UnixStream; use std::error::Error; use std::process::exit; use termion::raw::IntoRawMode; use ui::inpu...
use crate::{ ir::{self, Id, RRC}, utils::Keyable, }; use petgraph::{ algo, graph::{DiGraph, NodeIndex}, visit::EdgeRef, Direction::{Incoming, Outgoing}, }; use std::{collections::HashMap, rc::Rc}; type Node = RRC<ir::Port>; type Edge = (); /// A petgraph::DiGraph where ports are the nodes and ...
use std::fmt::Display; use std::path::Path; /// Enum of the different ECMAScript standard versions. /// The versions are ordered in increasing order; The newest version comes last. /// /// Defaults to the latest stable ECMAScript standard. #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] pub enum Language...
//! scheduler is a simple round robin scheduler for threads. use crate::multitasking::thread::{ThreadId, ThreadState, SCHEDULER, THREADS}; use crate::multitasking::{cpu_local, thread}; use alloc::collections::VecDeque; use alloc::sync::Arc; use core::mem; use core::sync::atomic::{AtomicBool, Ordering}; use x86_64::ins...
use crate::operator::InstructionContext; use crate::operator::InstructionReplacement; use crate::operator::OperatorRegistry; use crate::wasmmodule::CallbackType; use crate::{config::Config, policy::MutationPolicy, wasmmodule::WasmModule}; use anyhow::Result; use atomic_counter::AtomicCounter; use atomic_counter::Relaxe...
/*! IntegerScaling by <NAME> | http://tanalin.com/en/projects/integer-scaling/ */ #![allow(non_snake_case)] pub struct Ratios { pub x : u32, pub y : u32 } pub struct Size { pub width : u32, pub height : u32 } /// Calculates an integer scaling ratio common for X/Y axes (square pixels). pub fn calculateRatio(are...
use crate::{ error_response::handle_bad_gateway, http_client::StrategyNotifyHttpConnector, server::Scheme, utils::unwrap_result, }; use async_trait::async_trait; use gethostname::gethostname; use hyper::{header::HeaderValue, Body, Client, Request, Response, Uri}; use std::net::SocketAddr; pub mod authentication; pub...
use crate::syntax::{ByteIndex, ByteRange, WhitespaceIndex}; use crate::util::indexed_vec::Delta; use std::cmp::Ordering; use std::fmt::{Display, Formatter, Result}; use std::str; use std::u32; use string_interner::backend::StringBackend; use string_interner::StringInterner; /// /// Debug data about the original source...
//! A basic MT protocol frame decoder use crate::message::{Frame, FrameError, PayloadLength}; #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, err_derive::Error)] pub enum Error { #[error(display = "Not enough bytes in the decoder buffer to store the frame")] InsufficientBufferSize, #[e...
#![no_main] use libfuzzer_sys::fuzz_target; // use libfuzzer_sys::arbitrary::Arbitrary; use utils::tempfile::TempFile; use rate_limiter::{RateLimiter, TokenType}; use vm_memory::{Bytes, GuestMemoryMmap, GuestMemory, GuestAddress}; use devices::virtio::block::{Block, request::*, Error, CONFIG_SPACE_SIZE, QUEUE_SIZES...
mod animation; mod geometry; mod model; mod object; mod properties; pub use self::animation::{AnimationCurve}; pub use self::geometry::{Geometry}; pub use self::model::{Model, ModelProperties}; pub use self::object::{Object, ObjectType}; pub use self::properties::{Property, Properties}; use std::collections::{HashMap...
#[macro_use] extern crate lazy_static; use std::{ ffi::OsString, fs::{self, Permissions}, os::unix::prelude::PermissionsExt, path::PathBuf, }; use database::Database; use filetime::FileTime; use git::Repository; use git2::{Commit, ObjectType, TreeEntry, TreeWalkResult}; use structopt::StructOpt; use t...
use std::mem::{size_of, zeroed}; use std::ptr::null_mut; use winapi::shared::minwindef::{DWORD, FALSE, LPCVOID, LPVOID, TRUE}; use winapi::um::handleapi::INVALID_HANDLE_VALUE; use winapi::um::memoryapi::{ReadProcessMemory, WriteProcessMemory}; use winapi::um::processthreadsapi::OpenProcess; use winapi::um::tlhelp32::{...
// Copyright © 2021 // Author: <NAME> <<EMAIL>> // SPDX-License-Identifier: MIT #![cfg_attr( target_arch = "spirv", no_std, feature(register_attr, lang_items), register_attr(spirv) )] // HACK(eddyb) can't easily see warnings otherwise from `spirv-builder` builds. #![deny(warnings)] #[cfg(not(target_arc...
use super::byte_prefix_tree::BytePrefixTree; use crate::error::{Error, Result}; use chargrid_input::{Input, KeyboardInput, MouseButton, ScrollDirection}; use term::terminfo::parm::{self, Param, Variables}; use term::terminfo::TermInfo; // XXX this might not be portable const ESCAPE: &[u8] = &[27]; const ENABLE_MOUSE_R...
#[derive(Clone, Debug)] struct Bitstream { bits: Vec<u8>, idx: usize, consumed: usize, valid_bits: u8, } impl Bitstream { pub fn new(bits: Vec<u8>) -> Self { Self { bits, idx: 0, consumed: 0, valid_bits: 8 } } pub fn get(&mut self, n: u8) -> u8 { use std::cmp::Ordering; ...
//! Get socket information and statistics. //! //! **[Crates.io](https://crates.io/crates/socketstat) │ [Repo](https://github.com/alecmocatta/socketstat)** //! //! Currently works on macOS only, PRs for other platforms welcome! //! //! # Example //! //! ``` //! #[cfg(unix)] //! use std::os::unix::io::AsRawFd; //! #[cfg...
use byteorder::{ReadBytesExt, LittleEndian}; use rwinstructs::timestamp::{DosDateTime}; use errors::{ShellItemError}; use std::io::Read; use std::io::{Seek,SeekFrom}; use std::fmt; use serde::{ser}; use shellitem::{ClassType}; use extension_blocks::{ExtensionBlock}; use utils; pub static mut FLAGS_AS_INT: bool = false...
use scsi::commands::{Command, CommandBlockWrapper, Direction}; use error::{ErrorCause, ScsiError}; use traits::{BufferPullable, BufferPushable}; use byteorder::{ByteOrder, BE}; /// A command to read bytes from the block device. /// /// The 10 in Read10 (and Write10) stands for the fact that the command is exactly //...
///! Solution iterator for BDDBase use std::collections::HashSet; use {vhl::{HiLo, HiLoBase, Walkable}}; use crate::{vid::VID, nid::{NID,I,O}, bdd::BDDBase, reg::Reg}; use crate::cur::{Cursor, CursorPlan}; /// helpers for solution cursor impl HiLoBase for BDDBase { fn get_hilo(&self, n:NID)->Option<HiLo> { le...
use std::env; use actix_web::HttpServer; use meilisearch_http::{create_app, setup_meilisearch, Opt}; use meilisearch_lib::MeiliSearch; use structopt::StructOpt; #[cfg(all(not(debug_assertions), feature = "analytics"))] use meilisearch_http::analytics; #[cfg(target_os = "linux")] #[global_allocator] static ALLOC: tik...
// 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 super::*; pub struct Parser<'l> { lexer: Lexer<'l>, peek: Result<Token, Error>, } impl<'l> Parser<'l> { pub fn new(input: &'l str) -> Parser<'l> { let mut lexer = Lexer::new(input); let peek = lexer.next_token(); Parser { lexer, peek } } fn peek(&mut self) -> Result<&T...
// // Copyright 2018-2019 <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 w...
/// Outpoint pub mod outpoint; /// Transaction input pub mod input; /// Transaction output pub mod output; use std::convert::TryFrom; pub use outpoint::OutPoint; pub use input::Input; pub use output::Output; use super::var_int::VarInt; use super::error::{Error, Result}; /// Bitcoin Cash transaction format #[derive(De...
//! # Global Environment Records //! //! A global Environment Record is used to represent the outer most scope that is shared by all //! of the ECMAScript Script elements that are processed in a common realm. //! A global Environment Record provides the bindings for built-in globals (clause 18), //! properties of the g...
// 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 core::{fmt::Debug, marker::PhantomData, slice}; use math::{FieldElement, StarkField}; use sha3::Digest; use utils::{ByteReader, Deseri...
use std::path::Path; use crate::parser::ast; use proc_macro2::{Span, TokenStream}; use quote::quote; use syn::{Data, Generics, Ident}; pub fn generate( name: &Ident, data: &Data, generics: &Generics, path: Option<&Path>, ast: ast::Ast<'_>, ) -> TokenStream { // Recompile if template changes ...
// Copyright (c) 2021 <NAME>. // Use of this source code is governed by the MIT // license that can be found in the LICENSE file. use chrono::Utc; use gain::origin; use gain::stream::buf::{Read as _, ReadStream}; use gain::stream::{Close as _, Write as _, WriteOnlyStream, WriteStream}; use gain::task::block_on; use ga...
use std::error::Error; use std::fs; use std::fs::File; use std::io::Write; use std::path::PathBuf; use log::warn; use serde::{Deserialize, Serialize}; use std::path::Path; use crate::config::{EngineOptions, Resolution, ScalingQuality, VanillaVersion}; use crate::fs::resolve_existing_components; use crate::json; #[de...
use crate::vector2::*; /// 3x3 Matrix mainly for transforming 2D images, but can be used for anything. #[derive(Copy, Clone, Debug)] pub struct Matrix3 { m: [[f32; 3]; 3], } impl Matrix3 { /// Returns an identity matrix. It's basically like a normalized vector, where the 'magnitudes' of each value are 1.0. /// Th...
pub type c_long = i64; pub type c_ulong = u64; pub type regoff_t = ::c_long; s! { pub struct statfs64 { pub f_type: ::c_ulong, pub f_bsize: ::c_ulong, pub f_blocks: ::fsblkcnt_t, pub f_bfree: ::fsblkcnt_t, pub f_bavail: ::fsblkcnt_t, pub f_files: ::fsfilcnt_t, ...
use crate::node::OscRender; use crate::osc::{OscMessage, OscPacket}; use crate::root::{NodeHandle, NodeWrapper, RootInner}; use std::collections::HashSet; use std::io::ErrorKind; use std::net::{SocketAddr, ToSocketAddrs, UdpSocket}; use std::sync::mpsc::{sync_channel, SyncSender, TryRecvError}; use std::sync::Arc; use...
/* Copyright (C) 2021-present by <NAME> 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 rights to use, copy, modify, merge, publish, distribut...
use crate::priv_prelude::*; use crate::spawn_complete; /// A set of clients that can be attached to a hub node. pub trait HubClients { /// The output of the nodes attached to the hub. type Output: Send + 'static; /// Build the set of nodes. fn build( self, handle: &NetworkHandle, ...
// 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 std::collections::HashMap; use lazy_static::lazy_static; use regex::Regex; use url::Url; use crate::warn; use super::response::{Response, ResponseData}; const AUTH_CHUNK_SIZE: usize = 3; ///A Downloader to download web content pub struct Downloader { client: reqwest::blocking::Client, tries: usize, ...
use bytes::Bytes; use reqwest::{ blocking::{Client, RequestBuilder}, Url, }; use std::path::PathBuf; use structopt::StructOpt; use thiserror::Error; #[derive(StructOpt)] pub struct RestArgs { /// node API address. Must always have `http://` or `https://` prefix. /// E.g. `-h http://127.0.0.1`, `--host ...
//! Framebuffer console display driver for ARM64 use alloc::vec::Vec; use core::fmt; use core::marker::PhantomData; use lazy_static::lazy_static; use log::*; use spin::Mutex; use crate::util::escape_parser::{CharacterAttribute, EscapeParser}; use super::fb::{ColorConfig, ColorDepth::*, FramebufferInfo, FRAME_BUFFER...
//! Parse and compile crontab syntax, not needed for on-chain code. use std::str::FromStr; use crate::bitset::{BitSetIndex, NonEmptyBitSet}; use crate::cron::CronCompiled; #[derive(Clone, PartialEq, Debug)] pub enum CronItem { Range { /// inclusive start: BitSetIndex, /// inclusive ...
use gccjit::{ToRValue, Type}; use rustc_codegen_ssa::traits::{AbiBuilderMethods, BaseTypeMethods}; use rustc_middle::bug; use rustc_middle::ty::Ty; use rustc_target::abi::call::{CastTarget, FnAbi, PassMode, Reg, RegKind}; use crate::builder::Builder; use crate::context::CodegenCx; use crate::intrinsic::ArgAbiExt; use ...
// 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. #![deny(warnings)] use { failure, json5, serde_json, serde_json::Value, std::borrow::Cow, std::error, std::fmt, std::fs::File, ...
use fj_math::{Point, Scalar, Vector}; use crate::{ geometry::{Circle, Curve, Line, Surface}, shape::{Handle, Shape, ValidationResult}, }; use super::{Cycle, Edge, Face, Vertex}; /// API for building a [`Vertex`] #[must_use] pub struct VertexBuilder<'r> { shape: &'r mut Shape, } impl<'r> VertexBuilder<'r...
// Copyright (c) 2019 Intel Corporation // // SPDX-License-Identifier: Apache-2.0 // use slog::{BorrowedKV, Drain, Key, OwnedKV, OwnedKVList, Record, KV}; use std::collections::HashMap; use std::io; use std::io::Write; use std::process; use std::result; use std::sync::Mutex; // XXX: 'writer' param used to make testin...
use crate::{color::Color, unit::*, values as val, St, StyleValues, UpdateStyleValues}; use derive_rich::Rich; use savory::prelude::DeclarativeConfig; /// ``` /// use savory_style::{values as val, Style, Color, unit::em}; /// /// Style::default() /// .and_background(|conf| { /// conf.image("/bg/fullpage.png...
// TODO: nomenclature: "ruleset" instead extern crate toml; use failure::Error; use std::collections::HashMap; use std::fmt; use std::fs; use std::io::prelude::*; use std::path::Path; use strfmt::strfmt; use ordermap::OrderMap; #[derive(Copy, Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = ...
// Copyright Materialize, Inc. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License...
// 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 ...
use anyhow::Error; use proc_macro2::{TokenStream, TokenTree}; use quote::ToTokens; use std::collections::HashMap; use std::path::PathBuf; pub type Results = HashMap<String, Message>; #[derive(Debug, Clone, PartialEq, Eq)] pub struct Location { pub file: std::path::PathBuf, pub line: usize, } #[derive(Debug, ...
use crate::app::check; use crate::core::execute; use crate::core::state::{State, UnOptState}; use crate::util::error::Error; use crate::util::option::HyeongOption; use crate::util::{io, option, util}; use clap::App; use std::collections::HashSet; use std::io::{stdin, Write}; use std::process; use std::sync::atomic::{At...
#![allow(non_camel_case_types)] use heapless_bytes::{ consts, Unsigned as _ }; // can be 8, 16, 32, 64 or 512 #[cfg(feature = "highspeed-usb")] pub type PACKET_SIZE_TYPE = consts::U512; #[cfg(not(feature = "highspeed-usb"))] pub type PACKET_SIZE_TYPE = consts::U64; pub const PACKET_SIZE: usize = PACKET_SIZE_T...
// Copyright Pravega Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the ...
//! # authentic //! //! Handle authentication of HTTP calls. //! //! Authentication protocols can require specific workflows, such as making third-party calls to refresh a token or performing an initial request to get challenge information. //! //! Using a fixed code structure, `authentic` can perform the necessary int...
#![cfg_attr(not(feature = "std"), no_std)] use frame_support::codec::{Decode, Encode}; use frame_support::{ decl_error, decl_event, decl_module, decl_storage, ensure, weights::Pays, StorageMap, }; use frame_system::ensure_root; use frame_system::ensure_signed; use sp_std::vec::Vec; /// Configure the pallet by spec...
// Copyright 2020-2021 <NAME> // SPDX-License-Identifier: Apache-2.0 use core::convert::TryFrom; use core::convert::TryInto; use core::fmt::Debug; use core::fmt::Display; use core::fmt::Formatter; use core::fmt::Result as FmtResult; use core::ops::Deref; use identity_core::common::BitSet; use identity_core::convert::T...
// 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. // All files in the project carrying such notice may not be copied, modified, or distributed // except according ...
use super::*; /// Parametric surface pub trait ParametricSurface: Clone { /// The surface is in the space of `Self::Point`. type Point; /// The derivation vector of the curve. type Vector; /// Substitutes the parameter `(u, v)`. fn subs(&self, u: f64, v: f64) -> Self::Point; /// Returns the...
use crate::check::TokenChecker; use crate::error::ServiceError; use actix_service::Service; use actix_service::Transform; use actix_web::dev::*; use actix_web::Error; use biscuit::ValidationOptions; use futures::future; use futures::future::LocalBoxFuture; use futures::future::Ready; use futures::task::Context; use fut...
use std::pin::Pin; use ballista::serde::decode_protobuf; use ballista::{plan, BALLISTA_VERSION}; use datafusion::execution::context::ExecutionContext; use flight::{ flight_service_server::FlightService, flight_service_server::FlightServiceServer, Action, ActionType, Criteria, Empty, FlightData, FlightDescripto...
use crate::{collector::Input, uri::Uri}; use anyhow::anyhow; use serde::{Serialize, Serializer}; use std::{collections::HashSet, convert::TryFrom, fmt::Display}; #[derive(Debug, PartialEq, Eq, Hash, Clone)] pub struct Request { pub uri: Uri, pub source: Input, } impl Request { pub fn new(uri: Uri, source:...
use super::{Error, WalletController}; use crate::{ cli::{ config::{ConfigManager, WalletState}, Connection, }, FragmentSender, FragmentVerifier, Wallet, }; use bech32::{u5, FromBase32}; use chain_crypto::{Ed25519Extended, SecretKey}; use chain_impl_mockchain::{ accounting::account::spend...
/* * Copyright 2018-2019 TON DEV SOLUTIONS LTD. * * Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use * this file except in compliance with the License. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS I...
// Rupee - Rust Image Service // Copyright (C) 2020 <NAME> // Licensed under the Apache License, Version 2.0, or the MIT License use uuid::Uuid; use crate::storage::meta::{MetaStorageError, MetaStorage}; use crate::domain::meta::BlobMeta; use crate::storage::blob::{BlobRef, BlobStorage, BlobStorageError}; use std::any:...
use std::collections::HashMap; use std::fmt; use std::io; use std::net::{IpAddr, SocketAddr}; use std::sync::Arc; use futures::StreamExt; use ipnetwork::IpNetwork; use log::{debug, trace, warn}; use net2::TcpBuilder; use tokio::sync::mpsc; use tokio::time::{timeout, Duration}; use tokio::{ self, net::{TcpListe...
use std::collections::HashMap; use std::fmt::{Display, Formatter, Result}; use svd_parser::{Cluster, Device, Peripheral, Register, RegisterCluster, RegisterProperties}; use crate::cluster::_Cluster; use crate::overrides::{DeviceOverrides, PeripheralOverrides}; use crate::register::_Register; use crate::utils::{array_...
use std::char; // until MSRV is at least 1.52 use std::ops::{Index, RangeFrom}; use proc_macro::Span; use crate::Error; pub(crate) fn parse(token: &proc_macro::Literal) -> Result<(Span, Vec<u8>), Error> { let span = token.span(); let repr = token.to_string(); match repr.as_bytes() { [b'"', ..] =...
#![no_std] //! This crate exposes functionality that eases the procedure of tracing //! embedded applications written using RTIC. A single feature-set is //! available: //! //! - `tracing`: which offers setup functions that configures related //! peripherals for RTIC task tracing, and a `#[trace]` macro for //! sof...
//! Configuration api metadata. use crate::conf::requests::{FetchRequest, WatchRequest}; use serde::{Deserialize, Serialize}; use std::{ borrow::Cow, fmt::{self, Display}, }; use typed_builder::TypedBuilder; pub(crate) const UNINITIALIZED_NOTIFICATION_ID: i32 = -1; /// Notification for request and response, ...
use na::{DVectorSliceMut, Isometry3, RealField, Unit, Vector3}; use crate::joint::{Joint, PrismaticJoint, RevoluteJoint}; use crate::solver::{ConstraintSet, GenericNonlinearConstraint, IntegrationParameters}; use crate::object::{Multibody, MultibodyLink}; use crate::math::{JacobianSliceMut, Velocity}; /// A joint tha...
//! Expression Matching Code, to see if an Expr //! matches some syntax. use crate::common::{Expr, LambdaArgType, Var}; #[derive(Debug, Hash, Clone, PartialEq, Eq)] pub enum Matching { Quote(Expr), Apply(Expr, Expr), Lambda(LambdaArgType, Expr), If(Expr, Expr, Expr), Let(Vec<Var>, Vec<Expr>, Expr), ...
// Copyright 2018 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. #![feature(async_await, await_macro)] #![deny(warnings)] use carnelian::{Canvas, Color, Coord, IntSize, PixelSink, Point, Rect, Size}; use failure::{bail,...
use std::io; use std::mem; #[inline(always)] const fn num_bits<T>() -> usize { mem::size_of::<T>() * 8 } #[inline(always)] fn ulog2(v: u32) -> u32 { num_bits::<u32>() as u32 - 1 - v.leading_zeros() } #[inline(always)] fn inv_recenter(r: u32, v: u32) -> u32 { if v > (r << 1) { v } else if (v &...
use crate::connection::RequestConnection; use crate::errors::{ConnectError, ReplyOrIdError}; use crate::protocol::xc_misc::{self, ConnectionExt as _, GetXIDRangeReply}; /// An allocator for X11 IDs. /// /// This struct handles the client-side generation of X11 IDs. The ID allocation is based on a /// range of IDs that...