text stringlengths 7.05k 33.9k |
|---|
use std::{
cmp::Ordering, collections::HashMap, net::SocketAddr, pin::Pin, sync::Arc, time::Duration,
};
use anyhow::{anyhow, Context};
use bytes::Bytes;
use haesli_core::{
connection::{
Channel, ChannelInner, ChannelNum, ConEventReceiver, ConEventSender, Connection,
ConnectionEvent, Connection... |
//! This module allows the package manager to fetch JARs from a plugin repository. The URL and package parsing behavior will be abstracted away as much as possible, since it'd be nice to have a proper API for fetching plugins, but one does not exist at the time of writing this module.
//!
//! Plugin parsers have two mo... |
use std::{
borrow::Cow,
collections::HashMap,
ffi::OsStr,
io::SeekFrom,
sync::{
atomic::{self, AtomicU64},
Mutex,
},
};
use chashmap::CHashMap;
use crate::{
btree::{BTree, BTreeKey, Pairs},
checkpoint::{self, CheckpointMapping, CheckpointMappingPhys, GenericObject},
... |
use crate::{pollers::ServerGatewayApis, worker::activities::PendingActivityCancel, TaskToken};
use futures::StreamExt;
use std::{
collections::{hash_map::Entry, HashMap},
sync::Arc,
time::{self, Duration, Instant},
};
use temporal_sdk_core_protos::{
coresdk::{activity_task::ActivityCancelReason, common,... |
//! HTTP Client
use std::fmt;
use std::io;
use std::marker::PhantomData;
use std::rc::Rc;
use std::sync::Arc;
use std::time::Duration;
use futures::{Async, Future, Poll, Stream};
use futures::future::{self, Executor};
use futures::sync::oneshot;
#[cfg(feature = "compat")]
use http;
use tokio::reactor::Handle;
pub use... |
use crate::ratectl::SlackTokioRateController;
use async_recursion::async_recursion;
use bytes::Buf;
use futures::future::TryFutureExt;
use futures::future::{BoxFuture, FutureExt};
use hyper::body::HttpBody;
use hyper::client::*;
use hyper::http::StatusCode;
use hyper::{Body, Request, Response, Uri};
use hyper_rustls::H... |
use super::{
assert,
constants::*,
debug,
error::Error,
types::{CharSet, Configs},
util, warn,
};
use ckb_std::{ckb_constants::Source, error::SysError, syscalls};
use core::convert::{TryFrom, TryInto};
use das_map::map;
use das_types::{
constants::{DataType, CHAR_SET_LENGTH, WITNESS_HEADER},... |
use super::cluster_config::ClusterConfig;
use super::membership::ArtilleryMemberList;
use crate::epidemic::member::{ArtilleryMember, ArtilleryMemberState, ArtilleryStateChange};
use crate::errors::*;
use chrono::{DateTime, Utc};
use cuneiform_fields::prelude::*;
use mio::net::UdpSocket;
use mio::{Events, Interest, Poll... |
use super::job_queue::*;
use super::queue_state::*;
use super::core::*;
use super::active_queue::*;
use super::wake_queue::*;
use super::desync_scheduler::*;
use futures::prelude::*;
use futures::channel::oneshot;
use futures::task;
use std::mem;
use std::sync::*;
use std::pin::{Pin};
///
/// The possible states of ... |
use failure::{bail, ensure, Error, ResultExt};
use ffmpeg::channel_layout::{self, ChannelLayout};
use ffmpeg::codec::{self, encoder};
use ffmpeg::format::{self, context};
use ffmpeg::software::{self, resampling, scaling};
use ffmpeg::util::frame;
use ffmpeg::{self, color, Packet, Rational};
use lazy_static::lazy_static... |
use anyhow::Error;
#[path = "../klondike.rs"]
#[allow(dead_code)]
mod klondike;
use crate::klondike::{
ActiveCardIterator, Card, CardPlayIterator, Play, Rank, Source, Stack, StackId, Table,
};
use argh::FromArgs;
use core::iter::Iterator;
use rayon::prelude::*;
use std::{
cmp::Ordering,
collections::HashS... |
//! a tab hosting a termwiz terminal applet
//! The idea is to use these when wezterm needs to request
//! input from the user as part of eg: setting up an ssh
//! session.
use crate::config::configuration;
use crate::font::FontConfiguration;
use crate::frontend::front_end;
use crate::mux::domain::{alloc_domain_id, Do... |
//! An implementation of iterative deepening evaluation.
//!
//! Search and evaluate at depth 0, then start over at depth 1, then depth 2,
//! etc. Can keep going until a maximum depth or maximum time or either. Uses
//! a transposition table to reuse information from previous iterations.
use super::super::interface::... |
//! This module provides the necessary activation functions for our neural networks,
//! namely Relu, Generalized Divisive Normalization (GDN) and it's inverse.
//!
//! All activation functions are exposed as a layer as well as a free function
use ndarray::*;
use crate::{models::InternalDataRepresentation, ImagePrecis... |
/// Module holding all the mathematical logic to actually calculate a result
mod logic {
use std::str::FromStr;
// Trait to allow subscription access to chars in Strings using ch function.
trait StringSubscription {
fn ch(&self, pos: usize) -> char;
}
impl StringSubscription for String... |
//! A ledger for memory mappings.
#![cfg_attr(not(test), no_std)]
#![deny(clippy::all)]
#![deny(missing_docs)]
#![forbid(unsafe_code)]
use lset::{Contains, Span};
use primordial::{Address, Offset, Page};
/// A region of memory.
pub type Region = lset::Line<Address<usize, Page>>;
bitflags::bitflags! {
/// Memory... |
//! Callsites represent the source locations from which spans or events
//! originate.
//!
//! # What Are Callsites?
//!
//! Every span or event in `tracing` is associated with a [`Callsite`]. A
//! callsite is a small `static` value that is responsible for the following:
//!
//! * Storing the span or event's [`Metadat... |
#![allow(dead_code)]
extern crate chashmap;
extern crate scoped_threadpool;
extern crate serde;
extern crate svc_texture;
extern crate tower_http;
extern crate tower_util;
extern crate yansi;
#[macro_use]
extern crate log;
extern crate chrono;
extern crate ddsfile;
extern crate fern;
extern crate flatbuffers;
extern c... |
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
#[cfg(test)]
mod peer_test;
use super::network_handler::NetworkHandler;
use super::peer_manager::PeerManager;
use super::{Error, SyncManager, SyncNetworkContext};
use address::Address;
use amt::AMT;
use async_std::sync::{channel, Receiver... |
//-
// Copyright 2017 <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/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to t... |
#[macro_use]
extern crate serde_derive;
use self::byteorder::{NativeEndian, ReadBytesExt};
use byteorder;
use getopts;
use getopts::Options;
use locomix;
use locomix::alsa_input;
use locomix::async_input;
use locomix::base;
use locomix::control;
use locomix::filter_expr;
use locomix::filters;
use locomix::input;
use l... |
use std::collections::{HashMap, HashSet};
use std::convert::TryFrom;
use std::ffi::OsString;
use std::iter::FromIterator;
use std::path::{Path, PathBuf};
use eyre::Context;
use itertools::Itertools;
use os_str_bytes::OsStringBytes;
use tracing::{instrument, warn};
use super::oid::make_non_zero_oid;
use super::{MaybeZ... |
use alloc::sync::Arc;
use core::convert::TryFrom;
use ibc::core::ics23_commitment::merkle::MerkleProof;
use tokio::runtime::Runtime as TokioRuntime;
use ibc::core::ics02_client::client_consensus::{
AnyConsensusState, AnyConsensusStateWithHeight, ConsensusState,
};
use ibc::core::ics02_client::client_state::{
... |
use ff::Field;
use plotters::{
coord::Shift,
prelude::{DrawingArea, DrawingAreaErrorKind, DrawingBackend},
};
use std::cmp;
use std::collections::HashSet;
use std::ops::Range;
use crate::circuit::layouter::RegionColumn;
use crate::plonk::{
Advice, Any, Assigned, Assignment, Circuit, Column, ConstraintSyste... |
use super::*;
use rand;
use rand::seq::SliceRandom;
use rand::Rng;
use std::collections::{HashMap, VecDeque};
use std::sync::mpsc;
use std::sync::{Arc, Mutex};
use std::thread;
use std::time;
#[derive(Debug)]
pub struct Society {
config: Arc<Config>,
cities: Vec<Arc<Mutex<City>>>,
//city_relations: Vec<Vec... |
/// Configuration of the GitHub API client.
#[derive(serde::Deserialize)]
pub struct Config
{
/// The base URL of the GitHub API server with a trailing slash (optional, default:
/// <https://api.github.com/>).
#[serde(default = "github_com_api_base_url")]
base_url: url::Url,
/// The slug of the organization this s... |
use async_std::io;
use async_std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6};
use async_std::net::{TcpListener, TcpStream, UdpSocket};
use async_std::prelude::*;
use async_std::sync::{Arc, Mutex};
use async_std::task;
use bytes::{Buf, BufMut};
use chrono::Local;
use clap::{App, Arg};
use env_logger::... |
#![warn(missing_docs)]
#![doc(html_root_url = "https://docs.rs/pb-async/0.1.0/")]
//! Asynchronous PushBullet client for Rust.
//!
//! # Usage
//!
//! To use `pb_async`, first create a [`Client`] with an access token from
//! [the PushBullet account settings].
//!
//! Then you can use any of the request methods on [`Cl... |
use winapi::um::winuser::{WS_VISIBLE, WS_DISABLED, WS_TABSTOP, WS_EX_CONTROLPARENT};
use std::cell::RefCell;
use std::rc::Rc;
use crate::win32::window_helper as wh;
use crate::win32::base_helper::check_hwnd;
use crate::{NwgError, Font, RawEventHandler, bind_raw_event_handler_inner, unbind_raw_event_handler};
use super... |
//! Computes color for a single element.
use hir::{AsAssocItem, Semantics, VariantDef};
use ide_db::{
defs::{Definition, NameClass, NameRefClass},
RootDatabase,
};
use rustc_hash::FxHashMap;
use syntax::{
ast, AstNode, AstToken, NodeOrToken, SyntaxElement,
SyntaxKind::{self, *},
SyntaxNode, SyntaxT... |
//! A generic connection pool with async/await support.
//!
//! Opening a new database connection every time one is needed is both
//! inefficient and can lead to resource exhaustion under high traffic
//! conditions. A connection pool maintains a set of open connections to a
//! database, handing them out for repeated... |
use colored::*;
use dialoguer::{theme::ColorfulTheme, Confirm, Input};
use hostsfile::HostsBuilder;
use indoc::printdoc;
use shared::{
interface_config::InterfaceConfig, prompts, Association, AssociationContents, Cidr, CidrTree,
EndpointContents, Interface, IoErrorContext, Peer, RedeemContents, State, CLIENT_CO... |
// Copyright 2017 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
// 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::{
constants::{self, FORMATTED_CONTENT_CHUNK_SIZE_TARGET},
diagnostics::{AccessorStats, BatchIteratorConnectionStats},
... |
// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
use crossbeam::channel::{unbounded, Receiver};
use encryption_export::DataKeyManager;
use engine_rocks::{self, raw::Env, RocksEngine};
use engine_traits::{
CompactExt, DeleteStrategy, Error as EngineError, Iterable, Iterator, MiscExt, RaftEngine,
... |
#[allow(deprecated)]
use crate::parser::single_token_parse_recovery::SingleTokenParseRecovery;
use crate::parser::ParsedSyntax::{Absent, Present};
use crate::parser::{ParsedSyntax, RecoveryResult};
use crate::state::{EnterParameters, SignatureFlags};
use crate::syntax::expr::{
is_nth_at_reference_identifier, parse_... |
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by ... |
//! Filesystem operation request
//!
//! A request represents information about a filesystem operation the kernel driver wants us to
//! perform.
use std::mem;
use libc::{EIO, ENOSYS, EPROTO};
use time::Timespec;
use argument::ArgumentIterator;
use channel::ChannelSender;
use Filesystem;
use kernel::*;
use kernel::con... |
use crate::message_routing::LatencyMetrics;
use ic_base_types::NumBytes;
use ic_config::execution_environment::Config as HypervisorConfig;
use ic_logger::{debug, trace, warn, ReplicaLogger};
use ic_metrics::{buckets::decimal_buckets, MetricsRegistry};
use ic_replicated_state::{
canister_state::QUEUE_INDEX_NONE,
... |
use std::cmp::Ordering;
use std::collections::{hash_map::Entry, BinaryHeap, HashMap, VecDeque};
use std::ops::{Deref, DerefMut};
use std::slice;
use std::sync::Arc;
use std::time::Duration;
use atomic_refcell::AtomicRefCell;
use milli::update::IndexDocumentsMethod;
use time::OffsetDateTime;
use tokio::sync::{watch, Rw... |
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct UnderlyingLegInstrument {
/// UnderlyingLegSymbol
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "1330")]
pub underlying_leg_symbol: Option<String>,
/// UnderlyingLegSymbolSfx
... |
#![allow(dead_code)]
use std::fmt;
use std::iter::Peekable;
use std::str::Chars;
// extern crate radix_trie;
// use radix_trie::Trie;
#[derive(Debug, PartialEq)]
pub enum Token {
Op(char),
Int(i64),
Float(f64),
// TODO: add a counter to the paren tokens
// i.e. 'OpenParen(i32)' so when I need to... |
#[cfg(feature = "debugger")]
use super::disassembler::AddressingMode;
use num_enum::TryFromPrimitive;
#[cfg_attr(feature = "debugger", derive(Debug))]
#[derive(TryFromPrimitive, Clone, Copy)]
#[repr(u8)]
pub enum Opcode {
Brk = 0x00,
OraIndX = 0x01,
OraZp = 0x05,
AslZp = 0x06,
Php = 0x08,
OraIm... |
//! Configuration for a Habitat Builder-API service
use crate::{bldr_core::{self,
config::ConfigFile},
bldr_events::connection::EventConfig,
db::config::DataStoreCfg};
use artifactory_client::config::ArtifactoryCfg;
use github_api_client::config::GitHubCfg;
use habitat_... |
use crate::{project::PackageExt as _, shell::Shell};
use anyhow::{bail, Context as _};
use camino::{Utf8Path, Utf8PathBuf};
use cargo_metadata as cm;
use derivative::Derivative;
use heck::KebabCase as _;
use indexmap::indexset;
use liquid::object;
use maplit::btreemap;
use serde::{de::Error as _, Deserialize, Deseriali... |
// Copyright (c) SimpleStaking and Tezedge Contributors
// SPDX-License-Identifier: MIT
use crate::base58::{FromBase58Check, FromBase58CheckError, ToBase58Check};
mod prefix_bytes {
pub const CHAIN_ID: [u8; 3] = [87, 82, 0];
pub const BLOCK_HASH: [u8; 2] = [1, 52];
pub const CONTEXT_HASH: [u8; 2] = [79, 1... |
// 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.
#![allow(dead_code)] // TODO(https://fxbug.dev/77068) remove after toolchain rolls again
use argh::FromArgs;
use heck::SnakeCase;
use proc_macro2::TokenSt... |
// Copyright 2018-2020 Cargill Incorporated
//
// 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... |
use crate::module::*;
use proc_macro2::LineColumn;
use quote::ToTokens;
use std::collections::HashMap;
use std::fs::File;
use std::io::{self, prelude::*, BufReader, Read};
use std::path::PathBuf;
use syn::{self, spanned::Spanned, Ident, Item, ItemUse, UseGroup, UseName, UsePath, UseTree};
#[derive(Debug)]
pub struct E... |
extern crate itertools;
///! # Slot allocation primitives
///!
///! This module contains data structures describing the allocation of slots.
///!
///! The graphic below shows how slots relate to validators. In the example we have two
///! validators that produce blocks distributed over a total of 16 slots. Validator #0... |
use backend::Facade;
use context::CommandContext;
use context::Context;
use version::Version;
use CapabilitiesSource;
use ContextExt;
use gl;
use std::os::raw;
use std::error::Error;
use std::{fmt, mem, ptr};
use std::cell::Cell;
use std::rc::Rc;
use std::ops::{Deref, DerefMut, Range};
use GlObject;
use TransformFeedba... |
use cargo::core::{enable_nightly_features, GitReference, SourceId, Workspace};
use cargo::util::Sha256;
use cargo::util::{CargoResult, CargoResultExt, Config};
use docopt::Docopt;
use failure::bail;
use serde::{Deserialize, Serialize};
use std::collections::hash_map::DefaultHasher;
use std::collections::{BTreeMap, BTre... |
#![allow(non_snake_case, unused_macros)]
use rand::prelude::*;
use proconio::{input, marker::*};
use svg::node::{element::{Rectangle, Line, Group, Title, Definitions, Use, Path}, Text};
use std::f64::consts::PI;
pub trait SetMinMax {
fn setmin(&mut self, v: Self) -> bool;
fn setmax(&mut self, v: Self) -> bool;
}
im... |
use std::convert::{TryInto, TryFrom};
use std::{fmt, fs, io, ops};
use std::path::Path;
use std::io::{Write, BufRead};
use std::collections::VecDeque;
use std::cell::RefCell;
use std::rc::Rc;
use crate::emulator::Opcode::Halt;
pub type Word = i64;
pub type InputHandler = dyn FnMut(&mut Context) -> io::Result<Word>;
pu... |
use std::fmt;
use std::iter::{Iterator};
use std::ops::Range;
use std::str;
use crate::base::{Color, ChessError, ErrorKind};
use crate::game::{Board, FieldContent, USIZE_RANGE_063};
use tinyvec::alloc::fmt::Formatter;
use crate::base::direction::Direction;
#[derive(Copy, Clone, Eq)]
pub struct Position {
pub colum... |
#[derive(Debug)]
/// A JS Keyword
///
/// # Standard
/// await
/// break
/// case
/// catch
/// class
/// const
/// continue
/// debugger
/// default
/// delete (10)
/// do
/// else
/// export
/// extends
/// finally
/// for
/// function
/// if
/// import
/// in (20)
/// instanceof
/// new
/// return
/// super
/// swit... |
//! This modules handles converting `Vec<Structure>` into `Vec<Stmt>`.
use super::*;
use crate::rust_ast::comment_store;
/// Convert a sequence of structures produced by Relooper back into Rust statements
pub fn structured_cfg(
root: &Vec<Structure<StmtOrComment>>,
comment_store: &mut comment_store::CommentS... |
//! Build the joint tree from the VertexRecord.
//!
//! Our problem is this: given the symbolic matrix M which is to be applied to
//! each vertex
//!
//! V(p) = M(p) (vertex pos)
//!
//! (where the dependence is on the pose p, ie. the value of the object
//! matrices) determine a skin which has the same effect. Th... |
use std::future::Future;
use unrecurse::{Action, Lifetime, Recursion, RecursionContext, RefStack, WithLifetime};
#[derive(Default, Debug, Clone, Eq, PartialEq)]
struct BinaryTree {
v: i32,
left: Option<Box<BinaryTree>>,
right: Option<Box<BinaryTree>>,
}
impl BinaryTree {
fn invert(&mut self) {
... |
//! Controllers (Gamepads, Joysticks, Steering wheels, etc).
//!
//! # F.A.Q
//!
//! ## What is meant by "Controller"?
//!
//! A catch-all term for "game input devices". A controller can be classified as one
//! or more of the following :
//!
//! - Gamepads, such as Xbox gamepads and DualShock gamepads;
//! - Steering ... |
//! Calculation of block and sky light.
//!
//! # Algorithms: block light
//! For block light calculation, we define four types of block
//! updates for which to perform lighting:
//!
//! * Creation of a light-emitting block. We simply propagate
//! the light update using flood fill.
//!
//! * Removal of a light-emitti... |
//! OverlayFS
use crate::alloc_prelude::*;
use crate::path as fspath;
use crate::{
traverse_node, FsDirectory, FsError, FsFile, FsFileHandle, FsNode, FsReadDir, FsRoot,
FsWriteDir,
};
use alloc::sync::Arc;
use core::cmp::PartialEq;
use core::fmt::{self, Debug};
use slos_helpers::UnsafeContainer;
static mut CURRENT... |
use std::{net::SocketAddr, time::Duration};
use anyhow::Context;
use bytes::BytesMut;
use tokio::{net::UdpSocket, sync::{broadcast, mpsc, oneshot}};
use futures::{FutureExt, Stream, StreamExt, TryStreamExt};
use tokio_stream::{self, wrappers::ReceiverStream};
use tokio_util::sync::PollSender;
use crate::network::{fern... |
//! PWM example using 'advanced' features
//!
//! This was tested on a NUCLEO-H743ZI2 board (MB1364) with the following IO:
//!
//! PE1 (LD2) - GPIO output - indicates fault status of TIM1
//! PC13 (USER button) - GPIO input - push to reset all TIM1,8,15,16,17 fault; active high button, with pull-down enabled to set id... |
mod card;
mod cmds;
mod mode_sd;
use std::fmt;
use std::io::{Read, Write};
use std::mem;
use io::DmaTrigger;
use io::emmc::card::Card;
use cpu::irq::{self, IrqClient};
use fs;
bf!(RegCmd[u16] {
command_index: 0:5,
command_type: 6:7,
_response_type: 8:10,
_has_data: 11:11,
_is_reading: 12:12,
... |
//! Learning to code Rust for a http + websocket server on the same port
//! using Warp for a simple memory game for kids - mem3.
//! On the local public IP address on port 80 listens to http and websocket.
//! Route for http / serves static files from folder /mem3/
//! Route /mem3ws/ broadcast all websocket msg to a... |
// 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 {
breakpoints_capability::*,
component_manager_lib::{
model::{
self, hooks::*, testing::breakpoints::*, testing::test_helpe... |
use crate::ast;
use crate::ptr::P;
use crate::token::{BinOp, Delim, Keyword, Kind as T, NumberKind, Token};
use crate::Span;
use super::{PResult, Parser};
impl<'a, I> Parser<'a, I>
where
I: Iterator<Item = Token>,
{
pub fn parse_expr(&mut self) -> PResult<'a, ast::Expr> {
self.parse_expr_with_preceden... |
use assert_cmd::prelude::*;
use futures::prelude::*;
use influxdb_iox_client::connection::Connection;
use std::{
path::Path,
process::{Child, Command},
str,
sync::Arc,
time::Duration,
};
use tempfile::{NamedTempFile, TempDir};
use tokio::sync::Mutex;
use crate::{database::initialize_db, server_type... |
use std::{collections::HashMap, str::FromStr};
use anyhow::Result;
use chrono::NaiveDate;
use rand::seq::SliceRandom;
use rand::thread_rng;
use rusqlite::Connection;
use serde_derive::{Deserialize, Serialize};
use serde_rusqlite::*;
use strum::IntoEnumIterator;
use strum_macros::EnumIter;
use uuid::Uuid;
use crate::a... |
//! Project Euler solutions for problems 101 through 110.
//!
//! This crate is designed to be used via crate `euler`.
use std::mem;
extern crate itertools;
use itertools::Itertools;
extern crate petgraph;
use petgraph::Graph;
use petgraph::algo::min_spanning_tree;
use petgraph::data::FromElements;
extern crate eul... |
use std::str::Chars;
use std::str::FromStr;
use byteorder::LittleEndian;
use byteorder::WriteBytesExt;
use uuid::Uuid;
use crate::atn::ATN;
use crate::atn_deserialization_options::ATNDeserializationOptions;
use crate::atn_state::ATNBlockStart;
use crate::atn_state::ATNDecisionState;
use crate::atn_state::ATNState;
us... |
use crate::{
auth::{UserInfo, ANONYMOUS},
channel::Channel,
chars::Chars,
config,
os::{Krb5ServerCtx, ServerCtx},
pack::Pack,
pool::{Pool, Pooled},
protocol::{
publisher,
resolver::{
ClientAuthRead, ClientAuthWrite, ClientHello, ClientHelloWrite, CtxId,
... |
use rand::rngs::ThreadRng;
use rand::Rng;
use std::fs;
use std::path::PathBuf;
/// chip8 original screen size
pub const SCREEN_SIZE: (usize, usize) = (64, 32);
/// predefined font sprites
const FONT_DATA: [u8; 80] = [
0xF0, 0x90, 0x90, 0x90, 0xF0, // 0
0x20, 0x60, 0x20, 0x20, 0x70, // 1
0xF0, 0x10, 0xF0, ... |
use core::fmt::Debug;
use crate::internal::*;
use crate::{arch::Arch, ConsoleOutput, OptResult, Tid, TidSelector, SINGLE_THREAD_TID};
/// A collection of methods and metadata a `GdbStub` can use to control and
/// debug a system.
///
/// There are several [provided methods](#provided-methods) that can optionally
/// ... |
//============================================================================
//
// A Tagged Image File Format (TIFF) Library for Rust
//
// Based on the TIFF 6.0 specification:
//
// https://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
//
// Copyright (c) 2014 by <NAME> <<EMAIL>>
// Published under ... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! Data flow analysis computing borrow information for preparation of memory_instrumentation.
use crate::{
dataflow_analysis::{AbstractDomain, DataflowAnalysis, JoinResult, TransferFunctions},
function_target::{FunctionData, F... |
#![allow(dead_code)]
use super::d2d1::*;
use crate::impl_bitflag_operators;
use winapi::um::d2d1_1::*;
use winapi::um::d2d1effectauthor::*;
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct BitmapOptions(u32);
#[allow(non_upper_case_globals)]
impl BitmapOptions {
pub const None: Self = Self(D2D1_BITMAP_OPTI... |
//! The `metrics` module enables sending measurements to an `InfluxDB` instance
use crate::{counter::CounterPoint, datapoint::DataPoint};
use gethostname::gethostname;
use lazy_static::lazy_static;
use log::*;
use solana_sdk::hash::hash;
use std::{
collections::HashMap,
convert::Into,
sync::{
mpsc:... |
use ethers::{
abi::{Abi, Function, Token},
types::{Address, Bytes},
};
use evm_adapters::{fuzz::FuzzedExecutor, Evm, EvmError};
use eyre::{Context, Result};
use regex::Regex;
use std::{collections::HashMap, fmt, time::Instant};
use proptest::test_runner::{TestError, TestRunner};
use serde::{Deserialize, Seri... |
use std::collections::{HashMap, HashSet};
use std::num::NonZeroU64;
use std::rc::Rc;
// "ensure" seems to require "bail" be in scope (macro hygiene issue?).
#[allow(unused_imports)]
use failure::{bail, ensure};
use log::debug;
use crate::core::interning::InternedString;
use crate::core::{Dependency, FeatureValue, Pac... |
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by ... |
use serde::{Deserialize, Serialize};
use std::fmt::{Display, Formatter};
#[derive(Serialize, Deserialize, Copy, Clone)]
pub struct Instruction {
pub opcode_byte: u8,
pub operand: u16,
pub opcode: Opcode,
pub addressing_mode: AddressingMode,
}
#[derive(Serialize, Deserialize, PartialEq, Eq, Copy, Clone... |
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under both the MIT license found in the
// LICENSE-MIT file in the root directory of this source tree and the Apache
// License, Version 2.0 found in the LICENSE-APACHE file in the root directory
// of this source tree.
//! This mod... |
use std::error::Error;
use std::fs;
use std::io::Write;
use std::path::Path;
use fenris::element::ElementConnectivity;
use fenris::embedding::{compute_element_embedded_quadrature, embed_mesh_3d, optimize_quadrature, QuadratureOptions};
use fenris::geometry::polymesh::PolyMesh3d;
use fenris::geometry::procedural::creat... |
use std::marker::PhantomData;
use std::time::Duration;
use failure::Error;
use futures::{Async, Poll, Stream};
use gob::StreamDeserializer;
use serde::de::DeserializeOwned;
use tokio::io::AsyncRead;
use super::super::error::ConnectionError;
use super::messages;
use super::payload::PayloadDeserializer;
use context;
#... |
// Copyright 2019 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
account_config::XUS_NAME,
account_state_blob::AccountStateBlob,
block_info::BlockInfo,
chain_id::ChainId,
ledger_info::LedgerInfo,
proof::{
definition::MAX_ACCUMULATOR_PROOF_DEPTH, AccountSta... |
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::colors;
use crate::inspector_server::InspectorServer;
use crate::js;
use crate::ops;
use crate::permissions::Permissions;
use crate::tokio_util::create_basic_runtime;
use crate::BootstrapOptions;
use deno_broadcast_channel::InMemoryBr... |
#![feature(test)]
extern crate test;
use wasm_bindgen::prelude::*;
const P: [u8; 512] = [
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 5... |
// Copyright 2020 The Matrix.org Foundation C.I.C.
//
// 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... |
use std::io::*;
use std::collections::VecDeque;
#[derive(PartialEq, Debug)]
pub enum Tokens {
Integer(i32),
Float(f64),
TString(String),
Bool(bool),
OpPlus, OpMinus, OpMult, OpDiv, OpMod, OpExp,
OpLor, OpLand, OpOr, OpAnd, OpEq, OpLt, OpGt,
OpLeq, OpGeq, OpNeq, OpAssign, OpQ, OpDot,
Op... |
//! `PyClass` and related traits.
use crate::class::methods::{PyClassAttributeDef, PyMethodDefType, PyMethods};
use crate::class::proto_methods::PyProtoMethods;
use crate::conversion::{AsPyPointer, FromPyPointer};
use crate::derive_utils::PyBaseTypeUtils;
use crate::pyclass_slots::{PyClassDict, PyClassWeakRef};
use cra... |
mod error;
mod issue;
mod redeem;
mod replace;
mod vault;
use bitcoin::{BitcoinCore, BitcoinCoreApi, ConversionError, PartialAddress};
use clap::Clap;
use error::Error;
use futures::future::try_join_all;
use git_version::git_version;
use log::*;
use parity_scale_codec::{Decode, Encode};
use runtime::{
substrate_su... |
// Copyright 2017 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
// Generated from ReferenceToATN.g4 by ANTLR 4.8
#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(nonstandard_style)]
#![allow(unused_imports)]
#![allow(unused_mut)]
use super::referencetoatnlistener::*;
use antlr_rust::atn::{ATN, INVALID_ALT};
use antlr_rust::atn_deserializer::... |
mod c_api;
pub mod update_handler;
#[cfg(feature = "c_api")]
pub use c_api::*;
use crate::flatbuf::FlatbufConverter;
use crate::{
api::update_handler::{
ChainedUpdateHandler, DeltaUpdateHandler, IMTUpdateHandler, ThreadUpdateHandler,
UpdateHandler, ValMapUpdateHandler,
},
ddlog::D3logLocal... |
use super::real;
use crate::geometry::Real;
use core::f32::consts::PI;
use core::ops::{Add, AddAssign, Neg, Sub, SubAssign};
use float_cmp::{ApproxEq, F32Margin};
#[cfg(not(feature = "fixed_point"))]
#[allow(unused_imports)]
use micromath::F32Ext;
pub(crate) mod angle_consts {
use super::{real, Angle};
pub(cr... |
use crate::{irc::TagIndices, MaybeOwned};
use std::{borrow::Borrow, str::FromStr};
/// Tags are IRCv3 message tags. Twitch uses them extensively.
///
/// This type is usually obstained temporarily from `::tags()` call on a message type.
///
/// This type is intentionall very cheap and just borrows a pre-computed set o... |
extern crate midir;
extern crate wooting_analog_wrapper;
#[allow(unused_imports)]
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate anyhow;
use log::*;
use sdk::SDKResult;
pub use sdk::{DeviceInfo, FromPrimitive, HIDCodes, ToPrimitive, WootingAnalogResult};
use wooting_analog_wrapper as sdk;
use anyhow... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.