text stringlengths 7.05k 33.9k |
|---|
use std::time::Instant;
use arcdps::imgui::{CollapsingHeader, MenuItem, MouseButton, StyleColor, StyleVar, TableBgTarget, TableColumnFlags, TableColumnSetup, TableFlags, TableRowFlags, Ui};
use crate::clears::{FinishedEncountersStore, RaidWings};
use crate::Data;
use crate::settings::{AccountHeaderStyle, ClearsStyle... |
//! Some useful iterators.
#![warn(
bad_style,
missing_docs,
unused,
unused_extern_crates,
unused_import_braces,
unused_qualifications,
unused_results
)]
#![cfg_attr(all(test, feature = "unstable"), feature(test))]
#[cfg(all(test, feature = "unstable"))]
extern crate test;
use bit_set::Bi... |
use std::ops::{Mul, MulAssign, Deref, DerefMut};
use std::convert::{AsRef, TryInto};
use crate::traits::slice::*;
use crate::traits::math as math_traits;
#[derive(thiserror::Error, Debug)]
pub enum MatrixError {
#[error("cannot invert the matrix")]
Invert
}
#[repr(C)]
#[derive(PartialEq, Debug)]
pub struct Ma... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the MIT/Apache-2.0 License, at your convenience
//
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020 Datadog, Inc.
//
use crate::io::{
open_options::OpenOptions,
DmaStreamRe... |
//! phetch's Gopher library contains a few phetch-specific features:
//! the ability to make requests or downloads over TLS or Tor,
//! cleaning Unicode control characters from Gopher responses, and
//! URL parsing that recognizes different protocols like telnet and
//! IPv6 addresses.
use crate::ui::{self, Key};
use ... |
//! # Embedded-Profiling
//!
//! A lightweight framework for profiling functions, geared towards
//! `no-std` embedded environments. Initialization is very similar
//! to how the `log` crate is initialized. By default, there is a
//! no-op profiler that does nothing until you call [`set_profiler`].
//! Once your profil... |
//! An asynchronously etcd client for Rust.
//!
//! etcd-client supports etcd v3 API and async/await syntax.
//!
//! # Examples
//!
//! A simple key-value read and write operation:
//!
//! ```no_run
//! use etcd_client::*;
//!
//! fn main() -> Result<()> {
//! smol::block_on(async {
//! let client = Client::con... |
// Copyright (C) 2020-2022 <NAME>.
use rand::prelude::*;
use wasm_bindgen::prelude::*;
#[macro_use]
mod error;
macro_rules! mod_many {
($($mod: ident)+) => {
$(#[allow(dead_code)] mod $mod;)+
};
}
mod_many!(alphabet bag bites board_layout display fash game_config game_state game_timers kibitzer klv kwg matri... |
//! This module is an **experimental** integration of the `gfx_glyph`
//! text cache crate. This should offer both much higher performance than
//! [`ggez::graphics::Text`](struct.Text.html), and also more features.
//! Use it, enjoy it, experiment with it, and offer suggestions for improving
//! the API. Hopefully th... |
/*
SPDX-License-Identifier: Apache-2.0 OR MIT
*/
use amcl_wrapper::field_elem::{FieldElement, FieldElementVector};
use amcl_wrapper::group_elem::{GroupElement, GroupElementVector};
use amcl_wrapper::group_elem_g1::{G1Vector, G1};
use crate::transcript::TranscriptProtocol;
use core::mem;
use merlin::Transcript;
u... |
use actix_web::{
web::{self, Data, Json, Path, Query, ServiceConfig},
HttpResponse,
};
use core::settings::RuntimeSettings;
use futures::try_join;
use shared::{
api::{endpoints::jig, ApiEndpoint},
domain::{
jig::{
DeleteUserJigs, DraftOrLive, JigBrowseResponse, JigCountResponse, JigC... |
pub fn run_program(memory: &Vec<i64>, input: &i64) -> ProgramResult {
let mut instruction_pointer = 0;
let mut program_result = ProgramResult{memory: memory.clone(), output: vec![]};
while get_operation(&program_result.memory, &instruction_pointer) != Operation::Halt {
// println!("Memory: {:?} | P... |
// 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 fidl::HandleBased;
use fuchsia_zircon_status as zx_status;
fn reverse<T>(value: (T, T)) -> (T, T) {
(value.1, value.0)
}
fn maybe_reverse<T>(real... |
mod registers;
mod render;
use crate::cartridge::Mapper;
use crate::cartridge::Mirror;
use std::rc::Rc;
use std::cell::RefCell;
#[derive(Copy, Clone, Debug)]
pub struct Color(pub u8, pub u8, pub u8);
pub struct PPU {
cycle: i32,
scanline: usize,
frame: u64,
// registers
v: u16,
t: u16,
... |
use core::future::Future;
use drogue_device::actors::ble::mesh::{MeshNode, MeshNodeMessage};
use drogue_device::drivers::ble::mesh::composition::{
CompanyIdentifier, Composition, ElementDescriptor, ElementsHandler, Features, Location,
ProductIdentifier, VersionIdentifier,
};
use drogue_device::drivers::ble::mes... |
use crate::{
db::Db,
fsm::FsmHandle,
models::{self, AiDifficulty},
};
use api::routes::live::{ClientMsg, LiveError, Player, ServerMsg};
use chrono::Utc;
use scrabble::{
ai::Ai,
error::GameError,
game::{play::Play, tile::Tile, GameOver, GameStatus, PlayerNum},
util::{bitboard::BitBoard, fsm::... |
use super::project::{Project};
use std::fs;
use super::flatten;
use super::ast;
use super::make;
use std::io::{Write};
use std::collections::HashSet;
use std::path::PathBuf;
use super::name::Name;
use super::parser::{self, emit_error};
pub struct CFile {
pub name: Name,
pub filepath: String,
pub s... |
// Translated from C++ to Rust. The original C++ code can be found at
// https://github.com/jk-jeon/dragonbox and carries the following license:
//
// Copyright 2020-2021 <NAME>
//
// The contents of this file may be used under the terms of
// the Apache License v2.0 with LLVM Exceptions.
//
// (See accompanying fil... |
// Copyright © 2016-2017 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
extern crate haret;
extern crate protobuf;
use std::io::{Read, Result, Error, ErrorKind, Write};
use std::mem;
use std::net::TcpStream;
use protobuf::{RepeatedField, parse_from_bytes, Message};
use haret::api::messages::... |
use core::panic;
use crate::tree::minimum_tree_depth;
use crate::tree::tree_node::MinNode;
use crate::tree::Tree;
use crate::Node;
/// creates a huffman tree and limits its height to 11
#[inline]
pub fn build_tree_fast(counts: &[usize; 256]) -> Tree {
let mut tree = build_tree_fast_1(counts);
let max_height ... |
use std::mem;
use std::cmp;
use smallvec::SmallVec;
use advent_of_code::{Parser, ParserError};
#[derive(Copy, Clone, Debug)]
enum Instruction {
ToBot { value: u8, to: u8 },
State { bot: u8, low: Output, high: Output },
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
enum Output {
Bot(u8),
Output(u8),... |
// https://tools.ietf.org/html/rfc3550
// TODO : Errorの定義
use crate::octets;
use crate::rtp::{Result, RtpError};
use crate::rtcrtpparameters::{RtcRtpParameter};
/*
The RTP header has the following format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8... |
use super::ast::*;
use super::token::*;
use crate::common::*;
use crate::parser::Parser;
use crate::position::{WithSpan, Span};
use crate::SyntaxError;
#[allow(dead_code)]
#[derive(PartialEq, PartialOrd, Copy, Clone)]
enum Precedence {
None,
Assign, // =
Or,
And,
Equality, // == !=
Comparison... |
//! This module handles the procedures used for measuring conductivity, by adjusting
//! multiplexed Gain, setting DAC output voltage, reading ADC input voltage, and converting
//! to a conductivity reading. Based on Analog Devices CN-0411.
//!
//! This module does not handle calibration or temperature compensation; th... |
use std::io;
use std::io::{prelude::*, Cursor};
use std::convert::Infallible;
use std::fmt;
use std::fmt::Debug;
use std::str::FromStr;
/// Contains the definition of the errors used in the Http module.
pub mod errors;
/// Contains all the types needed to read and write Http headers.
pub mod headers;
/// Contains the... |
extern crate clap;
extern crate clog;
extern crate env_logger;
extern crate git2;
extern crate hubcaps;
#[macro_use]
extern crate log;
extern crate regex;
extern crate semver;
extern crate tokio;
extern crate toml;
extern crate url;
use std::io::Write;
use std::path::Path;
use std::process::exit;
use std::thread;
use ... |
//! Implementation of flow cell folder analysis and import.
use restson::RestClient;
use std::collections::HashMap;
use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
use std::result;
use sxd_document::parser;
use super::errors::*;
use settings::Settings;
mod api;
mod bcl_meta;
use self::... |
use std::path::{Path, PathBuf};
use std::process::{Command, ExitStatus, Output};
use std::{env, error, fmt, fs, io};
use postgres;
use shell_escape::escape;
use crate::lock::LockDo;
use crate::runtime;
#[derive(Debug)]
pub enum ClusterError {
PathEncodingError, // Path is not UTF-8.
IoError(io::Error),
U... |
mod io;
mod reconstruction;
use std::convert::TryFrom;
use std::env;
use std::fs;
use std::panic;
use std::path::{Path, PathBuf};
use anyhow::{anyhow, Context};
use log::{error, info, warn};
use rayon::prelude::*;
use splashsurf_lib::nalgebra::Vector3;
use splashsurf_lib::AxisAlignedBoundingBox3d;
use structopt::Stru... |
mod builder;
mod component;
mod diff;
mod format;
mod global;
mod graph;
mod helper;
mod id;
mod loading;
mod provider;
mod proxy;
mod resource;
mod uri;
mod validation;
// re-export
#[cfg(test)]
pub use component::test_generate_config;
pub use component::{ComponentDescription, ExampleError, GenerateConfig};
pub use d... |
use super::{
math_util::{fitts_ip, logistic},
ArrayVec, OsuObject, FLOW_NEG2, FLOW_NEXT, SNAP_NEG2, SNAP_NEXT,
};
use rosu_pp::parse::Pos2;
const T_RATIO_THRESHOLD: f32 = 1.4;
const CORRECTION_NEG2_STILL: f32 = 0.0;
#[derive(Default)]
pub struct Movement {
pub(crate) raw_movement_time: f32,
pub(crate... |
use std::{fmt, net::SocketAddr};
use codecs::decoding::{DeserializerConfig, FramingConfig};
use futures::FutureExt;
use serde::{Deserialize, Serialize};
use tracing::Span;
use warp::Filter;
use crate::{
codecs::DecodingConfig,
config::{
AcknowledgementsConfig, GenerateConfig, Output, Resource, SourceC... |
mod alter_table;
use super::{common::*, IteratorJoin, Quoted, SqlRenderer};
use crate::{
flavour::MssqlFlavour,
pair::Pair,
sql_migration::{AlterEnum, AlterTable, RedefineTable},
};
use datamodel::PrismaValue;
use indoc::{formatdoc, indoc};
use native_types::{MsSqlType, MsSqlTypeParameter};
use sql_schema_... |
use {
anyhow::*,
aseprite::SpritesheetData,
hashbrown::HashMap,
rlua::prelude::*,
serde::{Deserialize, Serialize},
std::{io::Read, ops},
};
use crate::{
api::{LuaComponent, LuaComponentInterface},
assets::{Asset, Cache, Cached, DefaultCache, Key, Loaded},
ecs::*,
filesystem::Fil... |
//! Defines database & queries for macro expansion.
use std::sync::Arc;
use base_db::{salsa, SourceDatabase};
use either::Either;
use limit::Limit;
use mbe::{syntax_node_to_token_tree, ExpandError, ExpandResult};
use rustc_hash::FxHashSet;
use syntax::{
algo::diff,
ast::{self, HasAttrs, HasDocComments},
A... |
///////////////////////////////////////////////////////////////////////////////
//
// Copyright 2018-2021 Robonomics Network <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
... |
// This file is part of Substrate.
// Copyright (C) 2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free S... |
use crate::{PITCH_BUF_SIZE, PITCH_FRAME_SIZE, PITCH_MAX_PERIOD, PITCH_MIN_PERIOD};
pub(crate) struct PitchFinder {
last_period: usize,
last_gain: f32,
// A buffer of size PITCH_BUF_SIZE / 2.
pitch_buf: Vec<f32>,
// Scratch buffer of size PITCH_MAX_PERIOD + 1. We'll also use it for a scratch buffer ... |
use super::app_validation_workflow;
use super::app_validation_workflow::Outcome;
use super::error::WorkflowResult;
use super::sys_validation_workflow::sys_validate_element;
use crate::conductor::api::CellConductorApiT;
use crate::conductor::interface::SignalBroadcaster;
use crate::core::queue_consumer::TriggerSender;
u... |
use super::pkcs7::{build_pkcs7, SPC_INDIRECT_DATA_OBJID, SPC_SIPINFO_OBJID};
use crate::Signer;
use anyhow::Result;
use byteorder::{BigEndian, ReadBytesExt};
use rasn::prelude::*;
use rasn_cms::pkcs7_compat::{EncapsulatedContentInfo, SignedData};
use rasn_cms::{ContentInfo, CONTENT_SIGNED_DATA};
use std::fs::File;
use ... |
use once_cell::sync::Lazy;
use std::cmp::max;
use unicode_segmentation::UnicodeSegmentation;
use crate::{
app::App,
canvas::{drawing_utils::get_column_widths, Painter},
constants::*,
utils::gen_util::*,
};
use tui::{
backend::Backend,
layout::{Constraint, Direction, Layout, Rect},
symbols:... |
// 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 {
crate::{
directory::FatDirectory,
filesystem::{FatFilesystem, FatFilesystemInner},
node::Node,
refs::FatfsFileRef,... |
use std::fs::File;
use std::io::BufReader;
use seshat::unicode::CodePoint;
use seshat::unicode::Ucd;
use seshat::unicode::props::*;
use xml::reader::{EventReader, XmlEvent};
use xml::attribute::OwnedAttribute;
fn check_property(cp: CodePoint, val: &str, prop: &str, attrs: &Vec<OwnedAttribute>) {
match attrs.iter... |
//! `Token` and closely related types.
use base64ct::{Base64UrlUnpadded, Encoding};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use smallvec::{smallvec, SmallVec};
use core::{convert::TryFrom, fmt};
use crate::{
alloc::{Cow, String, Vec},
Algorithm, Claims, ParseError, ValidationError,
};
///... |
/// Gilbert-Johnson-Keerthi (GJK) intersection test + Expanding Polytope
/// Algorithm (EPA) implementations.
///
/// "Implementing GJK", <NAME>:
/// https://www.youtube.com/watch?v=Qupqu1xe7Io
///
/// "GJK + Expanding Polytope Algorithm - Implementation and Visualization"
/// https://www.youtube.com/watch?v=6rgiPrzqt... |
//! Compute partition bounds for the integer partition exponential mechanism.
//! Some of the bounds strategies are due to Blocki, Datta and Bonneau '16,
//! and others are described in upcoming work.
//!
use crate::{Eta, ExponentialOptions};
use crate::mechanisms::laplace::clamped_laplace_mechanism;
use rug::{ rand... |
use crate::channel::{
decode_state, encode_state, queue::Queue, Priority, SendError, SendErrorKind, TryRecvError,
TrySendError, INIT_STATE, MAX_BUFFER, MAX_CAPACITY, OPEN_MASK,
};
use crate::lock::Mutex;
use futures::{
future::poll_fn,
stream::{FusedStream, Stream},
task::{AtomicWaker, Waker},
};
u... |
use crate::error::error;
use crate::pages::apps::details::Props;
use crate::utils::url_encode;
use drogue_cloud_service_api::admin::{MemberEntry, Members, Role, TransferOwnership};
use anyhow::{anyhow, Result};
use core::time::Duration;
use indexmap::IndexMap;
use patternfly_yew::*;
use yew::{format::*, prelude::*, s... |
//! C API, drop-in replacement for libgif
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(dead_code)]
#![allow(missing_docs)]
mod c_api_utils;
mod reader;
use std::cmp;
use std::mem;
use std::ptr;
use std::fs::File;
use std::ffi::CStr;
use std::str;
use std::slice;
use std::panic;
use libc::{free,... |
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
use std::sync::atomic::AtomicU64;
use std::sync::Arc;
use std::thread;
use std::time::Duration;
use collections::HashMap;
use engine_traits::Peekable;
use grpcio::{ChannelBuilder, Environment};
use keys::data_key;
use kvproto::{kvrpcpb::*, metapb::Reg... |
//! Low-level api to create threads and start them.
//!
//! This module defines the low-level representation of a thread, kind to pthread on Unix.
//! You will want to abstract it in the libstd.
//!
//! # Threads on SunriseOS
//!
//! The sunrise kernel provides only three syscalls of interest relative to threads:
//!
/... |
// This sequence needs to be repeated in each project as a workaround.
// See https://github.com/rust-lang/cargo/issues/5034
// For clippy lints see: https://rust-lang.github.io/rust-clippy/master
// For rustc lints see: https://doc.rust-lang.org/rustc/lints/index.html
#![cfg_attr(not(feature = "std"), no_std)]
#... |
//! Reading and (maybe) writing Unified Font Object files.
#![deny(intra_doc_link_resolution_failure)]
use std::borrow::Borrow;
use std::collections::BTreeMap;
use std::collections::HashSet;
use std::ffi::OsStr;
use std::fs;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use crate::error::GroupsValidationError;... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Activate NFCT peripheral for incoming and outgoing frames, change state to activated"]
pub tasks_activate: crate::Reg<tasks_activate::TASKS_ACTIVATE_SPEC>,
#[doc = "0x04 - Disable NFCT peripheral"]
pub tasks_disable: crate:... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#![feature(get_mut_unchecked)]
use anyhow::{anyhow, bail, Context, Result};
use derive_more::{Deref, Display};
use gazebo::any::A... |
use ::bobbin_mcu::clock::{Clock, ClockFor};
use ::bobbin_mcu::hz::Hz;
#[derive(Default)]
pub struct Clocks<CP: ClockProvider> { provider: CP }
impl<CP: ClockProvider> ::core::ops::Deref for Clocks<CP> {
type Target = CP;
fn deref(&self) -> &CP { &self.provider }
}
// Define Global Clocks
#[derive(Default)]... |
//! Collects messages from the various traffic watchers to allow the creation of graphs about
//! usage. Within each traffic watcher a simple message containing the amount of bandwidth used
//! in that round and exactly what type of bandwidth it is is sent to this module, from there
//! the handler updates the storage ... |
use glam::Vec2;
use imgui::*;
use puffin::*;
use serde::{Deserialize, Serialize};
const ERROR_COLOR: [f32; 4] = [1.0, 0.0, 0.0, 1.0];
#[derive(Clone, Default, Deserialize, Serialize)]
#[serde(default)]
pub struct ProfilerUi {
options: Options,
// interaction:
#[serde(skip)]
is_panning: bool,
#[s... |
use std::collections::HashMap;
use crate::{
ast::{self, Biblio, BiblioResolver, QuotedString},
Error, ErrorKind,
};
use super::Format;
use biblatex::Bibliography;
/// A type wrapper around [`String`] to represent a `BibTex` format string.
#[derive(Debug)]
pub struct BibTex(String);
impl Format for BibTex {... |
use std::fmt;
#[repr(u16)]
pub enum Area {
Unknown = 0,
RogueEncampment = 1,
BloodMoor = 2,
ColdPlains = 3,
StonyField = 4,
DarkWood = 5,
BlackMarsh = 6,
TamoeHighland = 7,
DenOfEvil = 8,
CaveLevel1... |
// Copyright (C) 2020 Alibaba Cloud. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//! Fuse passthrough file system, mirroring an existing FS hierarchy.
//!
//! This file system mirrors the existing file system hierarchy of the system, starting at the
//! root file system. This is implemented by just "pa... |
mod reference_table;
mod result;
mod trailer;
mod util;
use std::fmt;
use std::fmt::{Debug, Formatter};
use std::fs::File;
use std::io::{Read, Seek, SeekFrom};
use std::str;
use reference_table::ReferenceTable;
pub use result::{Error, Result};
use trailer::Trailer;
/* taken from https://opensource.apple.com/source/C... |
use core::convert::From;
use core::convert::Into;
use core::u32;
use cortex_m::asm;
use nostd::io;
use nostd::registers::{Read, Register, Write};
use nostd::uart::{BaudRate, Configuration, Parity, StopBits};
pub enum Port {
P0,
P1,
}
#[derive(Clone)]
pub enum Pin {
P0,
P1,
P2,
P3,
P4,
... |
use log::{debug, info, error};
use rusb::{Context, Device, DeviceDescriptor, DeviceHandle, Direction, TransferType, UsbContext};
use std::time::Duration;
use crate::{
error::{Error, PrinterError},
media::Media,
model::Model,
Matrix,
};
#[derive(Debug, Clone, Copy)]
struct Endpoint {
config: u8,
... |
//! eBPF program types.
//!
//! eBPF programs are loaded inside the kernel and attached to one or more hook
//! points. Whenever the hook points are reached, the programs are executed.
//!
//! # Loading and attaching programs
//!
//! When you call [`Bpf::load_file`] or [`Bpf::load`], all the programs included
//! in th... |
//! `SecretConnection`: Transport layer encryption for Tendermint P2P connections.
use std::{
cmp,
convert::{TryFrom, TryInto},
io::{self, Read, Write},
marker::{Send, Sync},
slice,
};
use chacha20poly1305::{
aead::{generic_array::GenericArray, AeadInPlace, NewAead},
ChaCha20Poly1305,
};
u... |
// ABCdb abcparser_peg.rs – ABC text string character encoding table generator
//
// This file is run at build time, to generate static hash maps of the character
// replacements.
//
// Copyright © 2017 <NAME>.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and as... |
// Copyright 2017 10x Genomics
//! Methods for minimum substring partitioning of a DNA string
//!
//! simple_scan method is based on:
//! <NAME>. "MSPKmerCounter: a fast and memory efficient approach for k-mer counting." arXiv preprint arXiv:1505.06550 (2015).
use std::cmp::min;
use std::iter::Iterator;
use std::ops:... |
use crate::error::ErrorRecord;
use proc_macro2::Span;
use syn::punctuated::Punctuated;
use syn::visit::{self, Visit};
use syn::visit_mut::{self, VisitMut};
use syn::{parse_quote, Token};
use syn::{
Attribute, BoundLifetimes, ConstParam, Error, FnArg, GenericParam, Generics, Ident, ItemFn,
Lifetime, Parenthesiz... |
use std::cell::RefCell;
use std::rc::Rc;
use crate::na;
pub use font_kit::family_name::FamilyName;
pub use font_kit::properties::{Properties, Weight, Style, Stretch};
pub use font_kit::hinting::HintingOptions;
pub use font_kit::error::GlyphLoadingError;
pub use font_kit::metrics::Metrics;
pub use self::shared::... |
//! The main function of ic-replay processes command line arguments.
use candid::Encode;
use clap::Clap;
use ic_canister_client::{Agent, Sender};
use ic_config::{Config, ConfigSource};
use ic_crypto_sha::Sha256;
use ic_nns_common::pb::v1::NeuronId;
use ic_nns_constants::{GOVERNANCE_CANISTER_ID, LEDGER_CANISTER_ID, REGI... |
use std::{
cell::{Cell, RefCell},
collections::{HashMap, VecDeque},
convert::TryFrom,
fmt,
ops::Deref,
rc::Rc,
sync::Arc,
time::{Duration, SystemTime},
};
use matrix_sdk::{
events::{
room::message::{
FormattedBody, MessageEventContent, MessageFormat, RelatesTo, T... |
use std::ops::{Bound, RangeBounds};
use bytes::Bytes;
use failure::{Fail, ResultExt};
use futures::lock::Mutex;
use headers::HeaderMapExt as TypedHeaderMapExt;
use headers::Range as RangeHeader;
use log::*;
use reqwest::header::{self, HeaderMap};
use reqwest::{Client as ReqwestClient, Method, Response, StatusCode, Url... |
//! KTX Texture Format Loader
//!
//! https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
/*
File Structure:
Byte[12] identifier
UInt32 endianness
UInt32 glType
UInt32 glTypeSize
UInt32 glFormat
Uint32 glInternalFormat
Uint32 glBaseInternalFormat
UInt32 pixelWidth
UInt32 pixelHeight
UInt32 pixelDepth
UIn... |
use std::collections::VecDeque;
use std::marker::PhantomData;
use std::sync::atomic::{AtomicU64, Ordering::SeqCst};
use std::time::{Duration, Instant};
use locutus_runtime::{ContractStore, Parameters, StateStorage, StateStore};
use serde::{Deserialize, Serialize};
use tokio::sync::mpsc;
use crate::contract::{Contract... |
//#![warn(missing_docs)]
use postgres as pg;
use postgres::fallible_iterator::FallibleIterator;
use postgres::types::{FromSql, Type};
use postgres::RowIter;
use rust_decimal::prelude::{Decimal, ToPrimitive};
use std::error::Error;
use std::ffi::CString;
use std::net::IpAddr;
use std::os::raw::c_char;
use std::{ffi, mem... |
use std::{collections::HashMap, str::FromStr};
use bstr::ByteSlice;
use itertools::Itertools;
use serde::{Deserialize, Serialize};
use crate::{Error, Result};
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Header<'a> {
pub title_line: &'a str,
pub program_line: &'a str,
pub comment_li... |
// Copyright (c) 2018 <NAME>
// [This program is licensed under the "MIT License"]
// Please see the file LICENSE in the source
// distribution of this software for license terms.
#![feature(asm)]
#[macro_use]
extern crate lazy_static;
use std::env;
use std::time;
const BLOCKSIZE: usize = 1000;
const PREHEAT_BASE: ... |
use crate::{
read_timespec,
superblock::{ChecksumType, Superblock},
DiskKey, Timespec,
};
use fal::parsing::{read_u16, read_u32, read_u64, read_u8, read_uuid, skip};
use bitflags::bitflags;
use enum_primitive::*;
use uuid::Uuid;
bitflags! {
/// The type of a block group or chunk.
pub struct BlockG... |
//* Substrate Zombies */
#![cfg_attr(not(feature = "std"), no_std)]
/// Edit this file to define custom logic or remove it if it is not needed.
/// Learn more about FRAME and the core library of Substrate FRAME pallets:
/// <https://substrate.dev/docs/en/knowledgebase/runtime/frame>
pub use pallet::*;
#[cfg(test)]
mo... |
// Copyright 2021 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::{cell::RefCell, collections::BTreeMap, fs::File, path::PathBuf, rc::Rc, sync::Arc};
use anyhow::{anyhow, bail, Context};
use argh::FromArgs;
... |
//! Support code for rustc's built in unit-test and micro-benchmarking
//! framework.
//!
//! Almost all user code will only be interested in `Bencher` and
//! `black_box`. All other interactions (such as writing tests and
//! benchmarks themselves) should be done via the `#[test]` and
//! `#[bench]` attributes.
//!
//... |
//! Defines `Body`: a lowered representation of bodies of functions, statics and
//! consts.
mod lower;
#[cfg(test)]
mod tests;
pub mod scope;
use std::{mem, ops::Index, sync::Arc};
use base_db::CrateId;
use cfg::{CfgExpr, CfgOptions};
use drop_bomb::DropBomb;
use either::Either;
use hir_expand::{
ast_id_map::Ast... |
// Copyright 2012-2013 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... |
/*! Memory modeling.
This module provides the [`BitStore`] trait, which contains all of the logic
required to perform memory accesses from a data structure handle.
# `bitvec` Memory Model
`bitvec` considers all memory within [`BitSlice`] regions as if it were composed
of discrete bits, each divisible and independent... |
use crate::definition::def_types::*;
use crate::definition::get_scopes;
use crate::diagnostics::{get_diagnostics, is_hidden};
use crate::server::LSPServer;
use log::{debug, error, trace};
use pathdiff::diff_paths;
use ropey::{Rope, RopeSlice};
use std::collections::HashMap;
use std::env::current_dir;
use std::fs;
use s... |
#![recursion_limit="128"]
#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate serde_json;
extern crate bitcoin;
extern crate chrono;
extern crate time;
extern crate handlebars;
extern crate rustc_serialize;
extern crate num_cpus;
use handlebars::Handlebars;
use std::io::{self, Read};
use chrono::{Utc, T... |
use crate::{
math::field,
utils::sponge,
MAX_CONTEXT_DEPTH, MAX_LOOP_DEPTH,
NUM_CF_OP_BITS, NUM_LD_OP_BITS, NUM_HD_OP_BITS,
SPONGE_WIDTH, BASE_CYCLE_LENGTH, PUSH_OP_ALIGNMENT,
};
use super::opcodes::{ FlowOps, UserOps };
#[cfg(test)]
mod tests;
// TYPES AND INTERFACES
// ==========================... |
#![cfg(windows)]
// allows for nice formatting for e.g. new_buf[i * 4 + 0] = premul(buf[i * 4 + 0, a)
#![allow(clippy::identity_op)]
//! The Direct2D backend for the Piet 2D graphics abstraction.
mod conv;
pub mod d2d;
pub mod d3d;
pub mod dwrite;
mod text;
use std::borrow::Cow;
use std::ops::Deref;
use winapi::um:... |
//! Calendar-windows for events recurring on weekly basis.
//!
//! This contains helper logic to handle intervals of time which recur every week:
//! * `WeeklyWindow`: a continuous interval over a single week.
//! * `WeeklyCalendar`: a set of intervals on a weekly calendar.
// TODO(lucab): stabilize and split this t... |
use crate::utils::{
config::{BTC_ADDRESS_PREFIX, SUDT_CODE_HASH, TX_PROOF_DIFFICULTY_FACTOR, UDT_LEN},
types::{
btc_difficulty::BTCDifficultyReader, mint_xt_witness::BTCSPVProofReader, BtcExtraView,
Error, ToCKBCellDataView, XExtraView,
},
};
use alloc::{string::String, vec::Vec};
use bech3... |
#![allow(clippy::non_ascii_literal)]
pub mod files;
pub mod hashes;
use crate::{
api::{
CreateUserArgs, DeleteHome, DeleteUserArgs, GroupRead, UserDBRead, UserDBWrite, UserRead,
},
group::MembershipKind,
UserLibError,
};
#[allow(unused_imports)]
use log::{debug, error, info, trace, warn};
use ... |
use std::{
any,
sync::{Arc, Weak},
};
use arrow::{
array::{StringBuilder, UInt64Builder},
datatypes::{DataType, Field, Schema},
record_batch::RecordBatch,
};
use crate::datasource::{MemTable, TableProvider, TableType};
use super::{
catalog::{CatalogList, CatalogProvider},
schema::SchemaPr... |
// Copyright 2020 - 2021 <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 i... |
use crate::font::{Font, FontSource, FontTextureWriter};
use crate::image::ImageDrawParams;
use crate::render::{
view_matrix, DrawList, DrawMode, FontHandle, Renderer, TexCoord, TextureData, TextureHandle,
};
use crate::theme_definition::CharacterRange;
use crate::{Color, Frame, Point, Rect};
use gl;
mod program;
... |
use crate::decode::lzbuffer;
use crate::decode::rangecoder;
use crate::error;
use byteorder::{LittleEndian, ReadBytesExt};
use std::io;
use std::marker::PhantomData;
use crate::decompress::Options;
use crate::decompress::UnpackedSize;
/// Maximum input data that can be processed in one iteration.
/// Libhtp uses the ... |
use std::cmp::Ordering;
use std::result;
use hir;
use unicode_tables::age;
use unicode_tables::case_folding_simple::CASE_FOLDING_SIMPLE;
use unicode_tables::general_category;
use unicode_tables::grapheme_cluster_break;
use unicode_tables::property_bool;
use unicode_tables::property_names::PROPERTY_NAMES;
use unicode_t... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Reboot Control Register"]
pub sys_reboot_ctl: SYS_REBOOT_CTL,
#[doc = "0x04 - NMI Control and Status Register"]
pub sys_nmi_ctlstat: SYS_NMI_CTLSTAT,
#[doc = "0x08 - Watchdog Reset Control Register"]
pub sys_wdtrese... |
use crate::{
printer::{print_resources_as_json, Printer},
progress::{Options as ProgressOptions, Progress},
};
use anyhow::{anyhow, Context, Result};
use chrono::{DateTime, Utc};
use colored::Colorize;
use log::info;
use reinfer_client::{
AnnotatedComment, BucketIdentifier, Client, CommentId, CommentsIterTi... |
#![allow(dead_code)]
use crate::{
config::*,
eth::*,
grpc::{
control::{InboundMessage, InboundMessageId},
sentry::sentry_server::SentryServer,
},
services::*,
};
use anyhow::{anyhow, Context};
use async_stream::stream;
use async_trait::async_trait;
use bytes::Bytes;
use clap::Clap;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.