text stringlengths 7.05k 33.9k |
|---|
//! Script to check the validity of `href` links in our HTML documentation.
//!
//! In the past we've been quite error prone to writing in broken links as most
//! of them are manually rather than automatically added. As files move over
//! time or apis change old links become stale or broken. The purpose of this
//! s... |
#![forbid(unsafe_code)]
use std::{
cmp::Ordering,
convert::{self, TryInto},
fmt, process,
str::FromStr,
};
struct Options {
/// The network pools that are searched for the network to be allocated.
pools: Vec<Subnet>,
/// When considering existing networks ignore these as bogus.
ignored... |
//! Abstraction allowing use of either PKCS1 PEM file or PKCS11 keys
//! for signing data.
use std::convert::{TryFrom, TryInto};
use std::{fmt, fs};
use anyhow::Result;
use serde::{Deserialize, Serialize};
use x509_parser::certificate::X509Certificate;
use crate::util::is_default;
#[derive(Clone, Debug, PartialEq)]... |
//! # ImGuizmo
//!
//! ```rust,no_run
//! # use imguizmo::{Gizmo, Matrix4};
//! # let view_matrix = Matrix4::default();
//! # let mut model_matrix = Matrix4::default();
//! # let ui = unsafe { std::mem::uninitialized() };
//! let gizmo = Gizmo::begin_frame(ui);
//!
//! gizmo
//! .builder(&view_matrix, &mut model_ma... |
#![allow(dead_code)]
use bit::BitIndex;
use bitflags::bitflags;
use core::ops::Range;
use paste;
use x86_64::registers::model_specific::Msr;
use crate::lapic::LocalApicMode;
#[derive(Debug)]
pub enum LocalApicRegister {
X2apic(Msr),
XapicOffset(u64),
}
impl LocalApicRegister {
pub fn new(mode: LocalApic... |
// Copyright 2021 The excelize-rs Authors. All rights reserved. Use of
// this source code is governed by a BSD-style license that can be found in
// the LICENSE file.
use serde::Deserialize;
use serde::Serialize;
/// XMLWorksheet directly maps the worksheet element in the namespace
/// http://schemas.openxmlformats.... |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::convert::TryFrom;
use fidl_fuchsia_media::AudioRenderUsage;
use fidl_fuchsia_... |
#![crate_name = "rboy"]
use rboy::device::Device;
use std::sync::mpsc::{self, Receiver, SyncSender, TryRecvError, TrySendError};
use std::sync::{Arc, Mutex};
use std::thread;
use cpal::traits::{HostTrait, DeviceTrait, StreamTrait};
// use glium::glutin::platform::desktop::EventLoopExtDesktop;
const EXITCODE_SUCCESS :... |
pub struct Advent;
use std::convert::TryInto;
#[derive(Debug)]
struct HashLife {
octree_by_hash: std::collections::HashMap<HashLifeOctree, usize>,
octrees: Vec<HashLifeOctree>,
result: Vec<Option<usize>>,
root: Vec<usize>,
}
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
struct H... |
use crate::cpu::cpu::Privilege;
use crate::cpu::trap::*;
pub const CSR_USTATUS: u16 = 0x000;
pub const CSR_UIE: u16 = 0x004;
pub const CSR_UTVEC: u16 = 0x005;
pub const CSR_USCRATCH: u16 = 0x040;
pub const CSR_UEPC: u16 = 0x041;
pub const CSR_UCAUSE: u16 = 0x042;
pub const CSR_UTVAL: u16 = 0x043;
pub const CSR_UIP: u... |
//! X.509 Certificate object definitions and operations
use crate::error::{X509Error, X509Result};
use crate::extensions::*;
use crate::time::ASN1Time;
use crate::traits::FromDer;
#[cfg(feature = "validate")]
use crate::validate::Validate;
use crate::x509::{
parse_serial, parse_signature_value, AlgorithmIdentifier... |
use crate::atoms::Atoms;
use crate::grid::Grid;
use crate::progress::Bar;
use crate::utils;
use crate::voxel_map::NonBlockingVoxelMap as VoxelMap;
use anyhow::{Context, Result};
use crossbeam_utils::thread;
use rustc_hash::FxHashSet;
/// A type to simplify the result of charge summing functions
type ChargeSumResult = ... |
use crate::{
event::Event,
prelude::*,
primitive::{Format, Timing},
};
/// Represents a Standard Midi File (.mid and .midi files).
/// Yields `TrackRepr` on a Vec, allowing for customization on what is stored in a track.
/// References an outside byte array.
#[derive(Clone, PartialEq, Eq, Debug)]
pub struc... |
// Copyright 2019 CoreOS, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
//! Functions for generating Java glue code.
mod jni;
mod types;
use crate::common::{
self, append_output, check_no_mangle, is_array_arg, is_array_arg_barefn, is_user_data_arg,
is_user_data_arg_barefn, parse_attr, retrieve_docstring, take_out_pat,
transform_fnarg_to_argcap, FilterMode, Outputs,
};
extern ... |
use crate::mnemonic::Language;
use crate::utils::FeeInfo;
use base64::DecodeError as Base64DecodeError;
use cosmos_sdk_proto::cosmos::base::abci::v1beta1::TxResponse;
use fmt::Debug;
use prost::DecodeError;
use prost::EncodeError;
use secp256k1::Error as CurveError;
use std::fmt::Display;
use std::fmt::Formatter;
use s... |
extern crate libc;
extern crate openssl_sys;
#[allow(non_camel_case_types,non_snake_case)]
pub mod bindings {
// Bindings are based on the ones generated by rust-bindgen. These can be generated like this:
// bindgen -I ~/path/mongo-rust-driver/mongoc-sys/mongo-c-driver-{version}/src/libbson/src/bson ~/path/mon... |
// Copyright 2020 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or di... |
use rhai::{Dynamic, Engine, EvalAltResult, Module, Scope, AST, INT};
use rustyline::config::Builder;
use rustyline::error::ReadlineError;
use rustyline::{Cmd, Editor, Event, EventHandler, KeyCode, KeyEvent, Modifiers, Movement};
use smallvec::smallvec;
use std::{env, fs::File, io::Read, path::Path, process::exit};
co... |
use std::collections::BTreeMap;
use std::convert::TryInto;
use abci::*;
use enclave_protocol::{EnclaveRequest, EnclaveResponse};
use integer_encoding::VarInt;
use kvdb::DBTransaction;
use log::{info, warn};
use parity_scale_codec::{Decode, Encode};
use protobuf::Message;
use serde::{Deserialize, Serialize};
use crate... |
//! Utilities for validating string and char literals and turning them into
//! values they represent.
//!
//! This file is copy-pasted from the compiler
//!
//! https://github.com/rust-lang/rust/blob/c6ac57564852cb6e2d0db60f7b46d9eb98d4b449/src/libsyntax/parse/unescape.rs
//!
//! Hopefully, we'll share this code in a... |
use eth2_hashing::{hash, hash32_concat, ZERO_HASHES};
use ethereum_types::H256;
use lazy_static::lazy_static;
use safe_arith::ArithError;
const MAX_TREE_DEPTH: usize = 32;
const EMPTY_SLICE: &[H256] = &[];
lazy_static! {
/// Zero nodes to act as "synthetic" left and right subtrees of other zero nodes.
static ... |
use crate::U256;
use std::mem::MaybeUninit;
// TODO: Square asm
#[inline(always)]
pub fn full_mul_asm(x: &U256, y: &U256) -> (U256, U256) {
const ZERO: u64 = 0;
let x = x.as_limbs();
let y = y.as_limbs();
let mut lo = MaybeUninit::<[u64; 4]>::uninit();
let mut hi = MaybeUninit::<[u64; 4]>::uninit(... |
use bdk::bitcoin::consensus::serialize;
use bdk::bitcoin::Address;
use bdk::blockchain::esplora::EsploraBlockchainConfig;
use bdk::blockchain::noop_progress;
use bdk::blockchain::Blockchain;
use bdk::blockchain::{
AnyBlockchain, AnyBlockchainConfig, ConfigurableBlockchain, ElectrumBlockchainConfig,
};
use bdk::data... |
use core::ops::{Mul, Sub};
use otspec::types::{Tag, Tuple, F2DOT14};
use permutation::Permutation;
use std::array::IntoIter;
use std::cmp::Ordering;
use std::collections::{HashMap, HashSet};
/// Structs to store locations (user and normalized)
/// A location in the user's coordinate space (e.g. wdth=200,wght=15)
pub ... |
// Copyright (c) SimpleStaking and Tezedge Contributors
// SPDX-License-Identifier: MIT
// #![forbid(unsafe_code)]
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use riker::actors::*;
use rocksdb::{Cache, DB};
use slog::{debug, error, info, Drain, Logger};
use configuration::{ColumnFactory, Roc... |
// This is an extremely simple collection of routines that can produce
// arbitrary 6502 code as a byte string. Especially useful for mappers
// which need to include arbitrary code that isn't provided by the file
// for whatever reason, but possibly also handy for units tests down
// the line.
use std::collections::H... |
use tensorflow::{ Tensor, Session, SessionOptions, Graph, SessionRunArgs, ImportGraphDefOptions };
use image::{ GenericImageView, imageops::FilterType, DynamicImage };
use imageproc::{ drawing, rect, filter, contrast, window };
use rusttype::{ Font, Scale };
use std::fs::File;
use std::io::prelude::*;
use std::path::P... |
//! # proc-macro-error
//!
//! This crate aims to make error reporting in proc-macros simple and easy to use.
//! Migrate from `panic!`-based errors for as little effort as possible!
//!
//! (Also, you can explicitly [append a dummy token stream](dummy/index.html) to your errors).
//!
//! To achieve his, this crate ser... |
use crate::actions::ParameterType;
use darling::{
util::{Flag, SpannedValue},
FromAttributes,
};
use gobject_core::{
util::{self, Errors},
ClassDefinition, PropertyStorage, PublicMethod, TypeContext, TypeMode,
};
use heck::ToKebabCase;
use proc_macro2::{Span, TokenStream};
use quote::{quote, quote_spann... |
use chrono::Duration;
use itertools::Either;
use itertools::Itertools;
use stable_marriage;
use std;
use strsim::levenshtein;
use todo_txt::task::Extended as Task;
use todo_txt::task::Recurrence;
use todo_txt::Date as TaskDate;
// These structs will be used in two stages: first with T=Task when matching tasks together... |
use std::{
arch::x86_64::*,
ops::{Add, Mul, Range, Sub},
};
use cgmath::Point3;
use super::Shape;
/// Represents the 3D version of the classical mandelbulb described [here][1].
///
/// [1]: http://www.skytopia.com/project/fractal/mandelbulb.html
#[derive(Clone)]
pub struct Mandelbulb<const P: u8> {
max_it... |
mod args;
mod colors;
mod hittable;
mod material;
mod math;
mod noise;
mod render;
mod scheduler;
mod texture;
mod writers;
use crate::noise::Perlin;
use args::TracerArgs;
use hittable::*;
use material::*;
use math::*;
use rand::rngs::SmallRng;
use rand::RngCore;
use rand::SeedableRng;
use rand_distr::{Distribution, U... |
use crate::dijkstra::potentials::cch_parallelization_util::SeparatorBasedParallelCustomization;
use crate::dijkstra::potentials::multi_metric_potential::metric_reduction::{reduce_metrics, MetricEntry};
use crate::dijkstra::potentials::multi_metric_potential::potential::MultiMetricPotentialContext;
use crate::graph::cap... |
use crate::priv_prelude::*;
use super::*;
/// A TCP packet
#[derive(Clone, PartialEq)]
pub struct TcpPacket {
buffer: Bytes,
}
#[derive(Clone, Debug, PartialEq)]
/// A selective ACK block of a TCP packet
pub struct SelectiveAck {
/// The initial sequence number that this SACK block is acknowledging
pub st... |
//! Abstractions for Matrix rooms.
use types::replies::*;
use types::messages::Message;
use types::events::Event;
use types::content::room::PowerLevels;
use crate::request::{MatrixRequestable, MatrixRequest};
use serde::Serialize;
use serde::de::DeserializeOwned;
use futures::*;
use crate::errors::*;
use http::Method;... |
use criterion::{
black_box, criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
};
use lexical_sort::{
cmp, lexical_cmp, lexical_only_alnum_cmp, natural_cmp, natural_lexical_cmp,
natural_lexical_only_alnum_cmp, natural_only_alnum_cmp, only_alnum_cmp,
};
use std::cmp::Ordering;... |
use crate::error::*;
use nom::
{
character::complete::*,
number::complete::*,
bytes::complete::*,
combinator::*,
sequence::*,
branch::*,
multi::*,
IResult,
Parser,
};
#[derive(Debug,Eq,PartialEq)]
enum Part
{
Part1,
Part2,
}
// TODO: day 19 pt2 is missing so far
/// # Examples
///
/// ```
/// # use adven... |
use crate::operator_construction::OperatorArgs;
use crate::operator_construction::OperatorConstructor;
use crate::Context;
use crate::CoordinateTuple;
use crate::GeodesyError;
// A HashMap would have been a better choice,for the OPERATOR_LIST, except
// for the annoying fact that it cannot be compile-time constructed
... |
use std::{
self,
fmt,
fs::File,
io::{self, Cursor, Read},
path::PathBuf,
sync::Arc,
time::Duration,
};
use super::{
cert_resolver::CertResolver,
Identity,
rustls,
untrusted,
webpki,
};
use Conditional;
use telemetry::tls_config_reload;
use futures::{future, stream, Fut... |
mod request;
use crate::config::{CAData, ClientConfig, Credentials};
use crate::k8s_types::K8sType;
use crate::resource::ObjectIdRef;
use crate::runner::metrics::ClientMetrics;
use futures_util::TryStreamExt;
use http::{Request, Response};
use hyper::client::Client as HyperClient;
use hyper::client::HttpConnector;
us... |
//! Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries
//! as python packages. This file contains the CLI and keyring integration.
//!
//! Run with --help for usage information
use bytesize::ByteSize;
use cargo_metadata::MetadataCommand;
use failure::{bail, Error, ResultExt};
#... |
use std::cmp::{max, min, Ordering};
use std::sync::{Arc, RwLock};
use cursive::align::HAlign;
use cursive::event::{Event, EventResult, MouseButton, MouseEvent};
use cursive::theme::{ColorStyle, ColorType, PaletteColor};
use cursive::traits::View;
use cursive::view::ScrollBase;
use cursive::{Cursive, Printer, Rect, Vec... |
use std::{fmt::Write, sync::Arc};
use prometheus::core::Collector;
use twilight_model::{
application::{
command::CommandOptionChoice,
component::{
button::ButtonStyle, select_menu::SelectMenuOption, ActionRow, Button, Component,
SelectMenu,
},
interaction::{
... |
// pathfinder/svg/src/lib.rs
//
// Copyright © 2019 The Pathfinder Project 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... |
use std::ffi::OsStr;
use std::fs::File;
use std::io::BufReader;
use std::slice;
use std::sync::Arc;
use std::{convert::TryInto, ffi::CStr};
use libc::{c_char, size_t};
use rustls::{
Certificate, ClientConfig, ClientSession, RootCertStore, ServerCertVerified,
SupportedCipherSuite, TLSError, ALL_CIPHERSUITES,
};... |
use std::cmp::{Ordering, Reverse};
use std::collections::BinaryHeap;
use std::iter::FromIterator;
#[cfg(feature = "serde")]
use serde_crate::{Deserialize, Serialize};
use smallvec::{SmallVec, smallvec};
use smartstring::alias::String as SmartString;
use content_tree::Toggleable;
use diamond_core::{AgentId, CRDT_DOC_R... |
//! This module is a rough prototype Rust SDK. It can be used to create closures that look sort of
//! like normal workflow code. It should only depend on things in the core crate that are already
//! publicly exposed.
//!
//! Needs lots of love to be production ready but the basis is there
mod conversions;
mod payloa... |
use itertools::izip;
use std::collections::HashMap;
use tui::{
backend::Backend,
layout::{Constraint, Direction, Layout, Rect},
widgets::Text,
Frame, Terminal,
};
use canvas_colours::*;
use dialogs::*;
use widgets::*;
use crate::{
app::{
self,
layout_manager::{BottomColRow, Bottom... |
//! x86 run-time feature detection is OS independent.
#[cfg(target_arch = "x86")]
use arch::x86::*;
#[cfg(target_arch = "x86_64")]
use arch::x86_64::*;
use mem;
use crate::detect::{Feature, cache, bit};
/// Performs run-time feature detection.
#[inline]
pub fn check_for(x: Feature) -> bool {
cache::test(x as u3... |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#![cfg(test)]
pub mod virtualization;
use std::collections::HashMap;
use fidl_fuchsia_net as net;
use fidl_fuchsia_net_dhcp as dhcp;
use fidl_fuchsia_ne... |
use crate::chip_library::{ChipLibrary, PackChip};
use crate::components::{ChipSortOptions, chips::PackChipComponent, sort_box::ChipSortBox};
use yew::prelude::*;
use yew::agent::{Dispatcher, Dispatched};
use yewtil::function_component;
use crate::agents::{
global_msg::{GlobalMsgBus, Request as GlobalMsgReq},
ch... |
// Static File handler
// -> Most of the file is borrowed from https://github.com/seanmonstar/warp/blob/master/src/filters/fs.rs
use bytes::{Bytes, BytesMut};
use futures::future::Either;
use futures::{future, ready, stream, FutureExt, Stream, StreamExt, TryFutureExt};
use headers::{
AcceptRanges, ContentLength, C... |
//! Specific packets
use std::convert::From;
use std::error::Error;
use std::fmt;
use std::io::{self, Read, Write};
#[cfg(feature = "async")]
use tokio::io::{AsyncRead, AsyncReadExt};
use crate::control::fixed_header::FixedHeaderError;
use crate::control::variable_header::VariableHeaderError;
use crate::control::Con... |
mod attestation_service;
mod block_service;
mod cli;
mod config;
mod duties_service;
mod fork_service;
mod initialized_validators;
mod is_synced;
mod key_cache;
mod notifier;
mod validator_duty;
mod validator_store;
pub mod http_api;
pub use cli::cli_app;
pub use config::Config;
use account_utils::validator_definiti... |
//! Implementation of the paper
//! <NAME>, 2001, Sparse Matrix Multiplication Package (SMPP)
use crate::indexing::SpIndex;
use crate::sparse::prelude::*;
use crate::sparse::CompressedStorage::CSR;
#[cfg(feature = "multi_thread")]
use rayon::prelude::*;
#[cfg(feature = "multi_thread")]
use std::cell::RefCell;
/// Co... |
/* Copyright (c) 2021 <NAME> (<EMAIL>)
*
* 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,... |
//! Particle dynamics and interactions
use std::fmt::{Debug};
use mpi::traits::*;
use rand::prelude::*;
use rand_distr::{StandardNormal, Exp1};
use rayon::prelude::*;
mod electron;
mod photon;
mod ion;
mod vec3;
mod hgram;
mod interactions;
// Re-export for use in main
pub use self::electron::*;
pub use self::photon... |
use nalgebra::SMatrix;
use nalgebra::SVector;
use wasm_bindgen::prelude::*;
const SIZE_X: usize = 20;
const SIZE_Y: usize = 20;
const FLAT_SIZE: usize = SIZE_X * SIZE_Y;
#[wasm_bindgen]
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum Cell {
Wall = 0,
Pass = 1,
Entrance = 2,
Treasury = 3,
Subtreasur... |
/*
* 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... |
use crate::ast::*;
use crate::lexer::Token;
use std::rc::Rc;
use std::cell::RefCell;
use std::collections::HashMap;
use std::fmt;
#[derive(Clone)]
pub enum Object {
Bool(bool),
Int(i64),
StringLiteral(String),
Array(Vec<Object>),
Null,
Function { func: Expression, env: Env },
Return(Box<Ob... |
#![feature(plugin, test)]
#![allow(unknown_lints)]
#![allow(clippy::if_not_else, unused_features, clippy::clone_on_ref_ptr, clippy::clunreadable_literal, mixed_script_confusables, confusable_idents)]
#![warn(missing_debug_implementations, missing_copy_implementations,
trivial_casts, trivial_numeric_casts,
unused_impo... |
extern crate rand;
use std::fmt;
use std::any::Any;
use std::sync::{Arc, RwLock};
use std::thread;
use super::{
layertype::LayerType,
layer::Layer,
dense::Dense,
vectorops
};
use super::super::{
activation::Activation,
neatenv::NeatEnvironment,
};
use crate::Genome;
/// LSTM State... |
use crate::{
instr::Instr,
opc::{BinOpKind, Op, UnOpKind},
sifv::SifVal,
};
use sifc_err::compile_err::{CompileErr, CompileErrTy};
use sifc_parse::{
ast::AstNode,
token::{Token, TokenTy},
};
use std::collections::HashMap;
/// CompileResult contains information generated by the compiler after
///... |
// MIT License
// Copyright (c) 2018-2021 The orion Developers
// 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, cop... |
use std::time::Duration;
use std::thread;
use console::{style, Term};
use lib::{
Forge, Address, ImplicitAddress, ImplicitOrOriginatedWithManager,
NewOperationGroup, NewOperation, NewTransactionOperation, NewRevealOperation,
NewTransactionOperationBuilder, NewDelegationOperationBuilder,
KeyDerivationPa... |
use super::args::ContainerArgs;
use crate::apparmor;
use crate::{
capabilities, hooks, namespaces::Namespaces, process::channel, rootfs, rootless::Rootless,
seccomp, tty, utils,
};
use anyhow::{bail, Context, Result};
use nix::mount::mount as nix_mount;
use nix::mount::MsFlags;
use nix::sched::CloneFlags;
use n... |
//! Payload creation/validation subcomponent
use crate::consensus::{block_maker::SubnetRecords, metrics::PayloadBuilderMetrics};
use ic_interfaces::{
consensus::{PayloadPermanentError, PayloadTransientError, PayloadValidationError},
ingress_manager::IngressSelector,
messaging::XNetPayloadBuilder,
regis... |
#![no_std]
#![no_main]
// pick a panicking behavior
// extern crate panic_abort; // requires nightly
// extern crate panic_itm; // logs messages over ITM; requires ITM support
#[cfg(not(debug_assertions))]
extern crate panic_halt; // you can put a breakpoint on `rust_begin_unwind` to catch panics
#[cfg(debug_assertio... |
// SPDX-License-Identifier: Apache-2.0
#![warn(unused_extern_crates)]
use crate::executor::Executor;
use automata_primitives::Block;
use automata_runtime::RuntimeApi;
use fc_consensus::FrontierBlockImport;
use fc_rpc_core::types::PendingTransactions;
use futures::prelude::*;
use grandpa::{self};
use sc_client_api::{E... |
// This file is part of Bit.Country.
// Extension of orml vesting schedule to support multi-currencies vesting.
// Copyright (C) 2020-2021 Bit.Country.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Li... |
#![no_std]
use bit_field::BitField;
use embedded_hal::{blocking::delay::DelayUs, digital::v2::OutputPin};
/// A device driver for the AD9959 direct digital synthesis (DDS) chip.
///
/// This chip provides four independently controllable digital-to-analog output sinusoids with
/// configurable phase, amplitude, and fr... |
/*! Last stander AI */
/*
Author: <NAME> <<EMAIL>>
SPDX-License-Identifier: AGPL-3.0-or-later
*/
use bevy::app::Events;
use bevy::asset::AssetServer;
use bevy::audio::Audio;
use bevy::ecs::{ Commands, Entity, Mut, Query, Res, ResMut, Without };
use bevy::math::{ Quat, Vec3 };
use bevy::transform::components::Transf... |
use std::str::FromStr;
use crate::errors::*;
/// Additional version functionality
pub trait VersionExt {
/// Increments the major version number for this Version.
fn increment_major(&mut self);
/// Increments the minor version number for this Version.
fn increment_minor(&mut self);
/// Increments ... |
use if_chain::if_chain;
use rustc_ast::ast::{FloatTy, LitKind};
use rustc_errors::Applicability;
use rustc_hir::def::Res;
use rustc_hir::{BinOpKind, Expr, ExprKind, Path, PathSegment, PrimTy, QPath, Ty, TyKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use ... |
use byteorder::{ByteOrder, LittleEndian};
use crc::crc32;
use std::fmt::{self, Debug};
use std::io::{self, Read};
const LENGTH_CRC_OFFSET: usize = 8;
const DATA_OFFSET: usize = LENGTH_CRC_OFFSET + 4;
const HEADER_LENGTH: usize = DATA_OFFSET;
const FOOTER_LENGTH: usize = 4;
/// State for reading one `TfRecord`, potent... |
mod codeview;
mod debug;
mod dwarf;
mod gimli_writer;
mod x64;
use crate::local_env::*;
use crate::node::*;
use debug::*;
use object::{write::*, *};
use std::collections::BTreeMap;
use std::collections::HashMap;
use std::convert::*;
use std::ffi::OsStr;
use std::io::Write;
use std::path::*;
// Names for special symbo... |
//! This circuit is NOT AUDITED, USE AT YOUR OWN RISK.
use std::marker::PhantomData;
use bellperson::{
gadgets::{boolean::AllocatedBit, num::AllocatedNum},
Circuit, ConstraintSystem, LinearCombination, SynthesisError,
};
use blstrs::Scalar as Fr;
use ff::{Field, PrimeFieldBits};
use filecoin_hashers::{HashFun... |
use crate::components::toolbar::ToolbarModel;
use crate::post::Post;
use crate::query_dsl;
use crate::AppRoute;
use cynic::GraphQLResponse;
use cynic::MutationBuilder;
use serde::Deserialize;
use web_sys::Node;
use yew::virtual_dom::VNode;
use yew::{
format::Json,
prelude::*,
services::fetch::{FetchService,... |
use std::io::{self, Read, Write, StdinLock, StdoutLock};
use llvm;
use llvm::core::*;
use llvm::execution_engine::*;
use llvm::target::*;
use std::{mem, ptr};
use ::bf::{BFInstr, BF_MEMORY_SIZE, BFCellValue};
macro_rules! cstring {
($s:expr) => (
concat!($s, '\0').as_ptr() as *const _
)
}
struct BFLLVMInfo {
con... |
use super::{errors::ParserErrorKind, ParsedModule, Precedence};
use crate::lexer::Lexer;
use crate::token::{Keyword, SpannedToken, Token, TokenKind};
use crate::{
ast::{ArraySize, Expression, ExpressionKind, Statement, Type},
FieldElementType,
};
use super::infix_parser::InfixParser;
use super::prefix_parser::... |
#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(clippy::float_cmp, clippy::many_single_char_names, clippy::cast_lossless)]
#[macro_use]
extern crate glium;
use rand;
#[macro_use]
extern crate imgui;
use imgui_glium_renderer;
#[macro_use]
extern crate bad3d;
#[macro_use]
extern crate failure;
#[macro_use]
mo... |
//! # path_semantics_std
//! A Rust type checked implementation of the standard dictionary of path semantics using constrained functions
//!
//! *Notice! This library is in early stage of development and might contain bugs and missing features!*
//!
//! ### Example: Proving addition of even numbers
//!
//! ```ignore
//... |
mod brute;
mod resolver;
use clap::{App, Arg, ArgMatches, Values};
use colored::*;
use futures::prelude::*;
use futures::stream;
use std::net::IpAddr;
use std::path::Path;
use std::time::Duration;
use stream_throttle::{ThrottlePool, ThrottleRate};
use trust_dns_client::rr::rdata::caa::Value;
use trust_dns_client::rr::... |
use prelude::*;
#[derive(Debug, Default)]
pub struct MerkleTree<D, T> where D: DataStorageReadonly, T: TreeStorage {
data: D,
tree: T,
}
impl <D, T> MerkleTree<D, T> where D: DataStorageReadonly, T: TreeStorage {
/// Creates an instance without checking of data integrity
pub fn new_unchecked(data: D,... |
// Forked from https://github.com/paritytech/substrate/tree/master/frame/treasury
// Copyright 2021 DICO Developer.
// This file is part of DICO
// 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 Licen... |
use std::cell::{RefCell, RefMut};
use std::collections::BTreeMap;
use smallvec::SmallVec;
use vec_map::VecMap;
use bw_dat::{order, UnitId, UpgradeId, OrderId};
use bw_dat::expr::{BoolExpr, IntExpr, IntExprTree};
use bw_dat::{Game, Unit};
use crate::config::Config;
use crate::unit::{self, UnitExt};
ome2_thread_local... |
#![allow(unused)] // temporary
use crate::crh::TwoToOneCRH;
use crate::CRH;
use ark_ff::ToBytes;
use ark_std::vec::Vec;
#[cfg(feature = "r1cs")]
pub mod constraints;
pub trait Config {
type LeafHash: CRH;
type TwoToOneHash: TwoToOneCRH;
}
pub type TwoToOneDigest<P> = <<P as Config>::TwoToOneHash as TwoToOne... |
use crate::strmap::MappedStr;
use super::error::{AsylResult, AsylInSpan, AsylSpan, AsylError, AsylErrorType, merge_span};
use super::expr::{AsylExpr, AsylExprValue};
use super::scope::AsylEnv;
#[derive(Debug)]
pub enum AsylTokenValue {
Symbol(MappedStr),
String(MappedStr),
Paren(bool),
}
pub struct AsylToken(As... |
//! Code for exporting events from the channel manager.
#![allow(dead_code, unreachable_pub)]
use futures::{Stream, StreamExt};
use postage::watch;
use std::{
fmt,
time::{Duration, Instant},
};
/// The status of our connection to the internet.
#[derive(Default, Debug, Clone)]
pub struct ConnStatus {
/// H... |
// Copyright © 2019 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
extern crate vm_virtio;
use linux_loader::cmdline::Cmdline;
use net_util::MacAddr;
use std::convert::From;
use std::net::AddrParseError;
use std::net::Ipv4Addr;
use std::path::Path;
use std::result;
use vm_memory::GuestAddress;
use vm_... |
use crate::reader::MobiReader;
use std::io;
const DRM_ON_FLAG: u32 = 0xFFFF_FFFF;
const EXTH_ON_FLAG: u32 = 0x40;
#[derive(Debug, PartialEq)]
pub enum TextEncoding {
CP1252,
UTF8,
}
#[derive(Debug, PartialEq, Default)]
/// Strcture that holds Mobi header information
pub struct MobiHeader {
pub identifier... |
// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use std::collections::VecDeque;
use std::fmt::{self, Display};
use std::fs::File;
use std::io::{self, stdin, stdout, Read, Write};
use std::os::unix::i... |
// Copyright 2019 numid Developers
//
// Licensed under the MIT license <LICENSE or
// http://opensource.org/licenses/MIT>. This file may not be
// copied, modified, or distributed except according to those terms.
/*!
This crate provide the `numid!` macro for creating numerical id.
Each new instance of your id is gua... |
use std::sync::mpsc::{channel, Receiver};
use std::sync::Arc;
use std::sync::Mutex;
use std::time::{Duration, Instant};
use std::{thread, time};
use futures::channel::mpsc::UnboundedSender;
use rand::Rng;
#[cfg(test)]
pub mod config;
pub mod errors;
pub mod persister;
#[cfg(test)]
mod tests;
use self::errors::*;
use... |
extern crate gl;
extern crate sdl2;
use gl::types::*;
use std::ffi::CString;
use std::mem;
use std::os::raw::c_void;
use std::ptr;
use std::str;
use egui::{
math::clamp,
paint::{Color32, Mesh, Texture},
vec2, ClippedMesh,
};
#[derive(Default)]
struct UserTexture {
size: (usize, usize),
/// Pendin... |
//! Kernel-userland system call interface for RISC-V architecture.
use core::fmt::Write;
use crate::csr::mcause;
use kernel;
use kernel::syscall::ContextSwitchReason;
/// This holds all of the state that the kernel must keep for the process when
/// the process is not executing.
#[derive(Default)]
#[repr(C)]
pub str... |
//! Common types for the Cretonne code generator.
use std::default::Default;
use std::fmt::{self, Debug, Display, Formatter};
/// The type of an SSA value.
///
/// The `VOID` type is only used for instructions that produce no value. It can't be part of a SIMD
/// vector.
///
/// Basic integer types: `I8`, `I16`, `I32... |
// 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 {
anyhow::{format_err, Context as _, Error},
fdio::{SpawnAction, Spaw... |
use std::cmp::Ordering;
use std::collections::{hash_map::Entry, BinaryHeap, HashMap, HashSet};
use std::fmt;
use std::net::{IpAddr, SocketAddr, ToSocketAddrs};
use std::str::FromStr;
use std::sync::{Arc, RwLock};
use std::thread;
use std::time::{Duration, Instant};
use tapyrus::BlockHash;
use crate::chain::Network;
u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.