text stringlengths 7.05k 33.9k |
|---|
use super::hook::{Hook, HookBodyParam, HookPathParam, HookQueryParam};
use super::params::generic_to_typsecript_type;
use regex::Regex;
use std::fs::File;
use std::io::Read;
use std::io::Write;
use std::path::Path;
use std::path::PathBuf;
use syn::FnArg;
use syn::Pat;
use syn::PatType;
use syn::PathArguments;
use syn::... |
use std::f64;
use helpers::{Vector, lerp};
use fluid_quantity::{Staggered, FluidQuantity};
use image::{self, GenericImage, ImageBuffer};
pub enum InterpolationScheme {
/// First-order Runge Kutta interpolation
RK1,
/// Second-order Runge Kutta interpolation
RK2
}
pub struct FluidSolver {
/// Th... |
pub use arboard::Clipboard as ClipboardContext;
use hbb_common::{
allow_err,
anyhow::bail,
compress::{compress as compress_func, decompress},
config::{Config, COMPRESS_LEVEL, RENDEZVOUS_TIMEOUT},
get_version_number, log,
message_proto::*,
protobuf::Message as _,
protobuf::ProtobufEnum,
... |
//! Window system integration.
#![warn(
missing_debug_implementations,
missing_copy_implementations,
missing_docs,
trivial_casts,
trivial_numeric_casts,
unused_extern_crates,
unused_import_braces,
unused_qualifications
)]
use {
gfx_hal::{Backend, Device as _},
rendy_resource::{... |
/*
* Copyright (C) 2020 <NAME> (<EMAIL>)
*/
register_http_plugin!(Proxy);
use std::sync::Arc;
use std::net::SocketAddr;
use std::time::{ Duration, Instant };
use crate::error::*;
use crate::plugin::*;
use crate::config::*;
use crate::http::*;
use crate::http::error::HttpResult;
use crate::connection_pool::*;
use c... |
//! Babel monitor is an async futures based interface for the Babeld management interface
//! it provides abastractions over the major data this interface provides and an async
//! way to efficiently communicate with it.
#![warn(clippy::all)]
#![allow(clippy::pedantic)]
#![forbid(unsafe_code)]
#[macro_use]
extern cra... |
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
use pyo3::types::*;
use std::collections::HashMap;
use timely::dataflow::*;
use timely::dataflow::operators::aggregation::*;
use timely::dataflow::operators::*;
use crate::execution::Pump;
use crate::operators::{
capture, filter, flat_map, inspect, inspec... |
//! A representation of a stage, with human-friendly `const`s and display names.
use std::{
convert::TryFrom,
fmt::{Debug, Display, Formatter},
};
#[cfg(feature = "serde")]
use serde_crate::{
de::{Error, Visitor},
Deserialize, Deserializer, Serialize, Serializer,
};
// Imports used solely by doc comm... |
use crate::block::*;
use crate::controller::*;
use crate::enemy::*;
use crate::entity::*;
use crate::hitbox::*;
use crate::interface::*;
use crate::level::*;
use crate::player::*;
use crate::render::*;
use crate::resource::*;
use crate::state::*;
use crate::utility::*;
use sdl2::pixels::Color;
pub stru... |
extern crate clap;
extern crate slog;
extern crate slog_async;
extern crate slog_term;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate error_chain;
extern crate dirs;
extern crate github_gql;
extern crate git2;
extern crate rayon;
extern crate core;
extern crate atty;
extern crat... |
use core::fmt;
use crate::internal_prelude::*;
/// Get the current thread's `errno` value.
#[inline]
pub fn errno_get() -> libc::c_int {
unsafe { *util::errno_ptr() }
}
/// Set the current thread's `errno` value.
#[inline]
pub fn errno_set(eno: libc::c_int) {
unsafe {
*util::errno_ptr() = eno;
}
... |
use rand::{Rng};
use crate::{Sample, SampleSet, WorkingSet, LearnError};
use crate::core::ValidationError;
use std::collections::HashSet;
#[derive(Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
pub struct Markov {
tokens: Vec<S... |
use std::collections::HashMap;
use std::convert::TryFrom;
use serde::{Deserialize};
use std::collections::hash_map::DefaultHasher;
use crypto::ed25519;
use std::hash::{Hash, Hasher};
use crate::data::*;
use crate::schemas::{Schema};
use crate::{Context, Globals, ContextState, State};
#[derive(Deserialize, Clon... |
use super::Parameter;
use crate::AbiParserError;
/// ABI function input/output parameter type.
#[derive(Debug, PartialEq)]
pub enum ParameterType {
// TODO make this public only on crate level
/// A 160 bit (20 bytes) unsigned integer.
Address,
/// A simple boolean with its value restricted to 0 or 1.
... |
extern crate libc;
extern crate nix;
extern crate procinfo;
extern crate walkdir;
use errno::errno;
use platform::{
fd_array,
fd_array_push,
proc_stat,
steal_pty_state,
TASK_COMM_LENGTH
};
use ptrace::{
ptrace_child,
ptrace_memcpy_from_child,
ptrace_memcpy_to_child,
ptrace_remote_sy... |
use super::{
Felt, FieldElement, Hasher, HasherState, Selectors, TraceFragment, Word, LINEAR_HASH,
MP_VERIFY, MR_UPDATE_NEW, MR_UPDATE_OLD, RETURN_HASH, RETURN_STATE, TRACE_WIDTH,
};
use rand_utils::rand_array;
use vm_core::{
hasher::{self, NUM_ROUNDS},
AdviceSet,
};
// LINEAR HASH TESTS
// ===========... |
use super::memory::ArmMemory;
use super::registers::{ArmRegisters, CpuMode};
use super::{arm, thumb};
pub const EXCEPTION_BASE: u32 = 0;
pub struct ArmCpu {
/// The last opcode that was fetched.
fetched: u32,
/// This last opcode that was decoded.
decoded_op: u32,
/// Function that will be calle... |
use std::collections::HashMap;
use super::{
tokenizer::{AbsSign, Token, TokenValue},
uniop::UniOp,
wild::InferGenerator,
Error::*,
HighlightTag, ParserConfig, Result,
};
use crate::{
app_ref,
brain::{good_char, increase_foreign_vars, Abstraction, Term, TermRef},
library::prelude::{self... |
// Std imports
use std::fmt::{self, Debug, Display};
use std::str::FromStr;
// External imports
use b64::{CharacterSet, Config, Newline, ToBase64};
// Internal imports
use crate::error::{HshError, HshResult};
use crate::format::get_format;
// Re-exports
pub use crate::bcrypt::Salt;
#[derive(Clone, Copy, Debug, Part... |
// The units in the game, and a struct to contain them
use rand;
use rand::{rngs::ThreadRng, Rng};
use std::collections::hash_map::*;
use std::fmt;
use std::iter::*;
use super::map::*;
use super::paths::PathPoint;
use context::*;
use items::Item;
use resources::Image;
use utils::{chance_to_hit, distance_under};
use ... |
//! Defines the Orchestrator role, which manages work for all devices on the platform
use super::{ExecutionFailure, Executor, GenericNode, SetupFailure, Task};
use crate::gql_model::{Deployment, Service, ServiceStatus};
use crate::gql_schema::{Mutation, Query};
use crate::rabbit::RabbitBroker;
use crate::rabbit::{
... |
use std::{collections::{HashSet, BTreeMap}, cmp::Ordering, ops::{Sub, Add}};
use crate::lattice::AbstractProperty;
use super::{ExpressionReachability, CartesianValue};
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub enum SignPropertyElement {
Bottom = 0, // bot
StrictlyLessThanZero = ... |
//! Provides a named interface to the `u16` Encoding bits.
use core::ops::RangeInclusive;
/// Named interface to the `u16` Encoding bits, representing an opcode.
///
/// Cranelift requires each recipe to have a single encoding size in bytes.
/// X86 opcodes are variable length, so we use separate recipes for differen... |
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
use std::collections::{BTreeMap, HashSet};
use std::convert::{Into, TryInto};
use std::future::Future;
use std::io::Read;
use std::ops::{Deref, DerefMut};
use std::path::{Path, PathBuf};... |
// Copyright 2018 <NAME>
// 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... |
// Copyright 2012-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-MI... |
use swc_ecmascript::ast::{
ArrayLit, BindingIdent, BlockStmt, Decl, ExportDecl, Expr, ExprOrSpread, FnDecl, Function,
Ident, ImportDecl, JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXClosingElement, JSXElement,
JSXElementName, JSXExpr, JSXExprContainer, JSXOpeningElement, JSXText, KeyValueProp,
MemberExpr, ... |
///////////////////////////////////////////////////////////////////////////////L
// The MIT License (MIT)
// Copyright (c) 2021 [untitled os] Team
// See LICENSE.txt and CREDITS.txt for details
///////////////////////////////////////////////////////////////////////////////L
use core::mem::size_of;
use super::fis::{Fi... |
/*
Copyright (c) 2021 VMware, Inc.
SPDX-License-Identifier: MIT
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, m... |
//! The `pedersen_commitments` library contains helper API for producing
//! DID and Claim labels for Asset Granularity Unique Identity
//! project.
//!
//! The investor will use the `commit()` function to calculate their
//! DID labels and Claim labels, and make those public.
//!
//! The validators of the blockchain w... |
//! Implementation of the physical memory protection unit (PMP).
use core::cell::Cell;
use core::cmp;
use core::fmt;
use crate::csr;
use kernel;
use kernel::common::cells::MapCell;
use kernel::common::registers::register_bitfields;
use kernel::mpu;
use kernel::AppId;
// This is the RISC-V PMP support for Tock
// We ... |
use anyhow::Result;
use bitcoin::{
hashes::{sha256, Hash, HashEngine},
Amount, Block, BlockHash, OutPoint, SignedAmount, Transaction, Txid,
};
use rayon::prelude::*;
use serde::ser::{Serialize, Serializer};
use std::collections::{BTreeMap, HashMap, HashSet};
use std::convert::TryFrom;
use crate::{
cache::... |
// Copyright 2021 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.
//! Fuchsia netdevice session.
mod buffer;
use std::fmt::Debug;
use std::num::{NonZeroU16, NonZeroU32, NonZeroU64};
use std::pin::Pin;
use std::sync::{Ar... |
extern crate blake2;
extern crate byteorder;
extern crate clap;
extern crate digest;
extern crate futures;
extern crate hex;
extern crate hyper;
extern crate ocl;
extern crate parking_lot;
extern crate rand;
extern crate time;
#[macro_use]
extern crate serde_json;
mod gpu;
use std::u64;
use std::collections::VecDeque... |
/*!
# OpenGL ES3 API (aka GLES3).
Designed to work on Linux and Android, with context provided by EGL.
## Texture views
GLES3 doesn't really have separate texture view objects. We have to remember the
original texture and the sub-range into it. Problem is, however, that there is
no way to expose a subset of array la... |
//
// Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// An impleme... |
use core::alloc::Layout;
use core::convert::TryInto;
use core::mem;
use core::ops::Deref;
use core::ptr::NonNull;
use crate::erts::process::alloc::TermAlloc;
use crate::erts::process::test::process;
use crate::erts::term::closure::*;
use crate::erts::term::prelude::*;
use crate::erts::*;
use crate::{atom, fixnum};
//... |
use anyhow::anyhow;
use anyhow::Context;
use anyhow::Result;
use advisory_lock::{AdvisoryFileLock, FileLockMode};
use hyperlocal::{UnixClientExt, Uri};
use serde::{Deserialize, Serialize};
use std::collections::hash_map::DefaultHasher;
use std::hash::Hash;
use std::hash::Hasher;
use std::io::Write;
use std::os::unix::... |
// Copyright 2021 <NAME>
// Copyright 2010-2018 <NAME> and contributors
//
// 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 ... |
//
// Memory Management Unit
//
/*
0000-3FFF 16KB ROM Bank 00 (in cartridge, fixed at bank 00)
4000-7FFF 16KB ROM Bank 01..NN (in cartridge, switchable bank number)
8000-9FFF 8KB Video RAM (VRAM) (switchable bank 0-1 in CGB Mode)
A000-BFFF 8KB External RAM (in cartridge, switchable bank, ... |
// Copyright (c) 2016 The vulkano developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be ... |
use crate::{
algorithms::{adc, divrem_nby1, divrem_nbym, mac},
assign_ops_from_trait, self_ops_from_trait, MulFullInline, MulInline, SquareFullInline,
SquareInline, U256,
};
use num_traits::Pow;
use std::{
ops::{Mul, MulAssign},
prelude::v1::*,
u64,
};
// Multiplicative operations: Mul, square,... |
use goblin::elf;
use goblin::elf64::header::ET_DYN;
use goblin::elf64::program_header::{PT_LOAD, PT_TLS};
use goblin::elf64::reloc::*;
use log::{debug, error, warn};
use std::ffi::OsString;
use std::io::Write;
use std::net::Ipv4Addr;
use std::os::unix::ffi::OsStrExt;
use std::path::Path;
use std::ptr::write;
use std::t... |
// Copyright 2020-2021, The Tremor Team
//
// 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 agr... |
#![allow(unstable_name_collisions)]
use crate::traits::Embedable;
use crate::Result;
use chrono::{DateTime, Utc};
use core::ops::{Deref, DerefMut};
use core::time::Duration;
use serde::{Deserialize, Serialize};
use serenity::builder::CreateEmbed;
use serenity::client::Context;
use serenity::http::client::Http;
use ser... |
use std::borrow::Cow;
use std::ops::Range;
use regex::{Captures, Regex, RegexBuilder};
use crate::flatjson::{FlatJson, Index};
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
pub enum SearchDirection {
Forward,
Reverse,
}
impl SearchDirection {
pub fn prompt_char(&self) -> char {
match self {
... |
use std::borrow::Cow;
use std::fmt::Write;
use std::time::{SystemTime, UNIX_EPOCH};
use hmac::{Hmac, Mac, NewMac};
use http::header::{HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_TYPE};
use http::uri::Authority;
use hyper::{Body, Request, Response, StatusCode};
use oauth_credentials::Credentials;
use percent_encodin... |
use core::fmt;
use anyhow::anyhow;
use flexiber::{Decodable, Encodable, TaggedSlice};
use crate::{Error, Result};
// pcsc_app!();
app!();
// impl<'t> crate::apps::PcscSelect<'t> for App<'t> {
impl<'t> crate::Select<'t> for App<'t> {
const RID: &'static [u8] = super::Rid::YUBICO;
const PIX: &'static [u8] = s... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
use crate::{
fail::Fail,
protocols::{
ethernet2::frame::Ethernet2Header,
ip,
ipv4::datagram::{Ipv4Header, Ipv4Protocol2},
tcp::SeqNumber,
},
runtime::PacketBuf,
runtime::RuntimeBuf,
};
use byte... |
#![cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;
use crate::detail::sandwich::{sw012, sw_mm_three, sw_mm_two};
use crate::detail::sse::{dp_bc, hi_dp_bc, rcp_nr1, rsqrt_nr1};
use crate::util::ApplyTo;
use crate::{Branch, Line, Plane, Point};
#[derive(Default)]
pub struct EulerAngles {
pub roll: f32,
... |
// Copyright 2020 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, ... |
use std::sync::Arc;
use std::sync::mpsc;
use std::thread;
use std::time;
use crate::core::{
vec3::Vec3,
point3::Point3,
ray::Ray,
color::Color,
PI,
};
use crate::geometry::{
sphere::Sphere,
hit::{HittableList}
};
use crate::materials::{
DefaultMaterial,
lambertian::Lambertian,
metal::Metal,
dielec... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - System Clock Configuration"]
pub clk_config: crate::Reg<clk_config::CLK_CONFIG_SPEC>,
#[doc = "0x04 - System Clock Controls"]
pub clk_ctrl: crate::Reg<clk_ctrl::CLK_CTRL_SPEC>,
#[doc = "0x08 - Interrupt Flags"]
pub ... |
extern crate rand;
extern crate rand_xorshift;
use rand::{Rng, SeedableRng, thread_rng};
use rand::seq::SliceRandom;
use rand_xorshift::XorShiftRng;
use std::collections::HashMap;
/// Mapping of international phonetics to characters
#[derive(Debug, Clone)]
struct Orthography {
// String or Vec<Char>?
orthograp... |
#![deny(
missing_docs,
nonstandard_style,
unused_parens,
unused_qualifications,
rust_2018_idioms,
rust_2018_compatibility,
future_incompatible,
missing_copy_implementations
)]
/*
#![warn(
clippy::missing_docs_in_private_items,
clippy::missing_panics_doc,
missing_docs
)]*/
//... |
use crate::egui_renderer::EguiRenderer;
use crate::gui::Gui;
use crate::light_garden::light::Color;
use crate::light_garden::LightGarden;
use crate::texture_renderer::{TextureRenderer, RENDER_TEXTURE_FORMAT};
use bytemuck::{Pod, Zeroable};
use collision2d::geo::*;
use egui::ClippedMesh;
use half::f16;
use image::save_b... |
use std::hash::{BuildHasherDefault, Hasher};
#[derive(Clone, Default)]
pub struct TrivialU64Hasher {
state: u64,
}
impl Hasher for TrivialU64Hasher {
fn finish(&self) -> u64 {
self.state
}
fn write(&mut self, _: &[u8]) {
panic!("TrivialU64Hasher can only hash u64!");
}
fn write_u64(&mut self, value... |
use {
crate::{
client_error::ClientError,
connection_cache::ConnectionCache,
nonblocking::{
pubsub_client::{PubsubClient, PubsubClientError},
rpc_client::RpcClient,
},
rpc_request::MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS,
rpc_response::SlotUpdat... |
//!
//! A DeltaLayer represents a collection of WAL records or page images in a range of
//! LSNs, for one segment. It is stored on a file on disk.
//!
//! Usually a delta layer only contains differences - in the form of WAL records against
//! a base LSN. However, if a segment is newly created, by creating a new relat... |
//! A Solidity formatter
use std::fmt::Write;
use indent_write::fmt::IndentWriter;
use solang_parser::pt::{
ContractDefinition, DocComment, EnumDefinition, Identifier, Loc, SourceUnit, SourceUnitPart,
StringLiteral,
};
use crate::{
loc::LineOfCode,
visit::{VResult, Visitable, Visitor},
};
/// Contai... |
//! Events reported by the platform.
//!
//! # F.A.Q
//!
//! ## What's an `EventInstant`?
//!
//! A type similar to `std::time::Instant` for events reported by the platform.
//! Depending on the implementation, it may wrap an `enum` that has as many
//! variants as there are possible timestamp sources.
//!
//! For in... |
use std::convert::TryInto;
use std::f32::consts::PI;
use std::fs::File;
use std::io::BufReader;
use std::path::Path;
use serde_json::from_reader;
use serde::{Deserialize, Serialize};
use mfcc::Transform;
use ndarray::{Array1, Array2, Axis, concatenate, s};
use tflite::ops::builtin::BuiltinOpResolver;
use tflite::{Flat... |
//! Task 3.2: Pokemon
fn main() {
// Let both players choose their Pokemon
let model_red = choose_pokemon("Player Red");
let mut poki_red = Pokemon::with_level(model_red, 5);
let model_blue = choose_pokemon("Player Blue");
let mut poki_blue = Pokemon::with_level(model_blue, 5);
loop {
... |
// Copyright Rivtower Technologies LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed ... |
mod garbage_collector;
use crate::{
core::{
scheduling::resources::HealthyChildItems,
specs::{OperationSequenceGuard, SpecOperations},
task_poller::{
squash_results, PollContext, PollPeriods, PollResult, PollTimer, PollerState,
TaskPoller,
},
wrapper:... |
/*
MIT License
Copyright (c) 2021 <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, distrib... |
use wasc::aot_generator;
use wasc::code_builder;
use wasc::compile;
use wasc::context;
use wasc::gcc;
mod misc;
fn test_single_test<P: AsRef<std::path::Path>>(
wasm_path: P,
commands: Vec<serde_json::Value>,
) -> Result<(), Box<dyn std::error::Error>> {
let mut config = wasc::context::Config::default();
... |
use crate::auth::user::User;
use crate::communications::mailers;
use crate::communications::smsers;
use crate::database::Connection;
use crate::errors::ApiError;
use crate::extractors::*;
use crate::helpers::application;
use crate::models::*;
use crate::server::AppState;
use crate::utils::serializers::default_as_false;... |
use nom::branch::alt;
use nom::bytes::complete::{tag, take_while, take_while1};
use nom::character::complete::one_of;
use nom::combinator::{map, peek, value};
use nom::sequence::{preceded, terminated};
use nom::IResult;
#[derive(Debug, Eq, PartialEq, Clone)]
enum CommandKeyword {
Quit,
Clear,
Help,
Edi... |
//! Client implementation of the HTTP/1.1 protocol.
//!
//! The client connection is split into two parts, one [`Connection`], which
//! encapsulates the actual transport, and a [`SendRequest`] which is used
//! to send (multiple) requests over the connection.
//!
//! # Example
//!
//! ```rust, no_run
//! use hreq_h1::... |
#![allow(non_camel_case_types)]
#![allow(unused_must_use)]
#![allow(dead_code)]
use super::{start::__Details, Bitfield, Block, Extended, Handshake, Have, Interested, Message, Request, Unchoke};
use crate::Result;
use bytes::{BufMut, BytesMut};
use futures::{select, FutureExt};
use sha1::{Digest, Sha1};
use std::net::S... |
// Copyright 2021 Protocol Labs.
//
// 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, di... |
// Copyright 2013-2016 The rust-url developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// ex... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! This module lays out the basic abstract costing schedule for bytecode instructions.
//!
//! It is important to note that the cost schedule defined in this file does not track hashing
//! operations or other native operations; the c... |
use std::collections::BTreeMap;
use std::env;
use std::fmt;
use std::fs;
use std::io::{BufRead, BufReader, ErrorKind};
use std::path::{Path, PathBuf};
use git2::Config as GitConfig;
use git2::Repository as GitRepository;
use crate::core::{compiler, Workspace};
use crate::util::errors::{CargoResult, CargoResultExt};
u... |
//
//
// This file is a part of Aleph
//
// https://github.com/nathanvoglsam/aleph
//
// MIT License
//
// Copyright (c) 2020 Aleph Engine
//
// 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 Softwar... |
/*
Copyright (c) [2016] [ <maccoda> ]
This file is part of the https://github.com/maccoda/diamond_square repository (8th of March 2018)
file: diamond_square/src/diamond_square.rs
Apache License
Version 2.0, January 2004
... |
#[macro_use] extern crate log;
use clap::{App, Arg};
use rustica_agent::*;
use std::collections::HashMap;
use std::convert::TryFrom;
use std::env;
use std::fs::{self, File};
use std::io::{Read};
use std::os::unix::net::{UnixListener};
use std::process;
use sshcerts::ssh::{Certificate, CertType, PrivateKey};
use yub... |
/// Represents any of the ways storing something in Google Cloud Storage can fail.
#[derive(Debug)]
pub enum Error {
/// If the error is caused by a non 2xx response by Google, this variant is returned.
Google(GoogleErrorResponse),
/// If another network error causes something to fail, this variant is used.... |
// This file is Copyright its original authors, visible in version control
// history.
//
// This file is 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.
// You may... |
// 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 chrono::{DateTime, FixedOffset};
use std::cmp;
use std::collections::HashMap;
use std::iter;
use std::num::ParseIntError;
use std::path::Path;
use std::time::Duration;
use super::{parse_duration, ErrorKind, KeyValuePair, TypedResponseError};
use crate::commands::{SongId, SongPosition};
use crate::tag::Tag;
/// A... |
// 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(non_snake_case)]
use std::fs;
use std::io::{self, BufRead, /*BufReader*/};
use std::path;
use std::collections::HashMap;
use std::ffi;
mod Cfs;
// https://users.rust-lang.org/t/trim-string-in-place/15809
trait TrimInPlace { fn trim_in_place (self: &'_ mut Self); }
impl TrimInPlace for String {
fn trim_in... |
use delaunator::EPSILON;
use super::Point;
#[derive(PartialEq, Copy, Clone, Debug)]
pub enum BoundingBoxTopBottomEdge {
Top,
Bottom,
None
}
#[derive(PartialEq, Copy, Clone, Debug)]
pub enum BoundingBoxLeftRightEdge {
Left,
Right,
None
}
/// Defines a rectangular bounding box.
#[derive(Debug, ... |
//! Contains code related to the styling of widgets
mod corner;
mod edge;
mod option_ref;
pub use corner::Corner;
pub use edge::Edge;
pub use morphorm::{LayoutType, PositionType, Units};
use crate::cursor::PointerEvents;
use crate::{color::Color, render_command::RenderCommand, CursorIcon};
use option_ref::AsRefOptio... |
/// A trace describes how long it takes for an application to perform an
/// operation. It consists of a set of spans, each of which represent a single
/// timed event within the operation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Trace {
/// Project ID of the Cloud project where the trace data is s... |
//! Set up a new YubiHSM2 or restore from backup
use crate::prelude::*;
use abscissa_core::{Command, Options, Runnable};
use chrono::{SecondsFormat, Utc};
use getrandom::getrandom;
use hkd32::{mnemonic, KeyMaterial};
use hkdf::Hkdf;
use sha2::Sha512;
use std::{
fs::File,
io::{self, Write},
path::PathBuf,
... |
//! Picture processing unit.
use std::cell::RefCell;
use std::fmt::Display;
use std::rc::Rc;
use log::trace;
use remus::bus::Bus;
use remus::mem::Ram;
use remus::reg::Register;
use remus::{Block, Device, Machine};
use self::pixel::{Fetch, Fifo};
use self::sprite::Sprite;
use super::pic::{Interrupt, Pic};
use crate::... |
//! # gdb-command
//!
//! `gdb-command` is a library providing API for manipulating gdb in batch mode. It supports:
//!
//! * Execution of target program (Local type).
//! * Opening core of target program (Core type).
//! * Attaching to remote process (Remote type).
//!
//! # Example
//!
//! ```rust
//! use std::proces... |
use crate::{currency::BalanceLike, defi::CurrencyPair};
use codec::{Decode, Encode, MaxEncodedLen};
use composable_support::math::safe::{SafeAdd, SafeSub};
use frame_support::{
traits::{tokens::AssetId as AssetIdLike, Get},
BoundedVec, RuntimeDebug,
};
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Des... |
use super::*;
// Prefixes
const MAINNET_PREFIX: &str = "bitcoincash";
const TESTNET_PREFIX: &str = "bchtest";
const REGNET_PREFIX: &str = "bchreg";
// The cashaddr character set for encoding
const CHARSET: &[u8; 32] = b"qpzry9x8gf2tvdw0s3jn54khce6mua7l";
// The cashaddr character set for decoding
#[rustfmt::skip]
co... |
/*
Crowdloan rewards pallet used by contributors to claim their rewards.
A user is able to claim rewards once it has an associated account. Associating
an account using the `associate` extrinsic automatically yield the upfront
liquidity (% of the vested reward). The rest of the reward can be claimed every
`VestingStep... |
// Copyright (c) 2018-2021 <NAME> <<EMAIL>>
// Distributed under the MIT License
// (See acoompanying LICENSE file or a copy at http://opensource.org/licenses/MIT)
use hulc::{bdl, ctehexml, kyg, tbl};
use hulc2model::collect_hulc_data;
// Utilidades para tests ------------------
/// Redondea valor a 2 decimales
pub ... |
// Copyright 2022 <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 writi... |
use anyhow::{anyhow, Context};
use std::collections::HashMap;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::process::Command;
use tempfile::TempDir;
use url::Url;
use crate::models::DependencyKind;
static DEFAULT_GIT_SSH_USERNAME: &str = "git";
#[derive(Clone)]
pub enum Credentials {
Missing,
... |
//! RSA-based JWT algorithms: `RS*` and `PS*`.
pub use rsa::{errors::Error as RsaError, RsaPrivateKey, RsaPublicKey};
use rand_core::{CryptoRng, RngCore};
use rsa::{hash::Hash, BigUint, PaddingScheme, PublicKey, PublicKeyParts};
use sha2::{Digest, Sha256, Sha384, Sha512};
use core::{convert::TryFrom, fmt, str::FromS... |
use asm6502_derive::Asm6502;
use enum_dispatch::enum_dispatch;
#[derive(Debug, PartialEq)]
pub enum AddressMode {
Implicit,
Accumulator,
Immediate(u8),
Zero(u8),
ZeroX(u8),
ZeroY(u8),
Relative(i8),
Absolute(u16),
AbsoluteX(u16),
AbsoluteY(u16),
Indirect(u16),
IndirectX(u... |
// Copyright (c) 2018, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of condit... |
use std::{future::Future, path::Path, sync::Arc};
use instant::Instant;
use rend3::{Renderer};
use rend3::{
util::typedefs::{SsoString},
types::{Handedness},
};
use rend3_gltf::*; // GltfSceneInstance; from_slice_without_validation
use rend3_framework::{AssetPath};
use winit::{
event::{Event, KeyboardIn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.