text stringlengths 3.09k 13.9k |
|---|
//! An asynchronously awaitable `CancellationToken`.
//! The token allows to signal a cancellation request to one or more tasks.
pub(crate) mod guard;
mod tree_node;
use crate::loom::sync::Arc;
use core::future::Future;
use core::pin::Pin;
use core::task::{Context, Poll};
use guard::DropGuard;
use pin_project_lite::p... |
use mk20d7::{sim::RegisterBlock, sim::clkdiv1};
pub const MAXIMUM_CLOCK_FREQUENCY: u8 = 72;
pub struct SystemIntegrationModule<'a> {
sim: &'a RegisterBlock,
}
impl<'a> SystemIntegrationModule<'a> {
pub fn new (sim: &'a RegisterBlock) -> SystemIntegrationModule<'a> {
SystemIntegrationModule { sim }
... |
use crate::{
gui::{gui_renderer::GuiRenderer, Button, Label},
start_game::StartGameState,
GameContext,
};
use common::comms::DEFAULT_TCP_PORT;
use common::world_definition::*;
use gamework::*;
const SAVES_PER_PAGE: usize = 7;
pub struct LoadGameState {
gui: Gui<GuiRenderer>,
prev_button: WidgetId,... |
//! Implementation of the BPM peripheral.
use kernel::utilities::registers::interfaces::{Readable, Writeable};
use kernel::utilities::registers::{register_bitfields, ReadOnly, ReadWrite, WriteOnly};
use kernel::utilities::StaticRef;
#[repr(C)]
struct BpmRegisters {
ier: WriteOnly<u32, Interrupt::Register>,
id... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
use std::{ops::Deref, sync::Arc};
use actix_web::FromRequest;
use chrono::{DateTime, Duration, Utc};
use futures::future::{ready, Ready};
use tokio::sync::RwLock;
use crate::algolia;
use crate::error;
use crate::error::ServiceKind;
use crate::translate;
use core::google::GoogleAccessTokenResponse;
use self::translat... |
use std::collections::HashMap;
use std::net::SocketAddr;
use std::sync::Arc;
use std::time::{Duration, Instant};
use futures::future::{abortable, BoxFuture};
use log::*;
use tokio::sync::{
mpsc::{self, Sender},
oneshot, Mutex as TokioMutex,
};
use crate::app::dispatcher::Dispatcher;
use crate::option;
use cra... |
#![cfg_attr(not(target_env = "sgx"), no_std)]
#![cfg_attr(
all(target_env = "sgx", target_vendor = "mesalock"),
feature(rustc_private)
)]
#[cfg(not(target_env = "sgx"))]
#[macro_use]
extern crate sgx_tstd as std;
pub use std::prelude::v1::*;
use log::debug;
use std::ops::Range;
use std::time::Instant;
#[cfg(... |
use crate::tasks::config::CommonConfig;
use crate::tasks::utils::parse_key_value;
use anyhow::Result;
use clap::{App, Arg, ArgMatches};
use std::{collections::HashMap, path::PathBuf};
use uuid::Uuid;
pub const SETUP_DIR: &str = "setup_dir";
pub const INPUTS_DIR: &str = "inputs_dir";
pub const CRASHES_DIR: &str = "cra... |
use crate::{
enums::{
EntityType,
TBool,
},
models::{
Position,
TString,
},
};
use scroll::{
ctx::{
SizeWith,
TryFromCtx,
TryIntoCtx,
},
Endian,
Error as ScrollError,
Pread,
Pwrite,
LE,
};
/// Represents a friendly NPC.
///
/// See [Terraria Wiki: NPCs](https://terrari... |
#![no_std]
extern crate x86;
#[allow(unused_imports)]
#[macro_use(info, debug)]
extern crate log;
#[cfg(test)]
extern crate env_logger;
#[macro_use(lazy_static)]
extern crate lazy_static;
use core::fmt;
use core::ops;
pub use core::time::Duration;
#[cfg(all(target_arch = "x86_64", target_os = "none"))]
#[path = "... |
use std::collections::HashSet;
use std::io::BufReader;
use std::str::FromStr;
use std::error::Error;
use std::fmt;
use chrono::NaiveDateTime;
use postgres;
use quick_xml as xml;
use quick_xml::events::Event;
use archive;
use open;
use pkg;
use man;
// Ugh, quick-xml's Error type does not implement Error.
#[derive(De... |
//! The implementations of various commands.
use crate::arguments::Coordinates;
use crate::{
arguments::{EntitySelector, ParsedGamemode, TextArgument},
CommandCtx,
};
use feather_core::text::{Text, TextComponentBuilder};
use feather_core::util::{Gamemode, Position};
use feather_server_types::{
ChatEvent, C... |
//! Relation learning algorithm.
use std::sync::RwLock;
use crate::{prog::Prog, syscall::SyscallId, target::Target, HashMap};
#[derive(Debug)]
pub struct RelationWrapper {
pub inner: RwLock<Relation>,
}
impl RelationWrapper {
pub fn new(r: Relation) -> Self {
Self {
inner: RwLock::new(r)... |
use ethers::types::{Address, U256};
use serde::{Deserialize, Serialize};
use std::str::FromStr;
#[cfg(feature = "evmodin")]
use evmodin::util::mocked_host::MockedHost;
#[cfg(feature = "sputnik")]
use sputnik::backend::MemoryVicinity;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum EvmType {
#[cfg(feature... |
use crate::{
cmd::{
api_url, get_password, get_payer, get_txn_fees, load_wallet, print_footer, print_json,
status_json, status_str, Opts, OutputFormat,
},
keypair::PubKeyBin,
result::Result,
staking,
traits::{Sign, Signer, TxnEnvelope, TxnFee, TxnStakingFee, B58, B64},
};
use hel... |
extern crate piston_window;
extern crate opengl_graphics;
extern crate rand;
extern crate image;
extern crate rayon;
/*
TODO
clean up types, specifically in sense function
clean up, try to boost performance
agents seem to stick to walls on the right and bottom sides
*/
use piston_window::*;
use opengl_graphics::OpenG... |
use crate::grid::grid::Grid;
use crate::grid::Dir;
use crate::moveable::Moveable;
use crate::CELL_SIZE;
use crate::PLAYER_SIZE;
use quicksilver::geom::Rectangle;
use quicksilver::graphics::{Font, FontStyle, Image};
use quicksilver::lifecycle::Window;
use quicksilver::Result;
use quicksilver::{
geom::{Shape, Vector}... |
#![cfg_attr(not(feature = "std"), no_std)]
/// A FRAME pallet template with necessary imports
/// Feel free to remove or edit this file as needed.
/// If you change the name of this file, make sure to update its references in runtime/src/lib.rs
/// If you remove this file, you can remove those references
/// For mor... |
// Copyright 2015-2016 <NAME>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL... |
use crate::interaction::*;
use bevy::prelude::*;
use defaults::*;
use lab_data::*;
use serde::{Deserialize, Serialize};
use std::{
collections::{
hash_map::{Keys, Values},
HashMap,
},
fmt::Debug,
hash::Hash,
hash::Hasher,
marker::PhantomData,
sync::Arc,
};
use uuid::Uuid;
#[... |
use std;
use std::marker::PhantomData;
use std::time::Duration;
use std::time::Instant;
use futures::prelude::*;
use tokio::timer::Interval;
use crate::{convert_err, ResultHandleSupport};
use crate::FromHandle;
use crate::SmartHandle;
use crate::speech_api::*;
use crate::SpxError;
use crate::SPXHANDLE_INVALID;
const... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#![deny(warnings)]
use libc;
use std::io::{Error, ErrorKind};
use std::mem;
use std::thread;
const VMADDR_CID_HOST: libc::c_uint = 2;
const VMADDR_CID_AN... |
//! Extensions for schema
#[cfg(feature = "apollo_tracing")]
mod apollo_tracing;
#[cfg(feature = "log")]
mod logger;
#[cfg(feature = "tracing")]
mod tracing;
use crate::context::{QueryPathNode, ResolveId};
use crate::{FieldResult, QueryEnv, Result, SchemaEnv, Variables};
#[cfg(feature = "apollo_tracing")]
pub use se... |
// Copyright 2019 Alibaba Cloud. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
//! Event notifier to inject device interrupts to virtual machines.
use std::any::Any;
use std::io::Error;
use std::sync::Arc;
use vmm_sys_util::eventfd::EventFd;
use crate::{InterruptIndex, InterruptSource... |
#[cfg(test)]
extern crate serde;
#[cfg(test)]
extern crate flate2;
#[cfg(test)]
extern crate serde_json;
#[cfg(test)]
#[macro_use]
extern crate serde_derive;
extern crate rusqlite;
mod map;
pub use map::SqliteMap;
#[cfg(test)]
mod tests {
use super::*;
use rusqlite;
use rusqlite::Connection;
use rusql... |
mod commands;
mod db;
mod model;
mod server;
mod slash_commands;
mod snek;
use crate::{
commands::servers::turn_check::update_details_cache_loop, db::*, model::game_state::CacheEntry,
};
use anyhow::{anyhow, Context as _};
use chrono::{DateTime, Utc};
use log::*;
use serenity::{
async_trait, framework::standar... |
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate serde;
extern crate ron;
extern crate rustls;
extern crate percent_encoding;
use std::net::{
TcpListener,
TcpStream
};
use std::io::{
prelude::*,
BufReader,
};
use std::collections::HashMap;
use std::time::Duration;
use std::fs::File;
use... |
use server::asset::{ Asset };
use crate::widget::WidgetKey;
use crate::widget::codeeditor::CodeEditor;
use crate::widget::context::ScreenContext;
use crate::widget::text_editor_trait::TextEditorWidget;
//use fontdue::Font;
#[derive(PartialEq, Debug)]
pub enum CodeEditorWidgetState {
Closed,
Open,
Opening,... |
use std::iter::FromIterator;
use arrayvec::ArrayVec;
use thiserror::Error;
use crate::BitBoard;
use crate::BoardPos;
use crate::Piece;
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Move {
pub from: BoardPos,
pub to: BoardPos,
pub promotion: Option<Piece>,
}
#[derive(Clone, Copy... |
use ark_ec::mnt6::MNT6Parameters;
use ark_mnt4_753::Fr as MNT4Fr;
use ark_mnt6_753::constraints::{Fq3Var, FqVar};
use ark_mnt6_753::Parameters;
use ark_r1cs_std::groups::curves::short_weierstrass::AffineVar;
use ark_r1cs_std::prelude::Boolean;
use ark_relations::r1cs::{ConstraintSystemRef, SynthesisError};
use crate::... |
use std::{
collections::VecDeque,
sync::{
atomic::{AtomicBool, AtomicU64, Ordering},
Arc,
},
time::Duration,
};
use crate::{
dsp::Frame,
sound::streaming::{decoder::Decoder, StreamingSoundSettings},
LoopBehavior,
};
use ringbuf::{Consumer, Producer, RingBuffer};
const BUFFER_SIZE: usize = 16_384;
const SEE... |
/*
* 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... |
#![allow(dead_code)]
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::iter::FromIterator;
use std::char;
/// Enum for `Stone`,
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum Stone {
Empty,
White,
Black,
}
impl Default for Stone {
fn default() -> Stone {
Stone::Empty
}
}
imp... |
use std::{iter::Peekable, ops::Deref};
use crate::token::*;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum NodeKind {
NdADD, // +
NdSub, // -
NdMul, // *
NdDiv, // /
NdEq, // ==
NdNe, // !=
NdLt, // <
NdLe, // <=
NdNum, // Interger
}
#[derive(Debug, Clone)]
pub struct Node {
... |
//! Convert closures to futures based on greenthread on bare-metal (no_std + no_alloc).
#![cfg_attr(not(test), no_std)]
#![feature(asm)]
#![feature(global_asm)]
#![feature(naked_functions)]
#![feature(untagged_unions)]
#![deny(warnings)]
use core::future::Future;
use core::mem::ManuallyDrop;
use core::pin::Pin;
use c... |
use std::sync::Arc;
use std::time::SystemTime;
#[derive(Clone, Copy)]
pub struct Metrics {
pub mem: i64,
pub upload: i64,
pub reqs: i32,
pub errs: i32,
pub conns: i32,
pub events: i32,
pub p50: i16,
pub p95: i16,
pub p99: i16,
}
#[derive(Clone, Copy, Serialize)]
pub struct Aggregat... |
// pub mod kvs {
use std::collections::HashMap;
use std::fs::{File, read_to_string, read};
use std::fs::OpenOptions;
use std::io::{Read, Seek, SeekFrom, Write};
use std::path::Path;
use failure::_core::cell::RefCell;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
enum Command {
Get(... |
/*
* Copyright © 2002-2017 Bluebeam Software, Inc. All Rights Reserved.
* Creator: <NAME>
*/
use std::collections::{ HashMap, HashSet };
use std::fmt;
use parser::ast::{Statement, StatementKind, DataTypeStatement};
use generator::resolver::ResolveError;
pub struct TypeDefinition {
identifier: String,
num_p... |
#![feature(rustc_private)]
extern crate getopts;
extern crate miri;
extern crate rustc;
extern crate rustc_metadata;
extern crate rustc_driver;
extern crate rustc_errors;
extern crate rustc_codegen_utils;
extern crate env_logger;
extern crate log_settings;
extern crate syntax;
#[macro_use]
extern crate log;
use std:... |
use crate::account::contact::AccountContact;
use crate::account::{Account, AccountEndpoint, AccountKey, ExternalAccount};
use crate::storage::{account_files_exists, get_account_data, set_account_data, FileManager};
use acme_common::crypto::KeyPair;
use acme_common::error::Error;
use serde::{Deserialize, Serialize};
use... |
#![feature(unsize)]
//! Let's create a thin pointer!
//!
//! This is a completely different design that the one in the RFC, using a middle-pointer.
mod thin {
use std::{
alloc::{self, Layout},
cmp,
fmt::{self, Debug, Formatter},
marker::{PhantomData, Unsize},
mem,
ops::{Deref, DerefMut},
... |
use crate::tt_cursor::TtCursor;
/// This module parses a raw `tt::TokenStream` into macro-by-example token
/// stream. This is a *mostly* identify function, expect for handling of
/// `$var:tt_kind` and `$(repeat),*` constructs.
use crate::ParseError;
pub(crate) fn parse(tt: &tt::Subtree) -> Result<crate::MacroRules, ... |
use crate::config::Config;
use crate::debugger::{cpu_status_str, disassemble_current, smp_status_str};
use crate::draw_data::DrawData;
use crate::framebuffer::Framebuffer;
use crate::text::TextRenderer;
use itertools::Itertools;
use std::time::Instant;
use super_rustycom_core::snes::SNES;
pub struct UI {
text_rend... |
use super::{texture_group::TextureGroup, AudioGroup, FilesystemPath, Tags, ViewPathLocation};
use crate::ResourceVersion;
use serde::{Deserialize, Serialize};
use smart_default::SmartDefault;
use std::{
hash::Hash,
path::{Path, PathBuf},
};
/// GMS2 project file typings
#[derive(Debug, Serialize, Deserialize, ... |
use math::{Matrix4, Vector2, Vector3, Vector4};
use std::mem::size_of;
use std::rc::Rc;
use std::cell::RefCell;
use std::rc;
use fnv::FnvHashMap;
use std::borrow::Cow;
use uni_gl::{WebGLProgram, WebGLRenderingContext, WebGLUniformLocation};
use engine::render::Texture;
trait IntoBytes {
fn into_byte... |
// Copyright 2020 Arm Limited (or its affiliates). All rights reserved.
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/// Module for the flattened device tree.
pub mod fdt;
/// Module for the global interrupt controller configuration.
pub mod gic;
mod... |
// Copyright 2019 The Grin 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 agreed t... |
use std::convert::Infallible;
use std::sync::atomic::{AtomicU64, AtomicUsize, Ordering};
use std::sync::Arc;
use std::time::Duration;
use anyhow::{Context, Result};
use futures_util::future::Either;
use tokio::sync::{Mutex, Notify, RwLock, RwLockWriteGuard};
use crate::config::*;
use crate::utils::*;
/// Creates exp... |
use crate::{TiRangeBounds, TiSlice};
use core::ops;
mod private {
use core::ops;
pub trait Sealed<K> {}
impl<K> Sealed<K> for K {}
impl<K> Sealed<K> for ops::Range<K> {}
impl<K> Sealed<K> for ops::RangeTo<K> {}
impl<K> Sealed<K> for ops::RangeFrom<K> {}
impl<K> Sealed<K> for ops::RangeInc... |
use std::sync::Arc;
use std::sync::mpsc::channel;
use histogram::Histogram;
use threadpool::ThreadPool;
use time;
/// Client factory.
pub trait ClientFactory: Send + Sync + 'static {
type Client: Send + Sync;
/// Create a new client instance.
fn create(&self) -> Self::Client;
}
impl<Client, F> ClientFac... |
use crate::support::long;
use crate::support::Delete;
use crate::support::Opaque;
use crate::support::Shared;
use crate::support::SharedRef;
use crate::support::UniqueRef;
use crate::ArrayBuffer;
use crate::InIsolate;
use crate::Isolate;
use crate::Local;
use crate::ToLocal;
extern "C" {
fn v8__ArrayBuffer__Allocato... |
pub use ::anyhow;
#[doc(no_inline)]
pub use ::anyhow::{anyhow, Context as _};
#[doc(no_inline)]
pub use ::async_trait;
#[doc(no_inline)]
pub use async_trait::*;
#[doc(no_inline)]
pub use bincode;
#[doc(no_inline)]
pub use clap;
pub use derive_more;
#[doc(no_inline)]
pub use derive_more::{Constructor, Deref, DerefMut};
... |
// 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 {
super::{Error, RepositoryBackend, Resource},
anyhow::Result,
bytes::{Bytes, BytesMut},
futures::{ready, stream, AsyncRead, Stream},
... |
//!`gio-futures` integration
use glib::prelude::*;
use gio::prelude::*;
use std::io;
use std::pin::Pin;
use std::task::{Context, Poll};
use futures::prelude::*;
use futures::{AsyncRead, AsyncWrite};
use pin_project::pin_project;
/// SocketClient wrapper
pub struct SocketClient(gio::SocketClient);
impl SocketClien... |
// Copyright 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 in writ... |
// This program watches a configured directory for incoming files.
// When a file is detected the following procedure is used to handle it:
//
// * First we digest the file, and add the digest to our manifest.
// This way we can intelligently handle future events for this file
//
// * Next we attempt to detect a m... |
//! Natural log (ln) approximation for a single-precision float.
//!
//! Method described at: <https://stackoverflow.com/a/44232045/>
//!
//! Modified to not be restricted to int range and only values of x above 1.0.
//! Also got rid of most of the slow conversions. Should work for all positive values of x.
use super:... |
use std::str;
fn is_1478(s: &str) -> bool{
let l = s.len();
l == 2 || l == 3 || l == 4 || l == 7
}
#[aoc(day8, part1)]
pub fn part1(input: &[u8]) -> i64 {
let pairs: Vec<Vec<&str>> = str::from_utf8(input).unwrap().trim().split("\n").map(|a|a.trim().split("|").map(|s|s.trim()).collect()).collect();
let... |
use lameboy::cpu::registers::{Flags, Reg16, Reg8, Register};
pub mod bit_opcodes;
pub mod calls;
pub mod eight_bit_alu;
pub mod eight_bit_loads;
pub mod jumps;
pub mod misc;
pub mod restarts;
pub mod returns;
pub mod rotates_and_shifts;
pub mod sixteen_bit_alu;
pub mod sixteen_bit_loads;
mod alu;
mod stack;
/// Test... |
use ggez::graphics;
use crate::{
err_here,
error::{LocatedError, WrappedError},
sprite_sheet::SpriteSheet,
};
#[allow(dead_code)]
enum PanelDirection {
TopLeft,
Top,
TopRight,
Left,
Center,
Right,
BottomLeft,
Bottom,
BottomRight,
}
/// A panel for a window or a part of... |
mod request_id;
mod injector;
mod detector;
mod config;
mod error;
mod utils;
mod botd;
mod edge;
use std::panic;
use fastly::{Error, Request, Response};
use fastly::http::header::{ACCEPT_ENCODING, SET_COOKIE};
use fastly::http::StatusCode;
use botd::BotDetector;
use edge::EdgeDetect;
use BotdError::SendError;
use cra... |
use std::{cmp::min, error::Error, fmt};
use itertools::izip;
#[derive(Debug)]
pub struct ParseSimulationError(&'static str);
impl fmt::Display for ParseSimulationError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Simulation parse error: {}", self.0)
}
}
impl Error for Pars... |
//
//! Copyright 2020 Alibaba Group Holding Limited.
//!
//! 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 ... |
use std::cmp::{min};
use std::collections::HashMap;
use rand::{thread_rng, Rng};
/// Used to represent a single tile
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub enum Tile {
Wall,
Floor
}
#[derive(Debug)]
struct Room {
top_left: (usize, usize),
/// Non inclusive bound
down_right: (usize, usiz... |
use futures::channel::mpsc;
use futures::executor;
use futures::future;
use futures::prelude::*;
use futures::task;
use future_ext::{Breaker, FutureWrapExt};
use module::{flow, Module};
use jack::*;
use ndarray::{Array, Array2, Axis};
use std::sync::Arc;
pub struct Frame {
pub rate: f32,
pub data: Array2<f... |
use std::io::Result;
use tmi_parser::*;
#[test]
fn parse_notice() -> Result<()> {
let note1 = "@msg-id=<msg id> :tmi.twitch.tv NOTICE #<channel> :<message>";
let note2 =
"@msg-id=slow_off :tmi.twitch.tv NOTICE #dallas :This room is no longer in slow mode.\r\n";
let mut tags1 = Tags::default();
... |
use eyre::{eyre, Report};
use reqwest::{Error, IntoUrl};
use scraper::{Html, Selector};
use url::Url;
/// This `Scraper` is specific to reenigne's server, but there's no reason
/// why it can't be spun off into a trait later.
pub struct Scraper {
document: Html,
server: Url,
}
impl Scraper {
pub fn new<T>... |
use mpstthree::binary::struct_trait::end::End;
use mpstthree::binary::struct_trait::recv::Recv;
use mpstthree::binary::struct_trait::send::Send;
use mpstthree::role::broadcast::RoleBroadcast;
use mpstthree::role::end::RoleEnd;
use mpstthree::{create_meshedchannels, create_multiple_normal_role};
use petgraph::dot::Dot... |
use super::{ErrorType, Result};
use crate::usb::mem::allocate_array;
use crate::usb::trb::{GenericTrb, LinkTrb, Trb};
use crate::usb::xhci::{Accessor, InterrupterRegisterSet};
use bit_field::BitField;
use core::ptr::null_mut;
#[derive(Debug)]
pub struct PushResult<T> {
pub ptr: u64,
pub trb: T,
}
#[derive(Deb... |
use nalgebra::geometry::{Point3, UnitQuaternion, Translation3};
use glium::{ Surface, VertexBuffer, IndexBuffer, Program, DrawParameters};
use render::{Vertex2D, DrawArea, Window};
use glium::index::PrimitiveType;
use std::collections::HashMap;
use nalgebra::core::{Matrix4};
use glium::index::NoIndices;
use render::cam... |
#![feature(asm, core_intrinsics, lang_items, naked_functions)]
#![no_std]
const GPFSEL2: u32 = 0x3F20_0008;
const GPSET0: u32 = 0x3F20_001C;
const GPCLR0: u32 = 0x3F20_0028;
const GPIO20: u32 = 1 << 20;
const GPIO21: u32 = 1 << 21;
const GPIO22: u32 = 1 << 22;
const IRQ_BASIC_PENDING: u32 = 0x3F00_B200;
const IRQ_BA... |
//! Store string-findings and prepare them for output.
extern crate encoding_rs;
use crate::input::ByteCounter;
use crate::mission::Mission;
use crate::options::Radix;
use crate::options::ARGS;
use crate::options::ASCII_ENC_LABEL;
use std::io::Write;
use std::str;
/// `OUTPUT_BUF_LEN` needs to be long enough to hold... |
use log::*;
use awc;
use openssl::ssl::{SslConnector, SslMethod};
use std::time::Duration;
use serde_derive::*;
use crate::TwitterError;
#[derive(Clone)]
pub(crate) struct TwitterClient {
url: String,
client: awc::Client,
key: String,
secret: String,
token: String,
}
#[derive(Debug,Deserialize)]
s... |
use super::base::{EnvParameter, Exportable, Template};
use crate::cmd::export::ExportOpts;
use crate::env::read_env;
use crate::process::port_for;
use crate::procfile::{Procfile, ProcfileEntry};
use handlebars::to_json;
use serde_derive::Serialize;
use serde_json::value::{Map, Value as Json};
use std::collections::Hash... |
//! This crate defines a custom derive macro `Iterator`. Should not be used
//! directly, but only through `shapely` crate, as it provides utilities
//! necessary for the generated code to compile.
extern crate proc_macro;
use prelude::*;
use inflector::Inflector;
use proc_macro2::{TokenStream, Ident, Span};
use quo... |
use anyhow::{bail, ensure, Result};
use indicatif::{ProgressBar, ProgressStyle};
use rustc_version::Channel;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::process::{self, Command, Stdio};
use std::str;
use tempdir::TempDir;
use walkdir::WalkDir;
fn get_sysroot() -> Result<PathBuf> {
let rustc... |
use serde::{
de::{self, Visitor},
Deserialize, Deserializer, Serialize, Serializer,
};
use std::fmt;
/// A representation of a Hash for use on a blockchain.
#[derive(PartialEq, Eq, Clone, Hash)]
pub struct Hash(pub [u8; 32]);
impl Hash {
/// Create a new empty Hash.
pub fn empty() -> Self {
Ha... |
use druid::im::Vector;
use druid::kurbo::{BezPath, Circle};
use druid::piet::{LineCap, LineJoin, StrokeStyle};
use druid::widget::{Button, Flex, Label, Slider};
use druid::{
AppLauncher, Color, Data, Event, Lens, Point, RenderContext, Widget, WidgetExt, WindowDesc,
};
use std::cell::RefCell;
use std::sync::Arc;
#... |
//! Extensible logger implementation.
#![deny(unconditional_recursion)]
#![allow(incomplete_features)] // To be removed, see: https://github.com/enso-org/ide/issues/1559
#![warn(missing_copy_implementations)]
#![warn(missing_debug_implementations)]
#![warn(missing_docs)]
#![warn(trivial_casts)]
#![warn(trivial_numeric... |
use anyhow::Result;
use std::time::Duration;
use tui::{
backend::Backend,
layout::{Alignment, Constraint, Direction, Layout, Rect},
style::{Color, Style},
terminal::Frame,
text::{Span, Spans, Text},
widgets::{Block, Borders, Paragraph, Row, Table, Tabs},
};
use crate::app::{Action, App};
use cr... |
//! Wraps a child operator, and mediates the communication of progress information.
use std::default::Default;
use progress::frontier::{MutableAntichain, Antichain};
use progress::{Timestamp, Operate};
use progress::nested::Target;
use progress::nested::subgraph::Target::{GraphOutput, ChildInput};
use progress::count... |
use crate::{
args::Args,
printer::Printer,
report::Report,
test::{Outcome, OutcomeKind, Test, TestDesc, TestKind},
ExitStatus,
};
use futures_core::{
future::Future,
task::{self, Poll},
};
use futures_util::{ready, stream::StreamExt};
use pin_project::pin_project;
use std::{collections::Hash... |
use crate::*;
#[derive(BorshDeserialize, BorshSerialize)]
pub struct Contract {
pub hash: ContractHash,
pub project_name: String,
pub contract_name: String,
pub version: Version,
pub published_time: Timestamp,
// Cargo.toml + Cargo.lock + src folder?
// Full marketplace contract + tests ... |
use std::{
cell::UnsafeCell,
marker::PhantomData,
sync::atomic::{AtomicBool, AtomicUsize, Ordering},
};
use error::Error;
pub mod spsc;
///////////////////////////////////////////////////////////////////////////////
/// This crate implements a basic ring buffer.
/// This implementation is imple... |
use awsm_web::errors::Error;
use awsm_web::webgl::{
AttributeOptions, BufferData, BufferTarget, BufferUsage, DataType, Id, WebGlCommon,
WebGlRenderer,
};
static QUAD_GEOM_UNIT: [f32; 8] = [
0.0, 1.0, // top-left
0.0, 0.0, //bottom-left
1.0, 1.0, // top-right
1.0, 0.0, // bottom-right
];
static... |
use crate::substitute::substitute;
use super::{Effect, Type, TypeVisitorMut};
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum EffectExpr {
Effects(Vec<Effect>),
Add(Vec<EffectExpr>),
Sub {
minuend: Box<EffectExpr>,
subtrahend: Box<EffectExpr>,
},
Apply {
... |
#![allow(dead_code)]
use {Timer, EventEntry, now_micro};
use sys::Selector;
use {EventFlags, EventBuffer, TimerCb, AcceptCb, EventCb, EndCb};
use std::io;
use std::any::Any;
use psocket::{TcpSocket, SOCKET};
///回调的函数返回值, 如果返回OK和CONTINUE, 则默认处理
///如果返回OVER则主动结束循环, 比如READ则停止READ, 定时器如果是循环的则主动停止当前的定时器
pub enum RetValue ... |
//! Code to convert an [`Image`] to an SVG string
use angle::Angle;
use itertools::Itertools;
use simple_xml_builder::XMLElement;
use crate::{image::TextAnchor, utils::Rect2, V2Ext, V2};
use super::{
lowering::lower, ConcreteFillStyle, ConcreteStrokeStyle, ConcreteTextStyle, Image, LoweredElem,
LoweredImage,... |
use conrod_core::widget::envelope_editor::EnvelopePoint;
use conrod_core::widget::{Button, Canvas, Image};
use conrod_core::{Labelable, Positionable, Sizeable, Widget};
use std::io::{BufReader, Cursor};
use winit::event_loop::ControlFlow;
use crate::audio::{AudioContext, Sink, AUDIO_FILE_AWESOMENESS};
use crate::datab... |
use crate::memory::*;
use chrono::{DateTime, Utc};
use log::*;
use rstats::mutstats::minmax;
use rstats::Stats;
use std::fmt;
use std::time::SystemTime;
use sysinfo::{ProcessRefreshKind, ProcessorExt, RefreshKind, System, SystemExt};
pub struct Measurement {
pub timestamp: SystemTime,
pub mem_utilization: f64... |
use math::{self, Point3f, Ray3f, Real, Vector3f};
use num::Float;
use utils::consts;
#[derive(Copy, Clone, Debug)]
pub struct Aabb3 {
pmin: Point3f,
pmax: Point3f,
}
impl Aabb3 {
pub fn new(pmin: Point3f, pmax: Point3f) -> Aabb3 {
assert!(math::partial_le(&pmin, &pmax));
Aabb3 { pmin, pmax... |
//! This module implements the global `Symbol` object.
//!
//! The data type symbol is a primitive data type.
//! The `Symbol()` function returns a value of type symbol, has static properties that expose
//! several members of built-in objects, has static methods that expose the global symbol registry,
//! and resemble... |
//! A map data type which allows the same key to exist at multiple scope levels
use std::borrow::Borrow;
use std::collections::hash_map;
use std::collections::hash_map::{Entry, IterMut};
use std::hash::Hash;
use fnv::FnvMap;
/// A map struct which allows for the introduction of different scopes
/// Introducing a new ... |
use super::{ConfigBuilder, LegacyLimitPerEmail, LimitConfig};
use crate::crypto::SigningAlgorithm;
use serde::Deserialize;
use std::borrow::ToOwned;
use std::path::PathBuf;
use std::time::Duration;
/// Intermediate structure for deserializing environment variables
///
/// Environment variable `BROKER_FOO_BAR` deserial... |
// Copyright 2020 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
use crate::ast;
use crate::token::{Delim, Kind as T, PragmaStyle as Style, Token};
use crate::Span;
use super::list::parse_list_sep_with_term;
use super::{PResult, Parser};
impl<'a, I> Parser<'a, I>
where
I: Iterator<Item = Token>,
{
pub fn parse_pragma(&mut self) -> PResult<'a, ast::Pragma> {
let bas... |
use std::sync::atomic::{AtomicBool, Ordering};
use git_features::{parallel, progress::Progress};
use super::Error;
use crate::{
cache::delta::traverse,
index::{self, traverse::Outcome, util::index_entries_sorted_by_offset_ascending},
};
/// Traversal options for [`traverse_with_index()`][index::File::travers... |
use ethereum_gravity::utils::GasCost;
use ethers::prelude::*;
use ethers::types::Address as EthAddress;
use gravity_utils::ethereum::format_eth_address;
use gravity_utils::types::config::RelayerMode;
use gravity_utils::types::Erc20Token;
use reqwest::Client;
use serde_json::json;
use std::collections::HashMap;
use std:... |
#[macro_use]
extern crate bitflags;
extern crate bytes;
#[macro_use]
extern crate error_chain;
extern crate futures;
extern crate hyper;
#[macro_use]
extern crate log;
extern crate http;
extern crate tokio;
extern crate tokio_timer;
use std::time::*;
use bytes::*;
use futures::future::*;
use futures::stream::*;
use f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.