text stringlengths 3.35k 22.8k |
|---|
//! Interner
//!
//! Maps each identifier or literal (excluding strings) to a unique ID which
//! can be used for quick comparison or for retrieving the original spelling.
use std::mem;
use crate::basic::com::Range;
use super::{
JaggedArray, JaggedArraySnapshot, JaggedHashMap, JaggedHashMapSnapshot
};
/// Intern... |
use anyhow::{Context, Result};
use prusst::util::VolatileCell;
use prusst::{Channel, Evtout, EvtoutIrq, Host, IntcConfig, Pruss, Sysevt};
use std::os::unix::io::{AsRawFd, RawFd};
use rkyv::{Archive, Deserialize, Serialize};
use std::fs::File;
const MOTORS_FW: &str = "/lib/firmware/motor.bin";
const PID_FW: &str = "/... |
// Copyright 2021 Parity Technologies (UK) Ltd.
// This file is part of Parity Bridges Common.
// Parity Bridges Common 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
//... |
//! Miscellaneous functions that don't fit in any other (rust code) module.
use crate::{early_logging::KConsole, IGNITED_CONFIG, IGNITED_TARGET_ROOT_PATH, PROGRAM_NAME};
use cstr::cstr;
use nix::{
errno::Errno,
libc::{dev_t, mode_t, stat as FileStat, S_IFDIR, S_IFMT},
sys::{
memfd::{memfd_create, M... |
use crossterm::{TerminalInput, TerminalCursor, Crossterm, Terminal, ClearType, RawScreen, KeyEvent, InputEvent, ObjectStyle, Attribute};
use std::io::{stdout, Write};
use std::cmp::{max, min};
use crate::terminal_helper::BoxSymbols::{*};
pub struct ListItem {
pub text: String,
pub selectable: bool,
}
pub stru... |
// Copyright (c) 2019 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use crate::ns;
use crate::pubsub::PubSubPayload;
use crate::util::error::Er... |
use crate::settings::Font;
use super::SharedOwnership;
/// The kind of text that the font is going to be used for.
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum FontKind {
/// The font is going to be used for the timer.
Timer,
/// The font is going to be used for times.
Times,
/// The font is goi... |
use crate::record::GcPcSaftRecord;
use feos_core::joback::JobackRecord;
use feos_core::parameter::{
BinaryRecord, ChemicalRecord, IdentifierOption, ParameterError, SegmentRecord,
};
use indexmap::{IndexMap, IndexSet};
use ndarray::{Array1, Array2};
use num_dual::DualNum;
use petgraph::dot::{Config, Dot};
use petgra... |
use std::{
ffi::c_void,
fmt,
io::{Cursor, Read, Write},
mem::size_of,
mem::transmute,
os::unix::io::RawFd,
slice,
};
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use crate::{Binder, BinderFlatObject, BinderTransactionData, BinderType, Error, Parcelable};
const STRICT_MODE_P... |
extern crate futures;
extern crate hyper;
extern crate memmap;
extern crate mime_guess;
extern crate deflate;
extern crate unicase;
use std::path;
use std::fs;
use std::io;
use std::time;
use unicase::Ascii;
use deflate::deflate_bytes;
use memmap::Mmap;
use futures::future::FutureResult;
use hyper::se... |
//! Downloading utility for pulling files from AppDynamics.
//!
//! This uses their officially documented method for downloading files through
//! their authentication, but in a more automated fashion for use in environments
//! such as CI builds and Docker builds.
//!
//! The documentation was located at the following... |
//! Various utility functions and definitions.
use mediawiki_parser::*;
// re-export common util
use crate::meta::MediaMeta;
use crate::settings::Settings;
use crate::TargetType;
pub use mwparser_utils::{
extract_plain_text, filename_to_make, path_methods, CachedTexChecker, TexChecker,
};
use serde_json;
use std::... |
//! Dungeon object.
use crate::actor::*;
use crate::console::DrawConsole;
use crate::coord::Coord;
use crate::defs::{gameratio_max, GameRatio};
use crate::error::GameError;
use crate::game_data::GameData;
use crate::generate::{gen_dungeon, gen_dungeon_list};
use crate::item::{Item, ItemStack};
use crate::object::Objec... |
// Copyright 2020 <NAME>
// SPDX-License-Identifier: Apache-2.0
use crate::{
config::SnapshotConfig, download::download_snapshot_file, error::Error, header::SnapshotHeader, info::SnapshotInfo,
kind::Kind, milestone_diff::MilestoneDiff, storage::StorageBackend,
};
use bee_common::packable::Packable;
use bee_me... |
//! In-memory index to track the tenant files on the remote strorage, mitigating the storage format differences between the local and remote files.
//! Able to restore itself from the storage archive data and reconstruct archive indices on demand.
//!
//! The index is intended to be portable, so deliberately does not s... |
use std::convert::TryFrom;
use bytes::Bytes;
use prost::Message;
use crate::{
codec::{
primitive::{Hash, UserAddress},
CodecError, ProtocolCodecSync,
},
field, impl_default_bytes_codec_for,
types::primitive as protocol_primitive,
types::Bloom,
ProtocolError, ProtocolResult,
};
... |
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use js_sys::Math;
use std::cell::RefCell;
use std::rc::Rc;
use web_sys::{Element, Event, Node};
const ADJECTIVES_LEN: usize = 25;
const ADJECTIVES_LEN_F64: f64 = ADJECTIVES_LEN as f64;
const ADJECTIVES: [&str; ADJECTIVES_LEN] = [
"pretty",
"large",
"b... |
use super::*;
use crate::{AnalysisDomain, GenKill, GenKillAnalysis};
use rustc_middle::mir::visit::Visitor;
use rustc_middle::mir::*;
use rustc_middle::ty::{ParamEnv, TyCtxt};
use rustc_span::DUMMY_SP;
pub type MaybeMutBorrowedLocals<'mir, 'tcx> = MaybeBorrowedLocals<MutBorrow<'mir, 'tcx>>;
/// A dataflow analysis t... |
//
// Copyright 2021 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 2020 ZomboDB, LLC <<EMAIL>>. All rights reserved. Use of this source code is
// governed by the MIT license that can be found in the LICENSE file.
#[macro_use]
extern crate clap;
mod commands;
use crate::commands::connect::connect_psql;
use crate::commands::get::get_property;
use crate::commands::init::... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
#![allow(missing_docs)]
use crate::fmt;
use std::collections::HashMap;
use std::str;
use std::vec::Vec;
#[rustfmt::skip]
mod scanner_generated;
use scanner_generated::scan;
mod token;
pub use token::TokenType;
#[cfg(test)]
mod tests;
pub struct Scanner {
data: Vec<u8>,
ps: i32,
p: i32,
pe: i32,
... |
/*
* Copyright 2019 The Starlark in Rust Authors.
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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/lic... |
use std::u32;
use crate::character_definition::{CategoryId, CharacterDefinitions};
use crate::connection::ConnectionCostMatrix;
use crate::prefix_dict::PrefixDict;
use crate::unknown_dictionary::UnknownDictionary;
use crate::word_entry::{WordEntry, WordId};
#[derive(Clone, Debug)]
pub struct Penalty {
kanji_penal... |
// Copyright 2020 <NAME>. All rights reserved.
// Copyright (C) 2020 Alibaba Cloud. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
use std::any::Any;
use std::collections::HashMap;
use std::ffi::{OsStr, OsString};
use std::io::Result;
use std::os::unix::ffi::OsStrExt;
use std::sync::Arc;
use fuse_back... |
use rand;
use num_bigint::{BigUint, RandBigInt};
use num_traits::{One, Num};
use crate::{Result, ConstraintSystem, Variables, Witness, StatementBuilder, Sink, WorkspaceSink};
use std::path::Path;
use rand::Rng;
/// Will generate a constraint system as a system of quadratic equations.
/// SUM_i ( SUM_j ( lambda_{i,j} ... |
use nom::IResult;
use typeahead::Parse;
#[derive(Serialize, Deserialize, PartialOrd, Ord, Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum Key {
Backspace,
Left,
Right,
Up,
Down,
Home,
End,
PageUp,
PageDown,
Delete,
Insert,
/// Function keys.
F(u8),
/// Normal ... |
use bevy_ecs_tilemap::prelude::*;
use std::{collections::HashMap, io::BufReader};
use bevy::reflect::TypeUuid;
use bevy::{
asset::{AssetLoader, AssetPath, BoxedFuture, LoadContext, LoadedAsset},
prelude::*,
};
#[derive(Default)]
pub struct TiledMapPlugin;
impl Plugin for TiledMapPlugin {
fn build(&self, ... |
use std::collections::{HashMap, HashSet};
use std::fs::File;
use std::hash::{BuildHasherDefault, Hash, Hasher};
use std::path::PathBuf;
use std::time::{Duration, SystemTime};
use atomicwrites::{AtomicFile, OverwriteBehavior};
use serde::{Deserialize, Serialize};
use serde_json;
use thiserror::Error;
use crate::feed;
... |
// -*- mode: rust; -*-
//
// This file is part of `fancy-garbling`.
// Copyright © 2019 Galois, Inc.
// See LICENSE for licensing information.
//! `Informer` runs a fancy computation and learns information from it.
use crate::fancy::{Fancy, FancyInput, FancyReveal, HasModulus};
use std::collections::{HashMap, HashSet... |
use std::{
io::{Error as IoError, ErrorKind, Result as IoResult},
sync::Arc,
};
use base64::URL_SAFE_NO_PAD;
use bytes::Bytes;
use http::header;
use hyper::{client::HttpConnector, Client};
use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder};
use serde::{Deserialize, Serialize};
use super::{Challenge, Pr... |
use crate::{
core::{
algebra::{Matrix3, Matrix4, Vector2, Vector3},
color::Color,
math::{lerpf, Rect},
scope_profile,
},
rand::Rng,
renderer::{
blur::Blur,
error::RendererError,
framework::{
framebuffer::{
Attachment, At... |
use crate::util;
use ansi_term::Color;
use anyhow::Error;
use structopt::StructOpt;
use tame_gcs::{
common::StandardQueryParameters,
objects::{ListOptional, ListResponse, Metadata, Object},
};
#[derive(StructOpt, Debug)]
pub struct Args {
/// Recurse into directories, may want to take care with this
//... |
use crate::error::HideError;
mod error;
pub use self::error::*;
mod rvm;
#[derive(Debug, clap::Parser)]
#[clap(about, version, author)]
/// Virtual camera reliably crops your wonderful self out of your webcam
struct Args {
/// Lists video capture devices present on the system along with their details
#[clap(... |
use std::collections::HashMap;
use slug::slugify;
use tokio_postgres::Row;
use crate::error::*;
use crate::auth::*;
use crate::models::*;
use crate::forms::article::*;
use crate::db::*;
use crate::db::util::*;
#[derive(Clone)]
pub struct ArticleService {
// get one article
article_by_id: VersionedStatement,
... |
use ethers_core::{
abi::Function,
types::{
transaction::eip2718::TypedTransaction, Chain, Eip1559TransactionRequest, NameOrAddress,
TransactionRequest, H160, U256,
},
};
use ethers_providers::Middleware;
use eyre::{eyre, Result};
use foundry_utils::{encode_args, get_func, get_func_etherscan... |
// Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
#![deny(warnings)]
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to... |
/*
* Copyright 2019 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... |
extern crate clap;
extern crate crossbeam_channel;
#[macro_use]
extern crate cursive;
#[cfg(feature = "share_clipboard")]
extern crate clipboard;
extern crate directories;
extern crate failure;
extern crate futures;
#[macro_use]
extern crate lazy_static;
extern crate librespot_core;
extern crate librespot_playback;
ext... |
use super::Parser;
use super::item::ItemInfo;
use super::diagnostics::Error;
use crate::attr;
use crate::ast::{self, Ident, Attribute, ItemKind, Mod, Crate};
use crate::parse::{new_sub_parser_from_file, DirectoryOwnership};
use crate::token::{self, TokenKind};
use crate::source_map::{SourceMap, Span, DUMMY_SP, FileNam... |
use if_chain::if_chain;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint_pass, declare_tool_lint};
use crate::utils::{in_macro, match_type, paths, span_lint_and_then, usage::is_potentially_mutated};
use rustc::hir::intravisit::*;
use rustc::hir::*;
use syntax::source_map::Spa... |
//! Kubernetes configuration objects from `~/.kube/config` or in cluster environment.
//!
//! Used to populate [`Config`] that is ultimately used to construct a [`Client`][crate::Client].
//!
//! Unless you have issues, prefer using [`Config::infer`] and pass it to a [`Client`][crate::Client].
mod exec;
mod file_confi... |
// Copyright 2018-2022 Parity Technologies (UK) Ltd.
//
// 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 applicab... |
//! Tock kernel for the Nordic Semiconductor nRF52 development kit (DK), a.k.a. the PCA10040. </br>
//! It is based on nRF52838 SoC (Cortex M4 core with a BLE transceiver) with many exported
//! I/O and peripherals.
//!
//! nRF52838 has only one port and uses pins 0-31!
//!
//! Furthermore, there exist another a previe... |
use crate::{
parse_account_data::{ParsableAccount, ParseAccountError},
StringAmount, UiFeeCalculator,
};
use bincode::deserialize;
use bv::BitVec;
#[allow(deprecated)]
use solana_sdk::sysvar::{fees::Fees, recent_blockhashes::RecentBlockhashes};
use solana_sdk::{
clock::{Clock, Epoch, Slot, UnixTimestamp},
... |
//! [](https://github.com/time-rs/time)
//! 
//! [ and a `proc_macro` server (a compiler front-end).
//!
//! Serialization (with C ABI buffers) and unique integer handles are employed
//! to allow safely interfacing between two copies of `proc_macro` built
//! (from the same... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 29/04/2018
Last Modified: 12/10/2018
License: MIT
NOTES: Correlation is calculated for each pair of numeric attributes.
*/
use crate::rendering::html::*;
use crate::tools::*;
use crate::vector::{FieldData, Shapefile};
... |
use chrono::{NaiveDateTime, NaiveDate, NaiveTime, Local, TimeZone, DateTime};
use std::collections::HashMap;
use std::convert::{From, TryFrom, TryInto};
use std::time::SystemTime;
use crate::list;
use crate::client::types::{FtpListItem};
////////////////////////////////////////////////////////////////////////////////... |
// Author: <NAME> <<EMAIL>>
// Copyright © 2019, Embark Studios, all rights reserved.
// Created: 19 June 2019
#![warn(clippy::all)]
/*!
Wrapper implementation for PxRigidDynamic
*/
use crate::{
geometry::Geometry,
math::PxTransform,
owner::Owner,
physics::Physics,
rigid_actor::RigidActor,
ri... |
use chrono::Utc;
use error::WebhookError;
use hmac::{Hmac, Mac};
use resources::*;
use serde_json as json;
use sha2::Sha256;
use std::str;
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq, Hash)]
pub enum EventType {
#[serde(rename = "account.updated")]
AccountUpdated,
#[serde(rename = "a... |
// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) a... |
// Copyright (c) SimpleStaking and Tezedge Contributors
// SPDX-License-Identifier: MIT
use std::collections::{HashMap, HashSet};
use crypto::hash::{BlockHash, OperationHash};
use tezos_api::ffi::{Applied, PrevalidatorWrapper, ValidateOperationResult};
use tezos_messages::p2p::encoding::prelude::{Mempool, Operation};... |
use modelfox_app_monitor_event::NumberOrString;
use modelfox_zip::zip;
use ndarray::prelude::*;
use num::ToPrimitive;
use serde::ser::SerializeStruct;
#[derive(Clone)]
pub struct MulticlassClassificationProductionPredictionMetrics {
classes: Vec<String>,
confusion_matrix: Array2<u64>,
}
impl serde::Serialize for Mu... |
/// This module takes a (parsed) definition of `macro_rules` invocation, a
/// `tt::TokenTree` representing an argument of macro invocation, and produces a
/// `tt::TokenTree` for the result of the expansion.
use rustc_hash::FxHashMap;
use ra_syntax::SmolStr;
use tt::TokenId;
use crate::ExpandError;
use crate::tt_curs... |
#![warn(missing_docs)]
//! CramJam documentation of python exported functions for (de)compression of bytes
//!
//! Although this documentation is built using Cargo/Rust toolchain, the examples and API represent
//! the usable _Python_ API
//!
//! In general, the API follows cramjam.`<<compression algorithm>>.compress` ... |
use std::{
collections::VecDeque,
pin::Pin,
task::{Context, Poll},
time::Duration,
};
use derivative::Derivative;
use futures_core::{Future, Stream};
use serde::de::DeserializeOwned;
use crate::{
bson::Document,
cmap::conn::PinnedConnectionHandle,
error::{Error, ErrorKind, Result},
ope... |
use crate::app::{App, Flags, ShowEverything};
use crate::options::Options;
use crate::pregame::TitleScreen;
use crate::render::DrawOptions;
use crate::sandbox::{GameplayMode, SandboxMode};
use ezgui::{Canvas, Drawable, EventCtx, EventLoopMode, GfxCtx, Wizard, GUI};
use geom::Polygon;
// This is the top-level of the GU... |
////////////////////////////////////
// kdd::loader - Responsible to load and instantiate a kdd
////
use std::{collections::HashMap, env, fs::read_to_string, path::PathBuf};
use super::{error::KddError, version::Version, Block, Builder, Kdd, Realm};
use crate::{
utils::yamls::{as_string, as_strings, merge_yaml},
ut... |
// Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
#![deny(warnings)]
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 31/09/2018
Last Modified: 13/10/2018
License: MIT
*/
use crate::raster::*;
use crate::structures::Point2D;
use crate::tools::*;
use crate::vector::ShapefileGeometry;
use crate::vector::*;
use std::env;
use std::io::{Err... |
use crate::{ChatId, MessageId, UserId};
use byteorder::{ReadBytesExt, WriteBytesExt, LE};
use lazy_static::lazy_static;
use log::{info, warn};
use std::{collections::HashSet, convert::TryInto, fmt::Write, path::Path};
use teloxide::types::{
ChatKind, ChatMemberKind, Message, MessageEntityKind, MessageKind, Update, ... |
use crate::config::get_config;
use crate::footprint::{get_current_footprint, get_footprint};
use crate::listeners::Listeners;
use crate::transformation;
use nalgebra::{Isometry2, Vector2};
use std::convert::TryFrom;
use std::io;
use std::sync::Arc;
use strum_macros::AsRefStr;
use termion::input::MouseTerminal;
use term... |
//! # JDI LPM013M126A
//! SPI 8 colour memory in pixel (MIP) display
//!
//! ## Connection
//!
//!
//!
use crate::{
lpm013m126a::Palette8,
spim::{Instance, Spim},
DmaSlice, Error,
};
use core::convert::{From, TryInto};
use embedded_hal::digital::v2::OutputPin;
#[cfg(feature = "graphics")]
use embedded_gra... |
#[cfg(feature = "blst")]
use crate::bls::Engine;
#[cfg(feature = "blst")]
use blstrs::PairingCurveAffine;
use crossbeam_channel::{bounded, Receiver, Sender};
use ff::{Field, PrimeField};
use groupy::{CurveAffine, CurveProjective};
#[cfg(feature = "pairing")]
use paired::{Engine, PairingCurveAffine};
use rayon::prelude... |
/// This file implements the functions that we will be using to, initiate, maintain and update
/// the seeds of random number generators.
// use zeroize to clear the memory
use zeroize::Zeroize;
// use hkdf-sha512 to extract and expand a seed
use hkdf::Hkdf;
use sha2::{digest::generic_array, Sha512};
// hash to Fr requ... |
#![no_std]
#![no_main]
#![warn(rust_2018_idioms)]
// We need to import this crate explicitly so we have a panic handler
use panic_semihosting as _;
mod logger;
use {
bbqueue::{bbq, BBQueue, Consumer},
byteorder::{ByteOrder, LittleEndian},
core::fmt::Write,
cortex_m_semihosting::hprintln,
nrf52810... |
use super::prelude::*;
use crate::contour_operations;
use crate::tool_behaviors::{move_handle::MoveHandle, pan::PanBehavior, zoom_scroll::ZoomScroll};
use crate::user_interface::Interface;
use glifrenderer::points::draw_point;
use editor::util::get_contour_start_or_end;
use glifrenderer::points::UIPointType;
use sdl2:... |
use chrono;
use futures;
use futures::future::Either;
use futures::Future;
use my;
use my::prelude::*;
use std::collections::HashSet;
use trawler::{StoryId, UserId};
const NUM_STORIES: u32 = 40650;
#[inline]
fn slug_to_id(slug: &[u8; 6]) -> u32 {
// convert id to unique string
// 36 possible characters (a-z0-... |
extern crate sdl2;
extern crate imgui;
use sdl2::video::Window;
use sdl2::mouse::{Cursor,SystemCursor,MouseState};
use sdl2::keyboard::Scancode;
use imgui::{Context,MouseCursor,Key,ConfigFlags};
use sdl2::event::Event;
pub struct ImguiSdl2 {
mouse_press: [bool; 5],
ignore_mouse: bool,
ignore_keyboard: bool,
... |
// Adapted from https://github.com/actix/examples/tree/master/websocket
use std::time::Duration;
use crate::server::{self, ServerConfig};
use crate::utils::{self, CliEnv};
use actix::io::SinkWrite;
use actix::*;
use actix_codec::{AsyncRead, AsyncWrite, Framed};
use awc::{
error::WsProtocolError,
ws::{Codec, F... |
//! A splittable pseudo-random number generator based on the
//! SipHash function. **This is not intended to be a
//! cryptographically secure PRNG.**
//!
//! This generator is broadly modeled after Claessen and Pałka's, a
//! version of which is implemented in the Haskell [`tf-random`
//! library](https://hackage.has... |
// Copyright 2016, <NAME> <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license/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 accordi... |
// Copyright 2019 <NAME> <<EMAIL>>
//
// 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 t... |
use super::db::DB;
use super::opds;
use super::Config;
use failure::Error;
use futures::{future, Future};
use hyper::header;
use hyper::service::service_fn;
use hyper::{Body, Method, Request, Response, Server, StatusCode};
use regex::Regex;
use std::io;
use std::sync::Arc;
use url::percent_encoding::percent_decode;
ty... |
// Generated from definition io.k8s.api.storage.v1.CSINodeDriver
/// CSINodeDriver holds information about the specification of one CSI driver installed on a node
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CSINodeDriver {
/// allocatable represents the volume resources of a node that are available for ... |
use crate::module::{
ChainRpc, ChainRpcImpl, ExperimentRpc, ExperimentRpcImpl, NetworkRpc, NetworkRpcImpl, PoolRpc,
PoolRpcImpl, StatsRpc, StatsRpcImpl,
};
use crate::RpcServer;
use ckb_chain::chain::{ChainController, ChainService};
use ckb_chain_spec::consensus::Consensus;
use ckb_core::block::BlockBuilder;
us... |
// 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(missing_docs)]
//! Test utilities for starting a blobfs server.
use {
failure::{bail, Error, ResultExt},
fdio::{SpawnAction, SpawnOptions... |
use {
super::{expr, function, EvaluateError, Evaluated},
crate::{
ast::{Expr, Function},
data::{Row, Value},
result::Result,
},
chrono::prelude::Utc,
std::borrow::Cow,
};
type Columns<'a> = &'a [String];
pub fn evaluate_stateless<'a>(
context: Option<(Columns, &'a Row)>... |
use sodiumoxide::crypto::{
hash::sha256::DIGESTBYTES,
sign::{PUBLICKEYBYTES, SIGNATUREBYTES},
};
use std::io::{Cursor, Error, ErrorKind, Read};
use crate::asset::Asset;
use crate::crypto::{Digest, PublicKey, SigPair, Signature};
macro_rules! read_exact_bytes {
($self:expr, $len:expr) => {{
let mut... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Start HFCLK128M/HFCLK64M source as selected in HFCLKSRC"]
pub tasks_hfclkstart: crate::Reg<tasks_hfclkstart::TASKS_HFCLKSTART_SPEC>,
#[doc = "0x04 - Stop HFCLK128M/HFCLK64M source"]
pub tasks_hfclkstop: crate::Reg<tasks_hfc... |
/*
SPDX-License-Identifier: Apache-2.0 OR MIT
Copyright 2020 The arboard contributors
The project to which this file belongs is licensed under either of
the Apache 2.0 or the MIT license at the licensee's choice. The terms
and conditions of the chosen license apply to this file.
*/
use super::common::{Error, ImageDa... |
use std::fs;
use std::path::{Path, PathBuf};
use structopt::StructOpt;
use flamegraph::Workload;
#[derive(Debug, StructOpt)]
#[structopt(
setting = structopt::clap::AppSettings::TrailingVarArg
)]
struct Opt {
/// Build with the dev profile
#[structopt(long = "dev")]
dev: bool,
/// Binary to run
... |
//! Echo Server based on libp2p
//
// Copyright (c) 2017 Parity Technologies (UK) Ltd
// Copyright (c) 2018 Stegos
//
// 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, ... |
use crate::bus::{Bus, Readable, Writable};
use crate::cartridge::Cartridge;
use crate::processor::interrupt::{Interrupt, InterruptHandler};
use crate::video::Video;
use self::joypad::{Input, Joypad};
use self::timer::Timer;
use crate::util::savestate::{read_savestate_byte, LoadSavestateError, Savestate, SavestateStrea... |
use crate::error;
use crate::message_handler::{HandlerMessage, MessageHandler};
use crate::NetworkConfig;
use beacon_chain::{BeaconChain, BeaconChainTypes};
use core::marker::PhantomData;
use eth2_libp2p::Service as LibP2PService;
use eth2_libp2p::Topic;
use eth2_libp2p::{Enr, Libp2pEvent, Multiaddr, PeerId, Swarm};
us... |
use crate::rng::rand;
use crate::systematic_constants::SYSTEMATIC_INDICES_AND_PARAMETERS;
use serde::{Deserialize, Serialize};
use std::cmp::min;
// As defined in section 3.2
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, PartialOrd, Eq, Ord, Hash)]
pub struct PayloadId {
source_block_number: u8,
en... |
pub mod mut_message_client;
use std::env;
use std::io::*;
use std::mem;
use std::net::*;
use std::panic::{catch_unwind, UnwindSafe};
use std::process::{Command, Stdio};
use std::str::FromStr;
use std::sync::*;
use std::thread;
use std::time::*;
use futures::Future;
use tokio::runtime::current_thread::Runtime;
use tr... |
//! draw a point
/* point.rs
* create 2022/02/20
* update 2022/02/28 internal point method change
*/
use crate::canvas::Screen;
use crate::utils::color_taple;
fn _point (screen: &mut dyn Screen, x: i32, y: i32, red :u8, green :u8, blue :u8, alpha :u8, weight :f32) {
if x < 0 || y < 0 || x >= screen.width()... |
use super::Rng;
/// This is xoshiro128++ 1.0, one of our 32-bit all-purpose, rock-solid
/// generators. It has excellent speed, a state size (128 bits) that is
/// large enough for mild parallelism, and it passes all tests we are aware
/// of.
///
/// For generating just single-precision (i.e., 32-bit) floating-point
... |
use crate::dependency::ModDependency;
use crate::mod_settings::ModSettings;
use crate::{HasDependencies, HasReleases, HasVersion, ModIdent, Version};
use anyhow::{anyhow, bail, ensure, Context, Result};
use console::style;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::collections::HashMap;
use s... |
use crate::*;
use core::fmt::Write;
use core::mem;
use core::num::NonZeroU32;
const MAX_STACK_SIZE: u32 = 4 * 1024 * 1024;
const MAX_STACK_FRAMES: usize = 4000;
pub struct Memory {
data: AllocTracker,
stack_byte_size: u32,
pub current_frame: StackFrame,
stack_pointer_map: Pod<u32>,
stack_frames:... |
use std::collections::HashSet;
use std::collections::HashMap;
use crate::ast::TermNode;
use crate::ast::Tag;
use crate::ast::MatchArm;
use crate::runtime::TypeDef;
use crate::ast::Type;
use crate::ast::TypeNode;
use crate::context::Context;
pub type TypeErr = String;
pub fn infer_type(t: &TermNode, ctx: Context<Type... |
//! # The main loop of the NT4 server
//! j
//! This module contains most of the top-level logic for handling client events in the function [`channel_loop`]
//!
//! The task spawned from [`channel_loop`] runs until the server is shut down, and responds to messages from all clients connected
//! to the server. These can... |
use std::collections::{HashMap, HashSet};
use std::mem;
use std::rc::Rc;
use crate::match_finder::MatchFinder;
use crate::rans::{CostCounter, RansCoder};
use crate::{lz, ProgressCallback};
pub fn pack(data: &[u8], level: u8, use_bitstream: bool, progress_cb: Option<ProgressCallback>) -> Vec<u8> {
let mut parse = ... |
// Copyright 2022 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.
//! An IP device.
pub(crate) mod state;
use alloc::boxed::Box;
use core::num::NonZeroU8;
use net_types::{
ip::{AddrSubnet, Ip, IpAddress, IpVersion,... |
use super::trie::Trie as Trie;
use super::scanner::Scanner as Scanner;
use super::tokens::{TokenInfo, Token, SpecialToken, TypeName};
struct TokenPack<T> {
value: T,
possible_ident: bool
}
impl<T> TokenPack<T> {
fn new(val: T, ident: bool) -> TokenPack<T> {
TokenPack {
value: val,
... |
mod math;
pub mod parse;
use math::conversion::convert;
use math::operation::iterate_number;
use parse::argument::parse_math_operation;
use parse::string::{is_conversion, is_math_operation, is_measurement, is_number, parsing, Kind};
pub enum Operation {
Calculation,
Conversion,
}
//TODO: Refactor code
pub f... |
use itertools::Itertools;
use nalgebra::*;
use rand::prelude::*;
use rayon::prelude::*;
use std::io;
use std::io::prelude::*;
use std::ops::*;
use crate::prelude::*;
/// Stores a color using `f32`s
#[derive(Clone, Debug, PartialEq, Default, Copy)]
pub struct Color {
pub(crate) red: f32,
pub(crate) green: f32... |
use std::{
collections::HashMap,
fs,
path::PathBuf,
sync::{Arc, Mutex},
};
use failure::{Fail, ResultExt};
use futures::{
sync::{mpsc::UnboundedReceiver, oneshot, oneshot::Sender},
Future, Stream,
};
use hyper::{server::conn::Http, Body, Request};
use log::{error, info, warn, Level};
use serde:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.