text stringlengths 7.05k 33.9k |
|---|
use futures::{Async, Future, Poll, Sink, Stream};
use futures::sync::mpsc::{SendError, Sender};
use hyper::{header, Body, Chunk, Error as HyperError, Headers, Method, StatusCode};
use hyper::server::{Request, Response};
use bytes::{BufMut, BytesMut};
use futures_cpupool::{CpuFuture, CpuPool};
use tokio_core::reactor::... |
//! The goal of this module is to be able to turn a mapping of dotted keys -> values into a
//! populated structure. The keys are of the form "a.b.c" and match up to nested structures
//! A { B { C } }.
//!
//! For example, with these structures:
//! struct A {
//! b: B,
//! }
//!
//! struct B {
//! ... |
use std::{cell::RefCell, rc::Rc};
use gloo::timers::callback::Timeout;
use js_sys::Array;
use wasm_bindgen::{prelude::*, JsCast, JsValue};
use web_sys::{BinaryType, MessageEvent, WebSocket};
use yew::prelude::*;
use super::{use_mut_latest, use_state_ptr_eq, use_unmount, UseStatePtrEqHandle};
pub use web_sys::CloseEv... |
use super::*;
use super::free_space_manager::VMFreeSpaceManager as FreeRangeManager;
use super::vm_area::*;
use super::vm_perms::VMPerms;
use super::vm_util::*;
use std::collections::BTreeSet;
use intrusive_collections::rbtree::{Link, RBTree};
use intrusive_collections::Bound;
use intrusive_collections::RBTreeLink;
u... |
//! The `accountant_skel` module is a microservice that exposes the high-level
//! Accountant API to the network. Its message encoding is currently
//! in flux. Clients should use AccountantStub to interact with it.
use accountant::Accountant;
use bincode::{deserialize, serialize};
use ecdsa;
use entry::Entry;
use eve... |
//! Successors of instruction_context_context::StackFrame, KeyedAccount and AccountInfo
use crate::{
account::{AccountSharedData, ReadableAccount, WritableAccount},
instruction::InstructionError,
lamports::LamportsError,
pubkey::Pubkey,
};
use std::{
cell::{RefCell, RefMut},
collections::HashSe... |
use std::collections::BTreeMap;
use std::fs::{remove_file, File};
use std::io;
use std::path::{Path, PathBuf};
use anyhow::{bail, ensure, Context};
use byteorder::{ByteOrder, LittleEndian};
use filecoin_hashers::Hasher;
use lazy_static::lazy_static;
use log::{info, trace};
use mapr::{Mmap, MmapOptions};
use rayon::pre... |
pub struct Histogram {
pub parent_id: String,
pub width: f64,
pub height: f64,
pub freq_data: Vec<usize>,
pub min_bin_val: f64,
pub bin_width: f64,
pub x_axis_label: String,
pub cumulative: bool,
}
impl Histogram {
// pub fn new<'a>(
// target_id: String,
// width: ... |
pub mod error;
pub mod request;
pub mod response;
use std::collections::BTreeMap;
use coset::cbor::value::Value;
use coset::iana::Algorithm;
use coset::CborSerializable;
use coset::CoseKeySet;
use coset::CoseSign1;
use coset::CoseSign1Builder;
use coset::HeaderBuilder;
use coset::Label;
pub use error::ManyError;
use ... |
use crate::Interaction;
use crate::Shape;
use geometry::bvh::{self, BBox};
use geometry::ray::Ray;
use math::float::barycentric_lerp;
use math::hcm::{Point3, Vec3};
use partition::partition;
use std::ops::Range;
enum IsoBvhNodeContent {
Children([Box<IsoBvhNode>; 2], usize),
Leaf(Range<usize>),
}
struct IsoBv... |
#![deny(warnings)]
#![allow(non_camel_case_types)]
#![allow(clippy::all)]
#![no_std]
mod generic;
pub use generic::*;
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - SPDIF Configuration Register"]
pub scr: SCR,
#[doc = "0x04 - CDText Control Register"]
pub srcd: SRCD,
... |
// lib/os_window/unix/xcb/ffi.rs
// Graphical Software Packager
// Copyright 2017 (c) <NAME>
// Copyright 2017 (c) <NAME>
// Licensed under the MIT LICENSE
use ami::void_pointer::*;
#[repr(C)]
struct XcbClientMessageEvent {
response_type: u8,
format: u8,
sequence: u16,
window: u32,
stype: u32,
data32: [u32; 5],... |
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Kani Contributors
// See GitHub history for details.
//! Markdown formatting for rustdoc.
//!
use rustc_hir::def_id::DefId;
use rustc_hir::HirId;
use rustc_middle::ty::TyCtxt;
use rustc_span::edition::Edition;
use rustc_span::Span;
use std::b... |
use crate::serde::{serializable_bitflags, PacketBody, Result, SliceCursor};
serializable_bitflags! {
pub struct DayInfo: u8 {
const DAY_TIME = 0x01;
const BLOOD_MOON = 0x02;
const ECLIPSE = 0x04;
}
}
serializable_bitflags! {
pub struct EventInfo: u64 {
const SHADOW_ORB_SMAS... |
//! An async dhcp server implementation for a given gateway address. This is a very
//! rudimentary implementation (no timeouts or lease refreshes), with a fixed /24 subnet.
//! Client request IP addresses are considered.
pub mod options;
pub mod packet;
use std::net::{IpAddr, Ipv4Addr, SocketAddr, SocketAddrV4};
use... |
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(dead_code)]
use crate::canister_descriptor_table::{CanisterDescriptorTable, WasmObjectGeneration};
use crate::controller_service;
use crate::process_watcher::ProcessWatcher;
use crate::session_nonce::{session_to_string, CallContextNonce};
use crate::{QueueC... |
//! Types for square grids.
use graph::{Graph, Node};
use visible_graph::{GraphPt, IndexedSegment, VisibleGraph};
/// A grid of 1✕1 squares, of a given number of rows and columns. A cell's
/// neighbors are those above, below, and to the left and right of it; diagonal
/// connections are not neigbors.
///
/// In grap... |
use arc_swap::ArcSwap;
use std::collections::HashMap;
use std::ops::Deref;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::thread;
use async_trait::async_trait;
use indicatif::ProgressBar;
use itertools::Itertools;
use parking_lot::RwLock;
use segment::segment_constructor::simple_segment_constructor::buil... |
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#![deny(missing_docs)]
use {
crate::net::{set_nonblock, EventedFd},
bytes::{Buf, BufMut},
futures::{
future::Future,
io::{Asyn... |
use crate::{
ffi::{
c4Socket_getNativeHandle, c4Socket_setNativeHandle, c4error_make, c4socket_closeRequested,
c4socket_closed, c4socket_completedWrite, c4socket_gotHTTPResponse, c4socket_opened,
c4socket_received, c4socket_registerFactory, kC4ReplicatorOptionCookies,
kC4ReplicatorOp... |
use bit_set::BitSet;
use std::cmp::max;
use super::super::matrix::Matrix;
use super::levelset::LevelSet;
/// Holds for some level the id,
/// the jump target levels for all nodes, and
/// a set of matrices together with the target levels
struct Level {
id: usize,
jl: Vec<usize>,
reach: Vec<(usize, Matrix)... |
//! A basic API client for interacting with the Kubernetes API
//!
//! The [`Client`] uses standard kube error handling.
//!
//! This client can be used on its own or in conjuction with the [`Api`][crate::api::Api]
//! type for more structured interaction with the kubernetes API.
//!
//! The [`Client`] can also be used... |
use crate::actor::Actor;
use crate::errors::{Error, Result};
use crate::sandbox::Sandbox;
use crate::token::{Mint, TokenAccount};
use bytemuck;
use serum_dex::{
instruction::SelfTradeBehavior,
matching::{OrderType, Side},
state as serum_state,
};
use solana_sdk::pubkey::Pubkey;
use std::num::NonZeroU64;
use... |
//
// Copyright 2021 <NAME>
// This file is part of the Ida compiler.
// Ida is licensed under the BSD-3 license. See the COPYING file for more information.
//
// This represents x86-64 instructions
#[derive(Clone, PartialEq)]
#[allow(dead_code)]
pub enum X86Type {
Extern,
Global,
Type,
Label,
No... |
use crate::events::{process_message_event, MessagingEvents};
use crate::registry::PeerOption;
use crate::{agent_name, Config, GroupRegistry, PeerRegistry};
use anyhow::anyhow;
use libp2p::multiaddr::Protocol;
use libp2p::{
self,
autonat::{Behaviour as Autonat, Event as AutonatEvent},
dcutr::behaviour::{Beha... |
extern crate byteorder;
use std::io;
use std::io::{Read, Write};
use std::net::{TcpListener, TcpStream};
use super::bridge::{Bridge, BridgeError};
use super::riscv::{RiscvCpu, RiscvCpuError};
use super::Config;
use crate::gdb::byteorder::ByteOrder;
use byteorder::{BigEndian, NativeEndian};
pub struct Gdb... |
/*!
This crate provides a simplistic interface to subscribe to operating system
signals through a channel API. Use is extremely simple:
```no_run
use chan_signal::Signal;
let signal = chan_signal::notify(&[Signal::INT, Signal::TERM]);
// Blocks until this process is sent an INT or TERM signal.
// Since the channel i... |
use std::{
cmp::Ordering,
collections::HashSet,
fmt::{Display, Formatter, Write},
};
use itertools::Itertools;
use crate::{AnnotBlock, Bell, PlaceNot, Stage};
// Imports used solely for doc comments
#[allow(unused_imports)]
use crate::Method;
/// The full class of a [`Method`], including flags for littl... |
use crate::cpu::{Breakpoint, CPU};
use crate::dialog_handler::{DialogHandler, FileDialogResult, FileDialogType};
use crate::display::WindowDisplay;
use crate::fps_counter::FpsCounter;
use crate::gui::GUI;
use crate::gui::{Color, Quirk};
use crate::sound::AudioPlayer;
use glium::glutin::{
event::{ElementState, Event... |
// Copied from: https://github.com/ava-labs/timestampvm/blob/main/timestampvm/block.go
use crate::error::LandslideError;
use crate::id::Id;
use crate::proto::rpcdb::database_client::*;
use crate::proto::rpcdb::*;
use crate::proto::DatabaseError;
use anyhow::{anyhow, Context, Result};
use byteorder::{BigEndian, ReadByt... |
#[derive(Clone, Copy)]
pub enum Config {
/// GDO2 output pin configuration
IOCFG2 = 0x00,
/// GDO1 output pin configuration
IOCFG1 = 0x01,
/// GDO0 output pin configuration
IOCFG0 = 0x02,
/// RX FIFO and TX FIFO thresholds
FIFOTHR = 0x03,
/// Sync word, high byte
SYNC1 = 0x04,
... |
use hir::{
BinOp, Block, Expression, ExpressionKind, Function, Identifier, Item, ItemKind, Path, Statement, StatementKind,
Struct, StructExpr, Type, TypeKind, UnaryOp,
};
use std::{
collections::HashMap,
fmt::{self, Debug, Formatter},
};
pub type Result<T> = std::result::Result<T, TypeError>;
pub type ... |
//! Lua API loaders exposing Heavy and other Rust to Lua.
//!
//! You probably want to load the `hv` library into your Heavy project by default. It's easy:
//!
//! ```
//! #mod hv { pub use hv_script as script };
//! #use hv_lua::prelude::*;
//! #use anyhow::Result;
//! #fn thing(lua: &Lua) -> Result<()> {
//! hv::scri... |
use std;
use vec3;
use quat;
#[derive(Copy, Clone)]
pub struct mat4 {
pub source: [[f32; 4]; 4]
}
impl std::ops::Mul for mat4{
type Output = mat4;
fn mul(self, other: mat4) -> mat4 {
return mat4::new(
self[11]*other[11]+
self[12]*other[21]+
self[13... |
//! This module implements attaching (ie associating) a project in GitLab to a local git repo.
//!
//! It does this by referring to the local git remote (which must be set) and looking it up on the
//! GitLab server. If found, it will update and persist local repo-specific config to contain the
//! GitLab project's ID ... |
//! # Overview
//!
//! A library that lets you draw various simple 2d geometry primitives and sprites fast using
//! vertex buffer objects with a safe api. Uses the builder pattern for a convinient api.
//! The main design goal is to be able to draw thousands of shapes efficiently.
//! Uses glutin and opengl es 3.0.
//... |
use super::layout::*;
use super::widget_data::*;
use super::super::gtk_action::*;
use flo_ui::*;
use gtk;
use gtk::prelude::*;
use gdk::prelude::*;
use std::rc::*;
use std::collections::HashSet;
///
/// Indicates the floating position of a widget (used when laying it out again)
///
pub struct FloatingPosition {
... |
use proc_macro2::TokenStream;
use quote::quote;
use std::collections::HashMap;
use syn::{
self, parse_quote, punctuated::Punctuated, AngleBracketedGenericArguments, AttributeArgs,
FnArg, Ident, ImplItem, ItemImpl, Lit::Str, Meta, Meta::NameValue, MetaList, MetaNameValue,
NestedMeta, PatType, PathArguments, ... |
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
//! livi is a library for hosting LV2 plugins in Rust.
//! ```
//! let world = livi::World::new();
//! const SAMPLE_RATE: f64 = 44100.0;
//! let features = world.build_features(livi::FeaturesBuilder::default());
//! let worker_manager = features.worker_manager().clone();
//! let plugin = world
//! // This is the UR... |
use firecore_text::{MessagePage, MessageState};
use hashbrown::HashMap;
use rand::{prelude::IteratorRandom, Rng, SeedableRng};
use serde::{Deserialize, Serialize};
use pokedex::moves::MoveId;
use crate::{
actions::WorldActions,
character::{
action::ActionQueue,
message::process_str_player,
... |
use crate::{
util::{
enforce_one_hot, fr_to_fq, to_canonical_bytes, BlsFr, BlsFrV, GetAffineCoords, Jubjub,
JubjubVar, PoseidonCtx, PoseidonCtxVar,
},
PrivateId, PrivateIdVar,
};
use core::iter;
use ark_ec::ProjectiveCurve;
use ark_ff::{Field, PrimeField, UniformRand};
use ark_r1cs_std::{
... |
use {
anyhow::Context,
std::{collections::HashMap, str::FromStr},
};
#[cfg(feature = "sources")]
use std::{
env, fs,
io::{self, prelude::*},
path::Path,
};
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Frontend can only be `both`, `api` or `user`, found '{value}'")]
InvalidF... |
use crate::card::Rank::*;
use crate::card::{Card, Cards, Players};
use itertools::Itertools;
use std::cmp::{Ordering, Reverse};
use HandType::*;
pub fn hands(players: &Players, board: &Cards) -> Vec<Hand> {
players
.iter()
.map(|hole| hand([hole, board].concat()))
.collect_vec()
}
pub fn h... |
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
extern crate glfw;
use self::glfw::{Context, Key, Action};
extern crate gl;
use self::gl::types::*;
use std::sync::mpsc::Receiver;
use std::ptr;
use std::mem;
use std::os::raw::c_void;
use std::path::Path;
use std::ffi::CStr;
use shader::Shader;
use image... |
use std::cell::RefCell;
use std::collections::hash_map::{Entry, HashMap};
use std::env;
use std::path::PathBuf;
use std::str::{self, FromStr};
use crate::core::compiler::CompileKind;
use crate::core::TargetKind;
use crate::util::config::StringList;
use crate::util::{CargoResult, CargoResultExt, Config, ProcessBuilder,... |
use std::any::Any;
use std::collections::{HashMap, VecDeque};
use std::fmt;
use std::mem::{self, MaybeUninit};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Weak;
use std::time::Duration;
use atomic::Atomic;
use super::epoll_waiter::EpollWaiter;
use super::host_file_epoller::HostFileEpoller;
use super... |
//! H.263 decoder core
use crate::decoder::cpu::{gather, idct_channel, inverse_rle, mv_decode, predict_candidate};
use crate::decoder::picture::DecodedPicture;
use crate::decoder::types::DecoderOption;
use crate::error::{Error, Result};
use crate::parser::{decode_block, decode_gob, decode_macroblock, decode_picture, H... |
use crate::cmd::stats::Stats;
use crate::config::{Config, Delimiter};
use crate::select::SelectColumns;
use crate::util;
use crate::CliError;
use crate::CliResult;
use ahash::AHashMap;
use csv::ByteRecord;
use grex::RegExpBuilder;
use log::{debug, error, info, warn};
use serde::Deserialize;
use serde_json::{json, value... |
use std::collections::{BTreeMap, HashMap};
use std::any::{TypeId, Any};
use std::ffi::{CString, CStr};
use std::fmt;
use std::ops::Deref;
use dbus::strings::{Path as PathName, Interface as IfaceName, Member as MemberName, Signature};
use dbus::{Message, MessageType, channel};
use dbus::message::MatchRule;
use super::in... |
use std::{
collections::HashMap,
future::Future,
i16,
num::Wrapping,
pin::Pin,
sync::Arc,
task::{Poll, Waker},
time::Duration,
u32,
};
use byteorder::{ByteOrder, LittleEndian};
use futures::{
channel::{mpsc, oneshot},
future::{self, Fuse, FusedFuture},
lock::{Mutex, Mute... |
//! SystemVerilog backend for the Calyx compiler.
//!
//! Transforms an [`ir::Context`](crate::ir::Context) into a formatted string that represents a
//! valid SystemVerilog program.
use crate::backend::traits::Backend;
use calyx::{
errors::{CalyxResult, Error},
ir,
utils::OutputFile,
};
use ir::{Control, ... |
use super::entities::route;
use super::{
access, commands, connectors, entities, errors, providers, replies, schema, traits::ObjectType,
};
use hyper::Body;
use bytes::Buf;
use std::collections::HashMap;
use std::sync::Arc;
use std::sync::RwLock;
use uuid::Uuid;
pub const ROUTER_SERVICE_NAME: &str = "router";
pub ... |
use std::cell::RefCell;
use std::collections::HashMap;
use std::error::Error;
use std::io::Result as IOResult;
use std::process;
use std::rc::Rc;
use std::time::{Duration, Instant};
use sctk::reexports::client::protocol::wl_compositor::WlCompositor;
use sctk::reexports::client::protocol::wl_shm::WlShm;
use sctk::reexp... |
use std::cell::RefCell;
use std::fmt;
use std::ffi::CString;
use std::ptr;
use failure::{Context, Backtrace, Fail};
use libc::c_char;
use utils::error;
use utils::cstring::CStringUtils;
pub mod prelude {
pub use super::{err_msg, VcxError, VcxErrorExt, VcxErrorKind, VcxResult, VcxResultExt, get_current_error_c_js... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! responsible for handling codegening places.
//!
//! a place is an expression of specifying a location in memory, like a left value. check the cases
//! in [codegen_place] below.
use super::cbmc::goto... |
#![cfg(test)]
#![deny(rust_2018_idioms, warnings)]
#![deny(clippy::all, clippy::pedantic)]
#![allow(
clippy::default_trait_access,
clippy::indexing_slicing,
clippy::let_and_return,
clippy::let_underscore_drop,
clippy::let_unit_value,
clippy::must_use_candidate,
clippy::too_many_lines,
clippy::unseparated_liter... |
// Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0
use crate::{
bootstrapper::Bootstrapper,
continuous_syncer::ContinuousSyncer,
driver_client::{ClientNotificationListener, DriverNotification},
error::Error,
notification_handlers::{
CommitNotification, CommitNotificationListener,... |
// 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 fuchsia_zircon::{self as zx, AsHandleRef, HandleBased};
use lazy_static::lazy_static;
use parking_lot::{Mutex, RwLock};
use process_builder::elf_load;
... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
// <Black magic>
// Increase recursion limit to allow for use of select! macro.
#![recursion_limit = "1024"]
// </Black magic>
//! Protocol for discovering validator + validator full node network addresses
//! and identity keys via a ... |
#[cfg(feature = "metrics")]
use crate::engine::STATSD;
use crate::engine_traits::EngineOperations;
use crate::engine_traits::ValidatedBlockStat;
use crate::engine_traits::ValidatedBlockStatNode;
use crate::shard_state::ShardStateStuff;
use crate::validator::UInt256;
use adnl::common::KeyOption;
use num_bigint::BigUint;... |
// Bitcoin Dev Kit
// Written in 2021 by <NAME> <<EMAIL>>
//
// Copyright (c) 2020-2021 Bitcoin Dev Kit Developers
//
// This file is 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>... |
//! SQLite description.
use super::*;
use quaint::{ast::Value, prelude::Queryable};
use std::{borrow::Cow, collections::HashMap, convert::TryInto, sync::Arc};
use tracing::debug;
pub struct SqlSchemaDescriber {
conn: Arc<dyn Queryable + Send + Sync + 'static>,
}
#[async_trait::async_trait]
impl super::SqlSchemaDe... |
use crate::errors::*;
use crate::{Confirm, ConfirmPayload, Return};
use amq_protocol::frame::AMQPFrame;
use amq_protocol::protocol::basic::AMQPMethod as AmqpBasic;
use amq_protocol::protocol::basic::CancelOk;
use amq_protocol::protocol::channel::AMQPMethod as AmqpChannel;
use amq_protocol::protocol::channel::CloseOk as... |
// Copyright © 2019 Intel Corporation
//
// 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 agree... |
// 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::discovery::{TargetFinder, TargetFinderConfig},
crate::events::{DaemonEvent, TargetInfo, TryIntoTargetInfo, WireTrafficType},
crate... |
// Don't show the console when starting the app on Windows
#![windows_subsystem = "windows"]
use std::{collections::HashSet, time::Duration, vec};
use barony_mod_manager::{
data::{BaronyMod, DownloadStatus},
downloader_api::{check_status, download_mod, queue_download},
filesystem::{self, barony_dir_valid}... |
//! Reporting
//!
//! This goes more into the direction of instrumentation. Unfortunately
//! `tokio` uses the word `Instrumentation` already for their tracing
//! implementation.
use std::{fmt, time::Duration};
use crate::{
errors::{CondowError, IoError},
InclusiveRange,
};
pub use simple_reporter::*;
pub t... |
use crate::api::AlphaBlending;
use crate::gl;
use crate::gl::types::*;
use crate::image::Image;
use crate::renderer::{DrawCallHandle, Renderer, Shaders, TextureWrapping};
use crate::text::types::*;
use crate::types::*;
use fnv::FnvHashMap;
use std::cell::Cell;
use std::rc::{Rc, Weak};
// How far the glyphs are from e... |
/*
Portions Copyright 2019-2021 ZomboDB, LLC.
Portions Copyright 2021-2022 Technology Concepts & Design, Inc. <<EMAIL>>
All rights reserved.
Use of this source code is governed by the MIT license that can be found in the LICENSE file.
*/
use crate::command::stop::stop_postgres;
use crate::CommandExecute;
use eyre::{... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - RTC Time Seconds Register"]
pub tsr: TSR,
#[doc = "0x04 - RTC Time Prescaler Register"]
pub tpr: TPR,
#[doc = "0x08 - RTC Time Alarm Register"]
pub tar: TAR,
#[doc = "0x0c - RTC Time Compensation Register"]
pub tcr: TCR,
... |
// This file is part of Substrate.
// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// ht... |
use super::ProcessId;
use super::*;
use crate::filesystem::StdIO;
use crate::memory::*;
use crate::memory::gdt::get_user_selector;
use crate::utils::{Registers, RegistersValue, Resource};
use alloc::collections::btree_map::BTreeMap;
use alloc::string::String;
use alloc::vec::Vec;
use core::intrinsics::copy_nonoverlappi... |
mod chunky;
use std::{fmt, mem};
pub enum Maybe<T, V> {
Known(T),
Unknown(V),
}
use Maybe::Known;
use Maybe::Unknown;
impl<T: fmt::Display, V: fmt::Display> fmt::Display for Maybe<T, V> {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match self {
&Known(ref val) =... |
/// Methods for writing DVI files
use std::io;
use super::file::{DVICommand, DVIFile};
impl DVIFile {
pub fn write_to<T: io::Write>(&self, output: T) -> io::Result<()> {
let mut writer = DVIFileWriter::new(output);
for command in &self.commands {
writer.write(command)?;
}
... |
use ash::vk;
use memoffset::offset_of;
use rusttype::{Rect, VMetrics, HMetrics};
use std::ops::Range;
use std::collections::HashMap;
use std::iter::Iterator;
use crate::ci::buffer::BufferCI;
use crate::ci::memory::MemoryAI;
use crate::ci::image::{ImageCI, ImageViewCI, SamplerCI, ImageBarrierCI};
use crate::ci::vma:... |
use std::io;
use std::io::{Read, Write};
use std::sync::Arc;
use crate::constants::{
CapabilityFlag, PacketType, ServerError, StateError, EOF_PACKET, ERR_PACKET, MAX_PACKET_SIZE,
OK_PACKET, SERVER_MORE_RESULTS_EXISTS,
};
use crate::errors::{ProtoError, ProtoResult};
use crate::sql_type::{type_to_mysql, Field, ... |
use crate::ast::{Function, Ident, Idents, Mode, ParamX, Params, VirErr};
use crate::context::Ctx;
use crate::def::{
prefix_ensures, prefix_fuel_id, prefix_fuel_nat, prefix_recursive, prefix_requires,
suffix_global_id, suffix_local_id, suffix_typ_param_id, SnapPos, Spanned, FUEL_BOOL,
FUEL_BOOL_DEFAULT, FUEL... |
use std::collections::{HashMap, HashSet};
use std::fmt::Debug;
use std::io::Cursor;
use std::iter::FromIterator;
use std::sync::Arc;
use std::time::Duration;
use std::time::SystemTime;
use std::time::UNIX_EPOCH;
use async_trait::async_trait;
use aws_lambda_events::event::s3::{
S3Bucket, S3Entity, S3Event, S3EventR... |
//! Partial implementation of the IEEE 802.15.4 Frame
//!
//! The main type in this module is [Frame], a type that represents an IEEE
//! 802.15.4 MAC frame. The other types in this module are supporting types
//! that are either part of [Frame] or are required to support its API.
//!
//! [Frame]: struct.Frame.html
//... |
use crate::{
batch_field_cast, squeeze_field_elements_with_sizes_default_impl, Absorb, CryptographicSponge,
DuplexSpongeMode, FieldBasedCryptographicSponge, FieldElementSize, SpongeExt,
};
use ark_ff::{BigInteger, FpParameters, PrimeField};
use ark_std::any::TypeId;
use ark_std::vec;
use ark_std::vec::Vec;
///... |
#![recursion_limit = "128"]
use quote::quote;
use std::{
fs,
io::{BufRead, BufReader, Write},
path::*,
};
fn main() {
build_translated_pairs();
build_company();
build_primer();
build_function_docs();
build_colony();
}
fn build_translated_pairs() {
let translations = std::env::curr... |
/*
Day 22: Reactor Reboot
The reactor is a large 3D grid. Each point can be on or off.
The initialization process specifies a cuboid of points to turn on/off.
Each step is executed in order. For example:
on x=10..12,y=10..12,z=10..12
on x=11..13,y=11..13,z=11..13
off x=9..11,y=9..11,z=9..11
on x=10..10... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - MPC Control register"]
pub ctrl: CTRL,
_reserved1: [u8; 12usize],
#[doc = "0x10 - Maximum value of block based index register"]
pub blk_max: BLK_MAX,
#[doc = "0x14 - Block Configuration"]
pub blk_cfg: BLK_CFG,
... |
use std::collections::vec_deque::VecDeque;
use std::default::Default;
use std::mem;
use std::sync::{Arc, Weak};
use std::time::Duration;
use parking_lot::{RwLock, RwLockUpgradableReadGuard};
use block_albatross::Block as AlbatrossBlock;
use block_albatross::BlockError as AlbatrossBlockError;
use block_base::{Block, B... |
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Substrate 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 Software Foundation, either version 3 of the License, or
// (at your option) any... |
use super::particle::{Particles};
use super::utils::{Grid};
use std::slice::Iter;
use nalgebra::base::dimension::{U6, U7};
use nalgebra as na;
#[derive(Debug)]
pub enum Component {
U,
V,
W
}
impl Component {
pub fn iterator() -> Iter<'static, Component> {
static COMPONENT: [Component; 3] = [C... |
use futures::future;
use futures::prelude::*;
use graph::ethabi::Token;
use lazy_static::lazy_static;
use std::collections::HashSet;
use std::sync::Arc;
use graph::components::ethereum::{EthereumAdapter as EthereumAdapterTrait, *};
use graph::prelude::*;
use graph::web3;
use graph::web3::api::Web3;
use graph::web3::tr... |
//pub mod generate;
pub(crate) mod d3d11;
pub(crate) mod draw_programs;
pub(crate) mod gameworks;
pub(crate) mod geometry;
pub(crate) mod scenegraph;
pub(crate) mod settings;
use crate::import;
use crate::input::first_person::FPSController;
use crate::input::input_handler::InputHandler;
use crate::input::Camera;
use c... |
//! Sciter.Lite interface.
#![allow(non_camel_case_types, non_snake_case)]
#![allow(dead_code)]
use super::{
scbehavior::{KEYBOARD_STATES, KEY_EVENTS, MOUSE_BUTTONS, MOUSE_EVENTS},
scdef::{ELEMENT_BITMAP_RECEIVER, GFX_LAYER},
scdom::HELEMENT,
sctypes::*,
};
#[repr(C)]
#[derive(Copy, Clone, Debug, Par... |
#![cfg_attr(feature = "dev", feature(plugin))]
#![cfg_attr(feature = "dev", plugin(clippy))]
extern crate bit_vec;
extern crate byteorder;
extern crate crc;
extern crate image;
extern crate itertools;
extern crate miniz_oxide;
extern crate num_cpus;
extern crate rayon;
extern crate zopfli;
use image::{DynamicImage, G... |
//! Teensy 4 USB, taken from the original Teensy 4 C libraries
//!
//! The USB stack provides a [`log`] implementation for logging over USB.
//! It also provides a simpler [`Reader`] and [`Writer`] for performing
//! I/O over the CDC interface. Use the macros of the
//! [`log`] crate to write data over USB. Or, acquire... |
// This component uses Sciter Engine,
// copyright Terra Informatica Software, Inc.
// (http://terrainformatica.com/).
/*!
# Rust bindings library for Sciter engine.
[Sciter](http://sciter.com) is an embeddable [multiplatform](https://sciter.com/sciter/crossplatform/) HTML/CSS/script engine
with GPU accelerated rende... |
use std::default::Default;
use std::io;
use std::thread::{self, JoinHandle};
use std::time::SystemTime;
use mio;
use core::pin::Pin;
use futures::channel::{mpsc, oneshot};
use futures::executor;
use futures::stream::Stream;
use futures::task::Context;
use futures::{Future, Poll};
use bytes::BytesMut;
use eventfd::Ev... |
// use std;
use std::cell::RefCell;
use std::io;
use std::io::{BufWriter, Write};
use std::iter;
use std::fmt;
use super::smallstring::SmallString;
use ropey::RopeSlice;
use termion;
use termion::color;
use termion::color::Rgb;
use termion::raw::{IntoRawMode, RawTerminal};
use termion::screen::AlternateScreen;
use uni... |
// Copyright 2020 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or di... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
mod error;
pub use error::Error;
use anyhow::Result;
use diem_crypto::{
ed25519::Ed25519Signature,
hash::{
EventAccumulatorHasher, TransactionAccumulatorHasher, ACCUMULATOR_PLACEHOLDER_HASH,
... |
pub mod enums;
pub mod namespace_clients;
pub mod root;
pub mod url;
use crate::api_generator::{ApiEndpoint, HttpMethod, Type, TypeKind};
use inflector::Inflector;
use quote::{ToTokens, Tokens};
use std::collections::BTreeMap;
use std::str;
use syn::{Field, FieldValue, FnArg, ImplItem};
/// AST for a literal
fn lit<I... |
use symbols_table::SymbolLookup;
use result::*;
use types::*;
use types::into_object::*;
use lisp;
use std::boxed::Box;
use lisp::allocate::AllocObject;
use lisp::stack_storage::Stack;
use types::conversions::*;
// The macros `special_forms` and `builtin_functions` are the main
// part of this module. See `make_builti... |
// Copyright 2018 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::{
asset::{AssetCollectionBuilder, AssetLoader, AssetLoaderImpl},
debug,
family::{FamilyOrAliasBuilder, FontFamilyB... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.