text stringlengths 7.05k 33.9k |
|---|
use super::{input::ProcessedInput, ThirdPersonCameraState, ThirdPersonControlConfig};
use voxel_mapper::{
collision::{floor_translation::translate_over_floor, VoxelBVT},
geometry::{project_point_onto_line, upgrade_ray, Line, UP},
voxel::{
search::greedy_path_with_l1_and_linear_heuristic, voxel_cent... |
use crate::commands::classified::block::run_block;
use crate::commands::default_context::create_default_context;
use crate::evaluation_context::EvaluationContext;
use crate::prelude::*;
use crate::script::{print_err, run_script_standalone};
#[allow(unused_imports)]
pub(crate) use crate::script::{process_script, LineRe... |
// 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.
use {
crate::model::*,
cm_rust::{
self, CapabilityPath, ExposeDecl, ExposeSource, FrameworkCapabilityDecl, OfferDecl,
OfferDirector... |
mod model_checking;
use model_checking::dfa::*;
use model_checking::mdp::*;
use model_checking::decomp_team_mdp::*;
use model_checking::helper_methods::*;
use std::time::{Duration, Instant};
fn main() {
// -------------------------------
// Task Scalability
// -------------------------------
//let mdp_... |
use std::{
collections::HashMap,
ffi::OsString,
fmt::Display,
io,
panic::catch_unwind,
path::{Path, PathBuf},
sync::atomic::{AtomicUsize, Ordering},
time::{Duration, Instant},
};
use crossbeam::channel::{unbounded, Receiver, Sender};
use rayon::join;
use rome_console::{
codespan::{L... |
//! SCSI Commands using the Linux SCSI Generic (sg3) driver
//!
//! # Overview
//!
//! The Linux sg driver interface allows userspace to craft and send
//! SCSI commands to SCSI devices present on the system.
//!
//! More information can be found [here](http://sg.danny.cz/sg/p/sg_v3_ho.html).
//!
//! Currently, this li... |
// 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.
use crate::base::SettingInfo;
use crate::display::light_sensor::{open_sensor, read_sensor, Sensor};
use crate::display::types::LightData;
use crate::handler... |
use chrono::{DateTime, Utc};
use data_url::DataUrl;
use der_parser::der::{
der_read_element_header, parse_der_ia5string, parse_der_null, parse_der_octetstring,
parse_der_oid, parse_der_sequence_defined_g, parse_der_sequence_of,
};
use der_parser::error::{BerError, BerResult};
use log::{debug, info};
use memmem:... |
// 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.
use crate::fs::*;
use crate::task::*;
use crate::types::*;
use fuchsia_zircon as zx;
use parking_lot::RwLock;
use std::collections::hash_map::Entry;
use st... |
use std::fs::{self, File};
use std::io::prelude::*;
use std::io::SeekFrom;
use std::path::{self, Path, PathBuf};
use std::sync::Arc;
use flate2::read::GzDecoder;
use flate2::{Compression, GzBuilder};
use log::debug;
use serde_json::{self, json};
use tar::{Archive, Builder, EntryType, Header};
use crate::core::compile... |
// Copyright 2020 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0
use super::TestClient;
use log::info;
use parsec_client::core::interface::requests::{Opcode, ResponseStatus};
use rand::Rng;
use rand::{
distributions::{Alphanumeric, Distribution, Standard},
thread_rng,
};
use std::con... |
use core::fmt;
#[cfg(feature = "std")]
use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd};
use crate::internal_prelude::*;
/// The size of an `inotify_event` struct, not including the optional name at the end.
const EVENT_SIZE: usize = core::mem::size_of::<libc::inotify_event>();
/// The minimum buffer size to ... |
use core::fmt;
use std::collections::BTreeMap;
use itertools::Itertools;
use tracing::{debug, error, info, info_span, warn};
use ibc::core::{
ics02_client::client_state::{ClientState, IdentifiedAnyClientState},
ics03_connection::connection::{IdentifiedConnectionEnd, State as ConnectionState},
ics04_channe... |
// Copyright 2019 Intel Corporation. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use crate::{
ActivateError, EpollHelper, EpollHelperError, EpollHelperHandler, GuestMemoryMmap,
GuestRegionMmap, Queue, VirtioInterrupt, EPOLL_HELPER_EVENT_LAST, VIRTIO_F_IN_ORDER,
VIRTIO_F_NOTIFICATION_DATA, V... |
#![forbid(unsafe_code)]
use glsp::{stock_syms::*, DequeAccess, DequeOps, Engine, SymKind, Val};
use proc_macro::{TokenStream, TokenTree, TokenTree::Literal};
use std::char;
use std::collections::{hash_map::Entry, HashMap};
use std::fmt::Write;
use std::str::FromStr;
#[doc(hidden)]
#[proc_macro]
pub fn lazy_key(input:... |
#![allow(
clippy::cast_possible_wrap,
clippy::derive_partial_eq_without_eq,
clippy::let_underscore_drop,
clippy::match_same_arms,
clippy::similar_names,
clippy::too_many_lines
)]
mod name;
mod parse;
mod render;
use crate::name::Crate;
use crate::render::render;
use anyhow::{ensure, Result};
u... |
// Copyright (c) 2018-2021 The MobileCoin Foundation
//! SGX Error types
use core::{convert::TryFrom, result::Result as StdResult};
use displaydoc::Display;
use mc_sgx_core_types_sys::{
sgx_status_t, SGX_ERROR_AE_INVALID_EPIDBLOB, SGX_ERROR_AE_SESSION_INVALID,
SGX_ERROR_ATT_KEY_CERTIFICATION_FAILURE, SGX_ERRO... |
use winapi::um::winuser::{GetForegroundWindow};
use winapi::shared::windef::{HWND};
use winapi::shared::d3d9::{IDirect3DSurface9, D3DADAPTER_DEFAULT, D3D_SDK_VERSION,
Direct3DCreate9, D3DCREATE_SOFTWARE_VERTEXPROCESSING, IDirect3DDevice9,
IDirect3D9};
use winapi::shared::d3d9types::{D3DDISPLAYMODE, D3DPOOL_SYS... |
use crate::str_placeholder;
use proc_macro2::{Ident, Span, TokenStream};
use proc_macro_error::{abort, emit_error};
use quote::quote;
use std::ops::Deref;
use syn::{
parse::ParseStream, parse_quote, punctuated::Punctuated, token::Comma, Attribute, DeriveInput,
Expr, ExprLit, Lit, Meta, MetaList, MetaNameValue, ... |
#![allow(unused_doc_comments)]
extern crate indexmap;
extern crate regex;
extern crate which;
extern crate serde;
extern crate serde_json;
#[macro_use]
extern crate lazy_static;
// conan.cmake wrapper reference
// https://github.com/conan-io/cmake-conan/blob/develop/conan.cmake
use std::env;
use std::fmt;
use std:... |
use std::fmt;
use rand::seq::SliceRandom;
use rand::Rng;
// Some teas can only be in a certain set of containers. For instance, hohins
// will only hold some kind of green tea.
//
// Also, some adjectives only fit certain teas. example: Kangra => green tea,
// Irish => black tea.
//
// Some teas are only good at a ce... |
// Copyright 2017 Parity Technologies (UK) Ltd.
// Copyright 2020 Netwarps Ltd.
//
// 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 ... |
use crate::math::{Isometry, Point, Vector};
use crate::shape::{ConvexPolygonalFeature, ConvexPolyhedron, FeatureId, SupportMap};
use crate::transformation;
use crate::utils::{self, IsometryOps, SortedPair};
use na::{self, Point2, Point3, RealField, Unit};
use std::collections::hash_map::Entry;
use std::collections::Has... |
// Copyright 2020 Folyd
// Copyright 1999 Google 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applica... |
use std::collections::HashMap;
use postgres::{types::ToSql, Row};
use rocket::http::Status;
use rocket::serde::{json::Json, msgpack::MsgPack, Deserialize, Serialize};
use uuid::Uuid;
use crate::db;
use conductor_common::producer as producer_com;
use conductor_common::schema as schema_com;
use conductor_common::error a... |
extern crate chrono;
extern crate csv;
extern crate githelper;
extern crate regex;
extern crate rustc_serialize;
extern crate walkdir;
#[macro_use]
extern crate log;
use chrono::*;
use regex::Regex;
use std::cmp::Ordering;
use std::collections::BTreeMap as DataMap;
use std::collections::BTreeSet as DataSet;
use std::... |
use crate::app::{App, AppAssets};
use crate::state::{MatchState, UiEvent};
use std::collections::VecDeque;
use super::{frame, WidgetId, FOOTER_HEIGHT};
use crate::layout::dynamic_matrix::Matrix;
use crate::layout::{DynamicIds, WidgetHolder};
use conrod::Scalar;
use conrod_core::UiCell;
use conrod_core::{
color,
... |
use std::{
cell::RefCell,
collections::{HashMap, VecDeque},
rc::Rc,
};
use femtovg::TextContext;
use glutin::{
event::{ElementState, VirtualKeyCode},
event_loop::{ControlFlow, EventLoop, EventLoopProxy},
};
use vizia_core::{
apply_clipping, apply_hover, apply_styles, apply_text_constraints, ap... |
use std::error::Error;
use std::io::prelude::*;
use std::io::SeekFrom;
use midly::{MetaMessage, Smf};
use crate::bgm::*;
use crate::rw::*;
pub fn is_midi<R: Read + Seek>(file: &mut R) -> Result<bool, std::io::Error> {
let previous_pos = file.pos().unwrap_or_default();
file.seek(SeekFrom::Start(0))?;
let... |
use web3::types::{Address, H256};
use super::*;
use crate::components::server::index_node::VersionInfo;
use crate::components::transaction_receipt;
use crate::data::subgraph::status;
use crate::data::{query::QueryTarget, subgraph::schema::*};
pub trait SubscriptionManager: Send + Sync + 'static {
/// Subscribe to... |
use fxhash::FxHashMap; // Faster
//use fnv::FnvHashMap;
macro_rules! max {
($x: expr, $y: expr) => {{
if $x > $y { $x } else { $y }
}}
}
macro_rules! abs {
($x: expr) => {{
if $x >= 0 { $x } else { -$x }
}}
}
macro_rules! ewavefront_diagonal {
($h: expr, $v: expr) => {{
$h... |
use digest::Digest;
use sha2::Sha256;
use rand::{thread_rng, Rng};
use rand::seq::SliceRandom;
use secp256k1zkp as secp;
use secp::Secp256k1;
use secp::key::{SecretKey, PublicKey, ZERO_KEY};
use super::nizk::{RevelioPoK, RepresentationPoK};
const MAX_AMOUNT_PER_OUTPUT: u64 = 1000;
pub const GENERATOR_G : [u8;65] = [... |
// TODO: we need to know when the inline style changes so either we need to attach listener
// to the CssStyleDeclaration (which I'd like to avoid) or we need el.set_style(&style)
// and then in JS we need to not only call style.set_property() but also set/clone it
// to the element, maybe in raf(() =... |
//! This module contains utilities for generating keyboard matrix on the first use time. Once that
//! is done, this module is not needed anymore. Keyboard matrix is generated by pressing through
//! every single key in keyboard. The matrix is saved by copy pasting rust source code snippet that
//! is generated by thes... |
use std::collections::HashMap;
use std::sync::Arc;
use holo_hash::{AgentPubKey, DhtOpHash, HeaderHash};
use holo_hash::{AnyDhtHash, EntryHash};
use holochain_keystore::AgentPubKeyExt;
use holochain_p2p::{HolochainP2pCell, HolochainP2pCellT};
use holochain_state::mutations;
use holochain_state::prelude::{
current_c... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved0: [u8; 160usize],
#[doc = "0xa0 - GPIO0 / (ANA) (Pin 50) Pad Config"]
pub gpio_pad_config_0: crate::Reg<gpio_pad_config_0::GPIO_PAD_CONFIG_0_SPEC>,
_reserved1: [u8; 2usize],
#[doc = "0xa4 - GPIO1 (Pin 55) Pad Config"]
pub... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
backup_types::{
epoch_ending::restore::EpochHistory,
transaction::manifest::{TransactionBackup, TransactionChunk},
},
metrics::{
restore::{TRANSACTION_REPLAY_VERSION, TRANSACTION_SAVE_VER... |
#![doc(html_root_url = "https://docs.rs/thermostat")]
#![doc(issue_tracker_base_url = "https://github.com/uber-foo/thermostat/issues/")]
#![deny(
missing_docs, missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code,
unstable_features, unused_import_braces, unused_qualifications, unused_... |
// 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.
//! Fake queue for simulating driver interactions in unittests
//!
//! To facilitate writing unittests it is useful to manipulate the queues from the persp... |
use super::message::Message;
use super::peer;
use crate::network::server::Handle as ServerHandle;
use crossbeam::channel;
use log::{debug, warn};
use std::sync::{Arc, Mutex};
use crate::blockchain::{Blockchain, State};
use crate::block::{Block, Header, Content};
use crate::crypto::hash::{H256, Hashable, H160};
use std:... |
// 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 crate::{data, render, settings};
use render::{
Buffer, Context, Framebuffer, Uniform, UniformBlock, UniformValue, VertexArrayObject,
VertexBufferLayout,
};
use settings::Settings;
use bytemuck::{Pod, Zeroable};
use crevice::std140::AsStd140;
use glow::HasContext;
use std::rc::Rc;
static LINE_VERT_SHADER: ... |
//! Collection of CFOP related tools.
use crate::matrix;
use crate::matrix::{same_color_check, PermutationMatrix};
use crate::{Command, Move};
const R: [u8; 9] = [0, 1, 2, 3, 4, 5, 6, 7, 8];
const L: [u8; 9] = [9, 10, 11, 12, 13, 14, 15, 16, 17];
const U: [u8; 9] = [18, 19, 20, 21, 22, 23, 24, 25, 26];
const D: [u8; ... |
//! Capture the screen with DXGI Desktop Duplication
//! This is a modified version of: https://github.com/bryal/dxgcap-rs
#![cfg(windows)]
extern crate winapi;
extern crate wio;
use std::mem::zeroed;
use std::{mem, ptr, slice};
use log::warn;
use winapi::shared::dxgi::{
CreateDXGIFactory1, IDXGIAdapter, IDXGI... |
use byteorder::{LittleEndian, ReadBytesExt};
use std::fs::File;
use std::io::{Read, BufReader, Seek, SeekFrom, Cursor};
use block_modes::{BlockMode, Ecb, block_padding::ZeroPadding};
use aes_soft::Aes256;
use flate2::read::ZlibDecoder;
use crate::assets::{FGuid, Newable, ReaderCursor, read_string, read_tarray, ParserRe... |
use crate::{core::*, util::get_mip_extent};
use std::{collections::HashMap, num::NonZeroU32};
use wgpu::{
util::make_spirv, AddressMode, BindGroupDescriptor, BindGroupEntry, BindGroupLayout,
BindGroupLayoutDescriptor, BindGroupLayoutEntry, BindingResource, BindingType, CommandEncoder,
CullMode, Device, Filt... |
use crate::Operator;
use palette::{Blend, LinSrgb, LinSrgba, Srgb, Srgba};
lazy_static::lazy_static! {
static ref SRGB_TO_F32_TABLE: [f32;256] = generate_srgb8_to_linear_f32_table();
static ref F32_TO_U8_TABLE: [u32;104] = generate_linear_f32_to_srgb8_table();
}
fn generate_srgb8_to_linear_f32_table() -> [f32... |
//! Unwind information for System V ABI (x86-64).
use crate::ir::{Function, Inst, InstructionData, Opcode, Value};
use crate::isa::{
unwind::systemv::{CallFrameInstruction, RegisterMappingError, UnwindInfo},
x86::registers::RU,
CallConv, RegUnit, TargetIsa,
};
use crate::result::{CodegenError, CodegenResul... |
//! Helper functions for interfacing with the windows specific Win32 API, mainly
//! the security base API.
//!
//! Note that Win32 API is not only for 32 bit machines, but also *the* C API of
//! 64 bit windows.
use crate::error::{AllocErr, SysErr};
use alloc::alloc;
use core::alloc::Layout;
use core::ptr::NonNull;
u... |
//! Koleksi query yang digunakan untuk operasi pada rest API Village
#![allow(missing_docs)]
use actix_web::{HttpRequest, HttpResponse};
use chrono::NaiveDateTime;
use diesel::prelude::*;
use serde::{Deserialize, Serialize};
use serde_json::Value as JsonValue;
use validator::Validate;
use crate::{
api,
api::t... |
#![feature(used, lang_items, const_fn)]
extern crate kvm;
extern crate memmap;
extern crate x86;
use kvm::{Capability, Exit, IoDirection, Segment, System, Vcpu, VirtualMachine};
use memmap::{Mmap, Protection};
use std::fs::File;
use std::io::{BufRead, BufReader, Write};
use std::io;
use x86::shared::control_regs::*;... |
// Copyright 2019 Intel Corporation. All Rights Reserved.
//
// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
//
// SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause)
extern crate log;
extern crate net_ut... |
use std::collections::{HashMap, VecDeque};
use std::sync::Arc;
use std::time::Duration;
use actix::prelude::*;
use log::{error, trace, warn};
use rand::prelude::*;
use crate::{server::GameServer, word_pack::WordPack, Event};
const ROUND_LIMIT: Duration = Duration::from_secs(120);
struct LobbyState {
pub host: u... |
pub mod parse;
use indexmap::map::IndexMap;
use regex::Regex;
use serde_json::map::Map;
use serde_json::{self, Value};
use titlecase::titlecase;
use self::parse::{Editor, EditorTerm};
use crate::config::SHORT_TO_LONG_STATUS;
use crate::line::Line;
use crate::markdown;
use crate::spec::Spec;
use crate::util::boolset::... |
use std::str::FromStr;
/// A trait for converting an NMEA object to a GP data struct
pub trait FromNmea {
fn from_nmea(data: &NMEA) -> Self;
}
/// A struct for holding the time of day: hours, minutes, seconds
#[derive(Debug, Copy, Clone)]
pub struct GpsTime {
pub h: u8,
pub m: u8,
pub s: f32,
}
/// A... |
// planeshift/src/backends/core-animation.rs
//
// Copyright © 2018 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... |
//! Playstation Controller driver for Rust's [Embedded Hardware Abstraction Layer](https://github.com/japaric/embedded-hal)
//! ============================
//!
//! The original PlayStation and most of its peripherals are 20+ years old at this point,
//! but they're easy to interface with for fun projects and wireless... |
//! Dynamically typed values.
//!
//! This module abstracts platform specifics such as NaN boxing away into a common interface.
#[cfg(mica_enable_nan_boxing)]
mod nanbox;
mod portable;
use std::any::Any;
use std::borrow::Cow;
use std::cell::{Cell, UnsafeCell};
use std::cmp::Ordering;
use std::fmt::Write;
use std::mar... |
#![allow(dead_code)]
pub const ERR_OK: u32 = 0;
pub const ERR_EPERM: u32 = 1; /* Operation not permitted */
pub const ERR_ENOENT: u32 = 2;
pub const ERR_ESRCH: u32 = 3; /* No such process */
pub const ERR_EINTR: u32 = 4; /* Interrupted system call */
pub const ERR_EIO: u32 = 5; /* I/O error */
pub const ERR_ENXIO: u32... |
use core::cell::Cell;
use kernel::common::cells::OptionalCell;
use kernel::common::registers::{register_bitfields, ReadWrite};
use kernel::common::StaticRef;
use kernel::hil;
use kernel::ClockInterface;
use kernel::ReturnCode;
use crate::dma1;
use crate::rcc;
/// Universal synchronous asynchronous receiver transmitte... |
// Symphonia
// Copyright (c) 2019 The Project Symphonia Developers.
//
// 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 https://mozilla.org/MPL/2.0/.
#![warn(rust_2018_idioms)]
#![forbid(unsafe_... |
use usb_device::{Result, UsbDirection, UsbError};
use usb_device::bus::{UsbBusAllocator, PollResult};
use usb_device::endpoint::{EndpointType, EndpointAddress};
use crate::ral::{read_reg, write_reg, modify_reg, otg_global, otg_device, otg_pwrclk};
use crate::target::UsbRegisters;
use crate::target::interrupt::{self, M... |
#[cfg(target_os="windows")]
use crate::windows::OpenGraphicsLibrary;
pub mod blending;
use blending::Blending;
pub mod buffer;
use buffer::Buffer;
pub mod drawing;
use drawing::Drawing;
pub mod framebuffer;
use framebuffer::Framebuffer;
pub mod program;
use program::Program;
pub mod shader;
use shader::Shader;
p... |
// Copyright 2016 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 ... |
//! ## clickhouse-rs
//! Tokio based asynchronous [Yandex ClickHouse](https://clickhouse.yandex/) client library for rust programming language.
//!
//! ### Installation
//! Library hosted on [crates.io](https://crates.io/crates/clickhouse-rs/).
//!
//! ```toml
//! [dependencies]
//! clickhouse-rs = "*"
//! ```
//!
//! ... |
#![feature(box_syntax, box_patterns, conservative_impl_trait, catch_expr)]
#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate util;
extern crate clap;
#[macro_use]
extern crate log;
extern crate ast;
extern crate petgraph;
extern crate tempfile;
extern crate itertools;
pub mod error;
pub mod explicate;
p... |
//! # Database Cache
//! This is an in-memory cache that is used to store the state of the DHT database.
use crate::dht_op::DhtOpType;
use crate::share::RwShare;
use error::*;
use holo_hash::*;
use holochain_sqlite::prelude::*;
use rusqlite::named_params;
use std::collections::HashMap;
use std::ops::RangeInclusive;
use... |
#![cfg_attr(not(feature = "std"), no_std)]
//! A crate for the Marlin preprocessing zkSNARK for R1CS.
//!
//! # Note
//!
//! Currently, Marlin only supports R1CS instances where the number of inputs
//! is the same as the number of constraints (i.e., where the constraint
//! matrices are square). Furthermore, Marlin on... |
use crate::{
collateral::lock_required_collateral, faucet, issue, relay::run_relayer, service::*, Error, Event, IssueRequests,
Vaults, CHAIN_HEIGHT_POLLING_INTERVAL,
};
use async_trait::async_trait;
use bitcoin::{stream_blocks, BitcoinCore, BitcoinCoreApi};
use clap::Clap;
use futures::{
channel::{mpsc, mps... |
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
use super::errors::Error;
use super::{wallet_helpers, KeyInfo, KeyStore};
use address::Address;
use crypto::{Signature, SignatureType};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::convert::TryFrom;
use... |
use super::*;
/// Create a traffic signal which has a stage that is: protected straight, protected right,
/// unprotected left, unprotected right on red. Followed by a variable stage that has protected
/// left, unprotected right on red. With a last stage that is all-walk and variable.
/// In some degenerate cases, us... |
////////////////////////////////////////////////////////////////////////////////
// Module: main.rs
//
// Copyright © 2019 <NAME>
//
// 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/license... |
//! Writes the AST into a string representing WIT with its textual format.
//!
//! # Example
//!
//! ```rust
//! use wasmer_interface_types::{
//! ast::*,
//! encoders::wat::*,
//! interpreter::Instruction,
//! };
//!
//! let input: String = (&Interfaces {
//! types: vec![Type {
//! inputs: vec!... |
#![cfg(target_arch = "wasm32")]
#[allow(unused_imports)]
use rg3d::{
core::{
algebra::{Matrix4, UnitQuaternion, Vector3},
pool::Handle,
color::Color,
futures,
wasm_bindgen::{self, prelude::*},
},
engine::{
Engine,
resource_manager::{ResourceManager, T... |
use crate::{Config, Coordinates, Server, VersionCheck};
use clap::{
AppSettings::{
AllowNegativeNumbers, ArgRequiredElseHelp, ColoredHelp, DeriveDisplayOrder,
UnifiedHelpMessage,
},
Clap,
};
use console::style;
use semver::{Error as ReqParseError, VersionReq};
use std::fmt::Display;
#[deriv... |
// Copyright (c) 2017-2018, The rav1e contributors. All rights reserved
//
// This source code is subject to the terms of the BSD 2 Clause License and
// the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
// was not distributed with this source code in the LICENSE file, you can
// obtain it at ... |
use crate::metadata::{Endpoint, IndexedEndpoint, KeyDescriptor, NameIdFormat, SpSsoDescriptor};
use crate::schema::{Assertion, Response};
use crate::signature::Signature;
use crate::{
key_info::{KeyInfo, X509Data},
metadata::{ContactPerson, EncryptionMethod, EntityDescriptor, HTTP_POST_BINDING},
schema::{Au... |
// Copyright 2020 <NAME>. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
use std::ffi::{OsStr, OsString};
use std::io::Write;
use std::ops::DerefMut;
use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex};
use serde_json::Value;
use anyhow::Result;
use rafs::metadata::extended::blob_table::Exte... |
// Copyright 2015 The Gfx-rs Developers.
//
// 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 ag... |
//! Main module of rexpect: start new process and interact with it
use crate::errors::*; // load error-chain
use crate::process::PtyProcess;
pub use crate::reader::ReadUntil;
use crate::reader::{NBReader, Regex};
use std::fs::File;
use std::io::prelude::*;
use std::io::LineWriter;
use std::ops::{Deref, DerefMut};
use ... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
crate::model::*,
cm_rust::{self, ChildDecl, ComponentDecl, UseDecl, UseStorageDecl},
fidl::endpoints::Proxy,
fidl_fuchsia_io::{Direct... |
use crate::dijkstra::potentials::cch_parallelization_util::{SeparatorBasedParallelCustomization, SeparatorBasedPerfectParallelCustomization};
use rayon::prelude::*;
use rust_road_router::algo::customizable_contraction_hierarchy::{DirectedCCH, CCH, CCHT};
use rust_road_router::datastr::graph::{
BuildReversed, EdgeId... |
use std::cell::RefCell;
use std::collections::HashMap;
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use std::rc::Rc;
use anyhow::{anyhow, Error};
use crate::block::Block;
use crate::class::Class;
use crate::compiler;
use crate::frame::FrameKind;
use crate::interner::{Interned, Interner};
use crate::inter... |
use std::collections::HashMap;
use std::convert::TryFrom;
use std::fs::File;
use std::io::BufWriter;
use std::path::{Path};
use anyhow::Context;
use crate::anim::{Frame, RgbaTexture};
use crate::files;
use crate::frame_info::{self, FrameInfo, FrameType};
use crate::normal_encoding;
use crate::{SpriteType, Error};
pu... |
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////// //////
////// Script to run simple snow mode... |
use std::cell::RefCell;
use std::collections::{BTreeMap, HashMap, VecDeque};
use std::ops::{Deref, DerefMut};
use std::sync::{Arc, Mutex, RwLock};
use std::thread::{JoinHandle, spawn};
use std::time::{Duration, Instant};
use glutin_window::GlutinWindow;
use graphics::{clear, Ellipse, Image, Rectangle, Transformed};
us... |
use super::DNA;
use std::cmp::Ordering;
use std::ops::Range;
#[derive(Clone)]
pub struct DnaRope {
dna: Vec<Vec<DNA>>,
index: Vec<usize>,
}
impl From<Vec<DNA>> for DnaRope {
fn from(value: Vec<DNA>) -> Self {
Self::from_raw(vec![value].into())
}
}
impl DnaRope {
pub fn new() -> Self {
... |
use crate::config::injection::DIService;
use crate::config::ConfigObj;
use crate::metastore::MetaStore;
use crate::remotefs::RemoteFs;
use crate::store::{ChunkDataStore, ROW_GROUP_SIZE};
use crate::table::data::cmp_partition_key;
use crate::table::parquet::{arrow_schema, ParquetTableStore};
use crate::table::redistribu... |
#[macro_use]
extern crate log;
extern crate log4rs;
extern crate serde;
extern crate serde_json;
use fs::File;
use std::{fs, fs::OpenOptions, io::BufReader, io::Seek, io::SeekFrom, path::PathBuf};
use chrono::{TimeZone, Utc};
use clap::{App, Arg};
use log::{LevelFilter, SetLoggerError};
use log4rs::{
append::cons... |
#[cfg(feature = "51")]
use nrf51 as pac;
#[cfg(feature = "52810")]
use nrf52810_pac as pac;
#[cfg(feature = "52832")]
use nrf52832_pac as pac;
#[cfg(feature = "52840")]
use nrf52840_pac as pac;
use bbqueue::{framed::FrameConsumer, ArrayLength};
use core::sync::atomic::{compiler_fence, Ordering};
use crate::{
a... |
extern crate hex;
extern crate serde;
use self::serde::{Deserialize, Serialize};
use std::collections::HashMap;
// Public Structs and Functions
#[derive(Serialize, Deserialize, Debug)]
pub struct HuffmanData {
pub encoded_data: Vec<u8>,
pub encoding_map: HashMap<u8,String>,
}
//Takes a Hex String and a Has... |
//! Infix expressions in gluon are initially parsed as if they were all left-
//! associative with the same precedence. Therefore we need to rebalance them
//! after the fact.
use base::ast::{walk_mut_expr, Expr, IdentEnv, Literal, MutVisitor, SpannedExpr, SpannedIdent};
use base::error::Errors;
use base::fnv::FnvMap;... |
use crate::{
crypto::{AuthorityPen, AuthorityVerifier, KeyBox},
data_io::{reduce_header_to_num, AlephData, DataProvider, DataStore, FinalizationHandler},
default_aleph_config,
finalization::{AlephFinalizer, BlockFinalizer},
first_block_of_session,
justification::{
AlephJustification, Jus... |
// The MIT License (MIT)
// Copyright © 2021 Aukbit Ltd.
//
// 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, mo... |
use crate::disk::*;
use crate::error::Error;
use crate::node::Node;
use crate::params::Params;
use byteorder::{NativeEndian, ReadBytesExt};
use rand::seq::SliceRandom;
use rand::{thread_rng, Rng};
use std::fs::File;
use std::io::{BufRead, BufReader, Read, Seek, Write};
use std::mem;
use std::path::Path;
#[cfg(target_a... |
//! crowbar makes it easy to write AWS Lambda functions in Rust. It wraps native Rust functions
//! into CPython modules that handle converting Python objects into Rust objects and back again.
//!
//! # Usage
//!
//! Add both crowbar and cpython to your `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! crowbar = "0.... |
use crate::SETTINGS;
use serde::{Serialize, Deserialize};
use crate::timewarping::signing::*;
use sha2::{Sha256, Digest};
pub mod rocksdb_impl;
use std::sync::Arc;
use crate::pathway::PathwayDescriptor;
extern crate base64;
use std::marker::{Send, Sync};
use std::{
collections::{HashMap, VecDeque}};
/// Function... |
extern crate iron;
extern crate env_logger;
extern crate handlebars_iron as hbs;
extern crate serde;
extern crate serde_json;
#[macro_use]
extern crate serde_derive;
extern crate flate2;
extern crate staticfile;
extern crate mount;
extern crate urlencoded;
extern crate toml;
extern crate semver;
#[macro_use]
extern cra... |
extern crate byteorder;
extern crate memmap;
extern crate rng;
extern crate sharedmem;
extern crate rand;
pub mod shared;
use byteorder::{ReadBytesExt, WriteBytesExt, LittleEndian, BigEndian};
use memmap::{Mmap, Protection};
use rng::xorshift::{Xorshiftplus128Rng};
use rand::{Rng, thread_rng};
use std::cmp::{min};
... |
/// TODO: Upstream most of these to ethers-rs
mod estimator;
mod gas_oracle_logger;
mod min_gas_fees;
mod rpc_logger;
mod transport;
use self::{
estimator::Estimator, gas_oracle_logger::GasOracleLogger, min_gas_fees::MinGasFees,
rpc_logger::RpcLogger, transport::Transport,
};
use chrono::{Duration as ChronoDur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.