text stringlengths 7.05k 33.9k |
|---|
use std::borrow::Borrow;
use nom::bytes::complete::tag;
use nom::{
branch::alt,
bytes::complete::take,
bytes::complete::take_till,
error::FromExternalError,
error::{Error, ErrorKind},
multi::many0,
multi::many1,
number::complete::*,
Err, IResult,
};
mod types;
pub use types::*;
t... |
use keyed_priority_queue::{Entry, KeyedPriorityQueue};
use regex::Regex;
use std::cmp::Reverse;
use std::collections::HashMap;
use std::collections::HashSet;
use std::fs;
use std::fs::File;
use std::hash::Hash;
use std::io::{self, BufRead, Error};
use std::path::Path;
/*
#############
#01x3x5x7x90# Row 0: Columns 0..1... |
// Copyright 2018 The proptest developers
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except a... |
use anyhow::bail;
use anyhow::Context;
use anyhow::Result;
use async_trait::async_trait;
use bdk::bitcoin::util::bip32::ExtendedPrivKey;
use bdk::bitcoin::util::psbt::PartiallySignedTransaction;
use bdk::bitcoin::Address;
use bdk::bitcoin::Amount;
use bdk::bitcoin::OutPoint;
use bdk::bitcoin::PublicKey;
use bdk::bitcoi... |
//! A demonstration of an offchain worker that sends onchain callbacks
#![cfg_attr(not(feature = "std"), no_std)]
#[macro_use]
extern crate alloc;
#[cfg(test)]
mod tests;
#[cfg(test)]
pub mod mock;
#[macro_use]
mod utils;
use alloc::collections::btree_set::BTreeSet;
use core::{line, stringify};
use frame_support:... |
use crate::ast;
use crate::ast::Spanned;
use crate::compile::ir;
use crate::compile::{IrError, IrValue};
use crate::parse::Resolve;
use crate::query::{BuiltInMacro, BuiltInTemplate, Query};
use crate::runtime::{Bytes, Shared};
/// A c that compiles AST into Rune IR.
pub(crate) struct IrCompiler<'a> {
pub(crate) q:... |
// Copyright 2021 - <NAME> <<EMAIL>>
// SPDX-License-Identifier: Apache-2.0
use core::borrow::Borrow;
use core::iter::Sum;
use core::ops::{Add, Mul};
use std::convert::TryFrom;
use std::convert::TryInto;
use bls12_381::{G2Projective, Scalar};
use group::Curve;
use serde_derive::{Deserialize, Serialize};
use crate::e... |
//! Interface to the Real-time clock (RTC) peripheral
//!
//! See STM32L0x2 reference manual, chapter 26.
use void::Void;
use crate::{
hal::timer::{
self,
Cancel as _,
},
pac,
pwr::PWR,
rcc::Rcc,
time::U32Ext,
};
/// Entry point to the RTC API
pub struct RTC {
rtc: ... |
//! A helper class for dealing with static archives
use std::env;
use std::ffi::{CStr, CString, OsString};
use std::io;
use std::mem;
use std::path::{Path, PathBuf};
use std::ptr;
use std::str;
use crate::llvm::archive_ro::{ArchiveRO, Child};
use crate::llvm::{self, ArchiveKind, LLVMMachineType, LLVMRustCOFFShortExpo... |
pub mod settings;
pub mod orbs;
use std::{fmt, fs, io, path::Path, path::PathBuf};
use std::io::Write;
use serde::{Serialize, Deserialize};
use crate::uberstate::{UberState, UberIdentifier};
pub const DEFAULTSPAWN: &str = "MarshSpawn.Main";
pub const MOKI_SPAWNS: &[&str] = &[
"MarshSpawn.Main",
"HowlsDen.Te... |
//! # OpenTelemetry SpanContext interface
//!
//! A `SpanContext` represents the portion of a `Span` which must be serialized and propagated along
//! side of a distributed context. `SpanContext`s are immutable.
//!
//! The OpenTelemetry `SpanContext` representation conforms to the [w3c TraceContext specification].
//!... |
//! Filesystem-backed secret key store
#![allow(clippy::unwrap_used)]
use crate::secret_key_store::{Scope, SecretKeyStore, SecretKeyStoreError};
use crate::threshold::ni_dkg::{NIDKG_FS_SCOPE, NIDKG_THRESHOLD_SCOPE};
use crate::types::CspSecretKey;
use ic_crypto_internal_threshold_sig_bls12381::ni_dkg::groth20_bls12_381... |
use crate::alloc::{instance_heap_offset, AddrLocation, Alloc, AllocStrategy, Limits, Slot};
use crate::embed_ctx::CtxMap;
use crate::error::Error;
use crate::instance::{new_instance_handle, Instance, InstanceHandle, InstanceInternal};
use crate::module::Module;
use crate::region::{Region, RegionCreate, RegionInternal};... |
use std::collections::{BTreeSet, VecDeque};
use std::net::{Ipv4Addr, SocketAddrV4};
use std::sync::Arc;
use std::thread;
use std::time::{Duration, Instant};
use crate::dag_scheduler::{CompletionEvent, FetchFailedVals};
use crate::dependency::{Dependency, ShuffleDependencyTrait};
use crate::env;
use crate::error::Resul... |
//! Simple building-block data that can be read in one go.
//! All primitives have a known, fixed size.
//! Also, primitives advance the file pointer when read.
use crate::prelude::*;
pub(crate) trait SplitChecked: Sized {
fn split_checked(&mut self, at: usize) -> Option<Self>;
}
impl<'a> SplitChecked for &'a [u8... |
//! The convert_osm crate produces a RawMap from OSM and other data. Storing this intermediate
//! structure is useful to iterate quickly on parts of the map importing pipeline without having to
//! constantly read .osm files, and to visualize the intermediate state with map_editor.
use std::collections::BTreeMap;
use... |
// Copyright 2020-2021, The Tremor Team
//
// 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 agr... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Pin Control Register 0"]
pub pcr0: PCR0,
#[doc = "0x04 - Pin Control Register 1"]
pub pcr1: PCR1,
_reserved2: [u8; 20usize],
#[doc = "0x1c - Pin Control Register 7"]
pub pcr7: PCR7,
#[doc = "0x20 - Pin Control Register 8"]
... |
use crate::Vec3;
use crate::Vec4;
use core::ops::Index;
/// Mat4 is considered a column-major matrix, constructed using 4 Vec4s
#[derive(Debug, Clone, PartialEq)]
pub struct Mat4(pub [Vec4; 4]);
impl Index<usize> for Mat4 {
type Output = Vec4;
fn index(&self, index: usize) -> &Vec4 {
match index {
... |
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use crate::ansi::strip_ansi_codes;
use os_pipe::pipe;
use std::env;
use std::io::Read;
use std::io::Write;
use std::path::PathBuf;
use std::process::Command;
use std::process::Stdio;
macro_rules! itest(
($name:ident {$( $key:ident: $value:exp... |
use core::sync::atomic::{AtomicBool, AtomicPtr, AtomicU64, Ordering};
use alloc::{collections::BTreeMap, sync::Arc, vec::Vec};
use fixedbitset::FixedBitSet;
use crate::{
clock::Nanoseconds,
interrupt,
once::Once,
processor::{current_processor, get_processor, Processor},
spinlock::Spinlock,
thr... |
// Copyright (c) 2017-present, PingCAP, Inc. Licensed under Apache-2.0.
use std::collections::VecDeque;
use std::fs::{self, File};
use std::path::PathBuf;
use std::sync::Arc;
use crossbeam::utils::CachePadded;
use fail::fail_point;
use log::{error, warn};
use parking_lot::{Mutex, MutexGuard, RwLock};
use crate::conf... |
use std::collections::HashMap;
use std::fs::File;
use std::io;
use crate::server::ServerKind;
use clap::ArgMatches;
use wishbone_bridge::{
Bridge, EthernetBridge, EthernetBridgeProtocol, PCIeBridge, SpiBridge, UartBridge, UsbBridge,
};
#[derive(Debug)]
pub enum ConfigError {
/// Couldn't parse string as numbe... |
// Copyright (c) Facebook, Inc. and its affiliates.
use anyhow::{anyhow, Result};
use chrono::prelude::*;
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
use std::ops;
use std::time::UNIX_EPOCH;
use util::*;
use super::RunnerState;
use rd_hashd_intf;
const REPORT_DOC: &str = "\
//
// rd-agent sum... |
use rpn;
use crate::rpn::srlvariant::*;
use crate::rpn::*;
use crate::rpn::eval::*;
use std::time::Instant;
struct RpnTest {
ctx:u32,
expr:&'static str,
prec:f64,
expected:EVar,
}
// 20211227 - perf tests
// 1_000 times 86 test expression in 2.27 seconds, that is to say 26.3 µs/expression
// rig: AMD Ryzen 7 3700X... |
#[macro_use]
extern crate static_assertions;
pub mod board;
use board::{Board, LogicResult};
use cust::function::{BlockSize, GridSize};
use cust::prelude::*;
use itertools::Itertools;
use rand::seq::SliceRandom;
use rand::thread_rng;
use std::error::Error;
use std::fs::{File, OpenOptions};
use std::io::{prelude::*, B... |
mod converters;
mod winit_config;
mod winit_windows;
use std::{
path::PathBuf,
sync::{mpsc, Mutex},
thread,
};
use bevy_input::{
keyboard::KeyboardInput,
mouse::{MouseButtonInput, MouseMotion, MouseScrollUnit, MouseWheel},
touch::TouchInput,
};
pub use winit_config::*;
pub use winit_windows::*... |
use crate::binary::ChumBinary;
use crate::common::*;
use crate::error;
use crate::format::TotemFormat;
use crate::reader::skin;
use crate::scene;
use std::collections::HashMap;
use std::io::{self, Read, Write};
#[derive(Clone, Debug)]
#[repr(C)]
pub struct MeshPoint {
pub vertex: Vector3,
pub texcoord: Vector2... |
use crate::indexing::SpIndex;
use crate::sparse::permutation::PermOwnedI;
use crate::sparse::symmetric::is_symmetric;
use crate::sparse::CsMatViewI;
use std::collections::vec_deque::VecDeque;
pub struct Ordering<I> {
/// The computed permutation
pub perm: PermOwnedI<I>,
/// Indices inside the permutation d... |
// Copyright 2019 Parity Technologies (UK) Ltd.
//
// Permission is hereby granted, free of charge, to any
// person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the
// Software without restriction, including without
// limitation the rights to use, copy, modify, ... |
mod client;
mod transport;
pub use client::Client;
pub use futures_executor::block_on;
pub use jsonrpc::Call;
pub use jsonrpc_core as jsonrpc;
pub use lsp::{Position, Url};
pub use lsp_types as lsp;
use futures_util::stream::select_all::SelectAll;
use helix_core::syntax::LanguageConfiguration;
use std::{
collect... |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Trait for cloning data into a shared memory buffer.
//!
//! This module contains the SharedMemoryBuilder type... |
pub(super) mod atom;
pub(super) mod read;
pub(crate) mod write;
use super::AtomIdent;
use crate::error::Result;
use crate::types::item::{ItemKey, ItemValue, TagItem};
use crate::types::picture::{Picture, PictureType};
use crate::types::tag::{Accessor, Tag, TagType};
use atom::{Atom, AtomData, AtomDataRef, AtomIdentRef... |
pub mod color;
pub mod forest;
pub mod frontier;
pub mod hilbert;
pub mod soft;
use crate::color::source::{AllColors, ColorSource, ImageColors};
use crate::color::{order, ColorSpace, LabSpace, LuvSpace, Rgb8, RgbSpace};
use crate::frontier::image::ImageFrontier;
use crate::frontier::mean::MeanFrontier;
use crate::fron... |
use crate::math::prelude::*;
use crate::util;
use bevy::prelude::*;
use serde::Serialize;
use std::{
fs::File,
io::{BufRead, BufReader, BufWriter},
iter::Iterator,
path::Path,
sync::Arc,
};
pub type BlockMap = ndarray::Array3<bool>;
const NUM_PLANE_CORNERS: usize = 4;
pub trait Bitmap {
fn get... |
use std::convert::Infallible;
use std::ops::Range;
use std::{error, fmt, result};
use crate::pattern::char::{Char, EscapeSequence};
use crate::pattern::error::{ErrorRange, GetErrorRange};
use crate::pattern::escape::{escape_char, escape_str};
use crate::pattern::regex::RegexHolder;
use crate::pattern::symbols::{EXPR_E... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00..0x20 - Register %s that stores data to be programmed."]
pub pgm_data: [crate::Reg<pgm_data::PGM_DATA_SPEC>; 8],
#[doc = "0x20..0x2c - Register %s that stores the RS code to be programmed."]
pub pgm_check_value: [crate::Reg<p... |
use support::{
decl_module,
decl_storage,
decl_event,
StorageValue,
StorageMap,
dispatch::Result,
ensure,
traits::Currency,
traits::ReservableCurrency,
};
use system::{ ensure_signed };
use parity_codec::{ Encode, Decode };
use runtime_primitives::traits::{ As };
use runtime_pr... |
//! Reset and clock control implementation
use stm32h7::stm32h7x3::{rcc, RCC};
use cast::{u8, u16};
use crate::time::Hertz;
use crate::flash::ACR;
/// Extension trait that constrains the `RCC` peripheral
pub trait RccExt {
/// Constrains the `RCC` peripheral so it plays nicely with the other abstractions
fn c... |
//
// Copyright (c) 2017 10x Genomics, Inc. All rights reserved.
//
extern crate bio;
use debruijn::dna_string::DnaString;
use sw;
use bam_utils;
use constants::{UmiType, ReadType};
use std;
use utils;
use rust_htslib::bam;
/// A macro creating methods for flag access.
/// Copied from rust_htslib.
macro_rules! flag... |
use crate::boundary::Boundary;
/// Base common denominator across all the mesh implementations used.
pub trait Meshify {
fn new() -> Self;
fn with(
indices: Vec<u32>,
positions: Vec<[f32; 3]>,
normals: Vec<[f32; 3]>,
uvs: Vec<[f32; 2]>,
) -> Self;
fn get_indices(&self) -> &Vec<u32>;
fn get_no... |
//! A simple range set implementation
//!
//! Once it's finished it should work with any Ord types
//!
//! Look Ma, no clones
use std::cmp::{Ord, Ordering, max, min};
/// Our range type is designed to use the minimum information needed
/// to fully describe the range. We even special-case one-element ranges.
///
/// ... |
use ic_config::embedders::{Config, PersistenceType};
use ic_embedders::{wasmtime_embedder::WasmtimeInstance, InstanceRunResult, WasmtimeEmbedder};
use ic_registry_routing_table::{CanisterIdRange, RoutingTable};
use ic_replicated_state::NumWasmPages;
use ic_system_api::{ApiType, SystemApiImpl};
use ic_test_utilities::{
... |
use std::collections::hash_map::Entry::*;
use rustc_ast::expand::allocator::ALLOCATOR_METHODS;
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::fx::FxHashMap;
use rustc_hir as hir;
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use rustc_hir... |
//! Models relating to channels and types within channels.
mod attachment;
mod attachment_type;
mod channel_category;
mod channel_id;
mod embed;
mod guild_channel;
mod message;
mod partial_channel;
mod private_channel;
mod reaction;
#[cfg(all(feature = "cache", feature = "model", feature = "utils"))]
use std::error::... |
use std::str::FromStr;
type Target = String;
type Nickname = String;
type Channel = String;
type Msg = String;
type Server = String;
type Port = String;
type Subcommand = String;
type Key = String;
type ServerMask = String;
type Password = String;
type Token = String;
type Query = String;
type UserMode =... |
use crate::group::{Curve, Element, Point, Scalar};
use rand_core::RngCore;
use serde::{Deserialize, Serialize};
use std::{collections::BTreeMap, fmt};
use thiserror::Error;
pub type PrivatePoly<C> = Poly<<C as Curve>::Scalar>;
pub type PublicPoly<C> = Poly<<C as Curve>::Point>;
pub type Idx = u32;
#[derive(Debug, Cl... |
use std::{
borrow::Borrow,
fmt,
hash,
os::raw::c_void,
ptr,
sync::{Arc, Mutex},
time::Instant,
};
use ash::{extensions::khr, version::DeviceV1_0 as _, vk};
use hal::{format::Format, window as w};
use smallvec::SmallVec;
use crate::{conv, info, native};
use crate::{
Backend,
Device,... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use admission_control_proto::proto::{
admission_control::{
SubmitTransactionRequest, SubmitTransactionResponse as ProtoSubmitTransactionResponse,
},
admission_control_grpc::AdmissionControlClient,
};
use client::{Ac... |
use std::fs::{copy, create_dir_all, File};
use std::path::{Path, PathBuf};
use crate::container::{handle_container_output, run_dockyard_command};
use anyhow::{Context, Result};
use bollard::container::InspectContainerOptions;
use bollard::models::{
ContainerConfig, ContainerInspectResponse, HostConfig, Mount, Moun... |
//! An embedded database backed `Provider` implementation.
//!
//! Currently, the underlying storage engine uses the [sled embedded
//! database](https://github.com/spacejam/sled). This database provides caching support as well as
//! atomic operations. Underneath the hood, we encode the data using the
//! [CBOR](https... |
// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//! The protocol for vhost-user is based on the existing implementation of vhost for the Linux
//! Kernel. The protocol defines two sides of the communication, master and slave. Master is
//! the application that... |
use std::collections::BTreeSet;
use std::error::Error;
use std::fmt;
use std::io;
use std::sync::Arc;
use ::sentry::Hub;
use backtrace::Backtrace;
use futures::future::{self, Future, TryFutureExt};
use sentry::SentryFutureExt;
use symbolic::debuginfo;
use crate::cache::{Cache, CacheStatus};
use crate::logging::LogErr... |
//! # How to use cpal
//!
//! Here are some concepts cpal exposes:
//!
//! - A [**Host**](./struct.Host.html) provides access to the available audio devices on the system.
//! Some platforms have more than one host available, but every platform supported by CPAL has at
//! least one [**DefaultHost**](./struct.Host.... |
//! Declare the [`FallbackState`] type, which is used to store a set of FallbackDir.
use crate::skew::SkewObservation;
use rand::seq::IteratorRandom;
use std::time::{Duration, Instant};
use super::{DirStatus, FallbackDir, FallbackDirBuilder};
use crate::fallback::default_fallbacks;
use crate::{ids::FallbackId, PickGu... |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {fidl_fuchsia_bluetooth_avrcp as fidl_avrcp, std::convert::TryInto};
use super::*;
/// The smallest packet size of a GetFolderItemsCommand.
/// 1 byt... |
//! Details of the `ruma_api` procedural macro.
use std::convert::{TryFrom, TryInto as _};
use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use syn::{
braced,
parse::{Parse, ParseStream},
Field, FieldValue, Ident, Token, Type,
};
mod attribute;
mod metadata;
mod request;
mod response;
... |
use std::fs;
use std::io::{Read, Write};
use std::path::PathBuf;
use ckb_jsonrpc_types as json_types;
use ckb_sdk::{
GenesisInfo, HttpRpcClient, MockCellDep, MockInfo, MockInput, MockResourceLoader,
MockTransaction, MockTransactionHelper, ReprMockCellDep, ReprMockInfo, ReprMockInput,
ReprMockTransaction,
}... |
// This module implements Identifier, a short-optimized string allowed to
// contain only the ASCII characters hyphen, dot, 0-9, A-Z, a-z.
//
// As of mid-2021, the distribution of pre-release lengths on crates.io is:
//
// length count length count length count
// 0 355929 11 ... |
use crate::api;
use crate::injector::{Injector, Key};
use crate::prelude::BoxStream;
use crate::tags;
use anyhow::{bail, Result};
use async_fuse::Fuse;
use backoff::backoff::Backoff as _;
use serde::Deserialize as _;
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
use std... |
/// Day 20: https://adventofcode.com/2020/day/20
/// Copyright 2021 by <NAME>
/// Note: It isn't mentioned in the problem statement, but every edge
/// in the provided tile-set has a unique complementary pairing.
/// This makes the problem *MUCH* easier to solve.
use std::collections::HashMap;
#[path = "co... |
use std::collections::{BTreeMap, BTreeSet};
use std::task::Waker;
use std::time::{Duration, Instant};
use std::{
collections::{HashMap, HashSet, VecDeque},
error,
sync::Arc,
task::{Context, Poll},
};
use ip_network::IpNetwork;
use libp2p::swarm::DialPeerCondition;
use libp2p::{
core::connection::Co... |
// Copyright 2015 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// 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 ... |
use crate::configuration::TaskwarriorSettings;
use anyhow::{anyhow, Context};
use chrono::{DateTime, Utc};
use configparser::ini::Ini;
use contextswitch::{ContextswitchData, Task, TaskId};
use regex::Regex;
use serde::{Deserialize, Serialize};
use serde_json;
use std::env;
use std::fmt;
use std::path::Path;
use std::pr... |
extern crate clap;
extern crate regex;
extern crate futures;
extern crate tokio_core;
extern crate reqwest;
#[macro_use]
extern crate hyper;
#[macro_use]
extern crate frunk;
#[macro_use]
extern crate serde_json;
extern crate json_color;
mod client;
use serde_json::{to_string_pretty};
use frunk::validated::*;
use s... |
mod client;
pub mod generator;
mod player_store;
mod server_world_handler;
pub mod superchunk;
pub mod world_store;
extern crate nalgebra_glm as glm;
use client::*;
use common::world_definition::WorldList;
use common::world_type::GeneratorType;
use common::{block::BlockRegistry, comms::*};
use common::{block::*, dayn... |
use clap::*;
use clap::{App, Arg};
use crossbeam::channel;
use crossbeam::channel::{Receiver, Sender, TryRecvError};
use log::*;
use nng::{Protocol, Socket};
use rendezvous_hash::{DefaultNodeHasher, RendezvousNodes};
use simplelog::{CombinedLogger, Config, SharedLogger, TermLogger, WriteLogger};
use std::fs::{create_d... |
use serde::{Deserialize, Serialize};
use std::collections::{HashMap, HashSet};
use std::fs;
use std::fs::File;
use std::io::Write;
const ARMS_ASSET_TYPE_IDS_TXT: &str = include_str!("arms-asset-type-ids.txt");
const UNITS_TXT: &str = include_str!("units.txt");
trait HasId {
fn id(&self) -> String;
}
#[derive(Clo... |
#[allow(unused)]
#[allow(non_camel_case_types)]
mod ratls;
use http::header;
use http::StatusCode;
use libc;
use ratls::ffi as ratlsffi;
use reqwest::header::HeaderMap;
use sgx_types::{
c_int, c_void, sgx_attributes_t, sgx_calc_quote_size, sgx_epid_group_id_t, sgx_get_quote,
sgx_init_quote, sgx_launch_token_t,... |
use crate::{record::DataTypeRead, utils};
use super::{
mdf3_block::{LinkedBlock, Mdf3Block},
tx_block::Txblock, channel_type::ChannelType,
};
#[derive(Debug, Clone, Copy)]
pub struct Cnblock {
#[allow(dead_code)]
block_type: [u8; 2],
#[allow(dead_code)]
block_size: u16,
#[allow(dead_code)]... |
//! Routines for comparing and diffing output.
//!
//! # Patterns
//!
//! Many of these functions support special markup to assist with comparing
//! text that may vary or is otherwise uninteresting for the test at hand. The
//! supported patterns are:
//!
//! - `[..]` is a wildcard that matches 0 or more characters on... |
// Copyright © 2020 <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 th... |
//! Implements a block store.
//!
//! The references of a block is the set of `Cid`s that are contained within a block. A closure
//! is the recursive set of references, containing all `Cid`s that are reachable from a block.
//!
//! When aliasing a block the closure of the block is added to the bag containing the block... |
use std::rc::Rc;
use seed::{*, prelude::*};
use web_sys::{CanvasRenderingContext2d, Event, HtmlCanvasElement, KeyboardEvent};
use space_invaders::{GameObj, Instruction, PlayField, Position, Unit};
use space_invaders::alien::{Alien, Aliens, AlienType};
use space_invaders::bullet::Bullet;
use space_invaders::bunker::{B... |
use rustc_hir::def_id::DefId;
use rustc_middle::hir;
use rustc_middle::mir::*;
use rustc_middle::ty::TyCtxt;
use rustc_session::config::MirSpanview;
use rustc_span::{BytePos, Pos, Span};
use std::io::{self, Write};
use std::iter::Peekable;
pub const TOOLTIP_INDENT: &str = " ";
const NEW_LINE_SPAN: &str = "</span>... |
use crate::ast::*;
use crate::Error;
use std::collections::HashMap;
#[derive(Copy, Clone)]
pub enum Ns {
Data,
Elem,
Event,
Func,
Global,
Memory,
Table,
Type,
Field,
}
impl Ns {
fn desc(&self) -> &'static str {
match self {
Ns::Data => "data",
Ns... |
//! ## Generator module ##
//!
//! Basic working principle:
//! Every sample-output generating object (Cylinder, WaveGuide, DelayLine, ..) has to be first `pop`ped,
//! it's output worked upon and then new input samples are `push`ed.
//!
use crate::recorder::Recorder;
use rand_core::{RngCore, SeedableRng};
use rand_x... |
#![cfg_attr(not(feature = "std"), no_std)]
/// Edit this file to define custom logic or remove it if it is not needed.
/// Learn more about FRAME and the core library of Substrate FRAME pallets:
/// <https://substrate.dev/docs/en/knowledgebase/runtime/frame>
use codec::{Encode, Decode};
use frame_support::{
log,
tr... |
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::collections::VecDeque;
use std::iter::FromIterator;
use std::path::PathBuf;
use anyhow::bail;
// fn is_keyword(string: &str) -> bool {
// match string {
// "abstract" => true,
// "assert" => true,
// "boolean" => true,
// ... |
//! Datastructure to efficiently store function bodies and their instructions.
use super::{
super::Index,
bytecode::{BrTable, VisitInstruction},
Instruction,
};
use alloc::vec::Vec;
use core::iter;
/// A reference to a Wasm function body stored in the [`CodeMap`].
#[derive(Debug, Copy, Clone)]
pub struct ... |
use std::{
collections::{hash_map::Entry, HashMap},
convert::Infallible,
fmt::{self, Display, Formatter},
marker::PhantomData,
};
use datasize::DataSize;
use derive_more::From;
use futures::FutureExt;
use itertools::Itertools;
use prometheus::{IntGauge, Registry};
use tracing::{debug, error, info, warn... |
use serde::Serialize;
use arrayvec::ArrayVec;
use std::collections::VecDeque;
use wasm_bindgen::prelude::*;
#[cfg(debug_assertions)]
use web_sys::console;
type Result<T> = std::result::Result<T, JsValue>;
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;... |
use std::collections::HashMap;
use std::convert::TryInto;
use std::fs;
use std::io::Read;
use std::path::Path;
use std::sync::mpsc::Sender;
use actix_web::web::Bytes;
use chrono::{DateTime, NaiveDate, NaiveDateTime};
use jsonpath_lib::Selector;
use lmdb::{Cursor, Database, DatabaseFlags, Environment, EnvironmentFlags,... |
/*
WeeGP
Variations on Riccardo Poli's TinyGP:
https://cswww.essex.ac.uk/staff/rpoli/TinyGP/
https://cswww.essex.ac.uk/staff/rpoli/TinyGP/tiny_gp.java
March 2019 by <NAME> (<EMAIL>)
*/
use rand::prelude::*;
use std::error::Error;
use std::io::prelude::*;
use std::str::FromStr;
use std::... |
use std::convert::From;
use std::fmt;
use std::i32;
#[derive(Debug, Clone)]
pub struct MarketDataTypeMsg {
pub req_id: i32,
pub market_data_type: i32,
}
#[derive(Debug, Clone)]
#[repr(C)]
#[allow(non_camel_case_types)]
pub enum MarketDataType {
REALTIME = 1,
FROZEN = 2,
DELAYED = 3,
DELAYED_FR... |
/*
* Copyright 2018 Bitwise IO, Inc.
*
* 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... |
// PASS | assign_frame_variables
// ---------------------------------------------------------------------------
// USAGE | assign_frame_variables : alloc_lang::Program ->
// | alloc_lang::Program
// ---------------------------------------------------------------------------
// RET... |
use std::{
cmp::max,
collections::hash_map::{self, HashMap},
path::Path,
};
use abgc::Gc;
use itertools::Itertools;
use lrpar::{Lexeme, Lexer};
use crate::{
compiler::{
ast,
instrs::{Builtin, Instr, Primitive},
StorageT,
},
vm::{
objects::{BlockInfo, Class, Meth... |
// RGB Core Library: a reference implementation of RGB smart contract standards.
// Written in 2019-2022 by
// Dr. <NAME> <<EMAIL>>
//
// To the extent possible under law, the author(s) have dedicated all copyright
// and related and neighboring rights to this software to the public domain
// worldwide. This softwa... |
use anchor_client::Cluster;
use anchor_syn::idl::Idl;
use anyhow::{anyhow, Error, Result};
use clap::{ArgEnum, Clap};
use serde::{Deserialize, Serialize};
use solana_sdk::pubkey::Pubkey;
use solana_sdk::signature::{Keypair, Signer};
use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::fs::{self, File};
u... |
use std::fmt::{self, Display, Debug, Formatter};
use std::error::Error;
use std::io::{self,Read};
use std::net::{SocketAddr,IpAddr,Ipv4Addr,Ipv6Addr,AddrParseError};
use std::str::Utf8Error;
use std::num::ParseIntError;
use hyper;
use byteorder::{NetworkEndian,ByteOrder};
/// Version of the PROXY protocol to look fo... |
use std::sync::{self, Arc, Mutex};
use std::cell::RefCell;
use std::rc::Rc;
use std::thread;
use clock;
use cpu;
use ldr;
use mem;
use io;
use msgs;
use fs;
use cpu::{v5, v6};
use cpu::caches::Ops;
#[derive(Clone)]
pub enum Message {
Quit,
StartEmulation,
SuspendEmulation,
Arm9Halted(cpu::BreakReason... |
use crate::transport::{
error::{TransportError, TransportResult},
protocol::*,
websocket::{
streams::{ConnectionStatus, StreamEvent, StreamManager},
tls::TlsConfig,
},
};
use detach::Detach;
use holochain_tracing::Span;
// use lib3h_discovery::{
// error::{DiscoveryError, DiscoveryRe... |
use std::hash::{self, Hash};
use std::num::ToPrimitive;
use sys::keycode as ll;
#[derive(PartialEq, Eq, FromPrimitive, Debug, Copy)]
pub enum KeyCode {
Unknown = ll::SDLK_UNKNOWN as isize,
Backspace = ll::SDLK_BACKSPACE as isize,
Tab = ll::SDLK_TAB as isize,
Return ... |
use crate::blocks::{BlockEntity, BlockPos};
use crate::network::packets::clientbound::{
C3BMultiBlockChangeRecord, CChunkData, CChunkDataSection, CMultiBlockChange, ClientBoundPacket,
};
use crate::network::packets::PacketEncoder;
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, HashMap};
use s... |
//! Functions to load fonts and draw text.
use core::cmp::Ordering::Equal;
use std::collections::HashMap;
use crate::{
color::Color,
get_context,
math::{vec3, Rect},
texture::Image,
};
use crate::color::WHITE;
use glam::vec2;
use std::cell::RefCell;
use std::rc::Rc;
pub(crate) mod atlas;
use atlas... |
// Copyright (c) 2018-2022 The MobileCoin Foundation
use crate::common::BlockRange;
use alloc::vec::Vec;
use core::convert::TryFrom;
use crc::Crc;
use displaydoc::Display;
use mc_crypto_keys::{CompressedRistrettoPublic, KeyError, RistrettoPrivate, RistrettoPublic};
use mc_transaction_core::{
encrypted_fog_hint::{E... |
//! Parsing a literal number.
use crate::{Result, Stream};
use crate::token::Tokenizable;
use crate::expression::Executable;
use std::convert::TryFrom;
use quest_core::Object;
/// A literal number is actually just a `quest_core::Number`.
pub use quest_core::types::Number;
/// The error that can occur whilst trying t... |
use common::Input;
use common::input::is_white;
use std::collections::HashMap;
use crate::{BStringLc, DatabaseBuilder, Entry};
use crate::error::{ErrorContext, ErrorKind, IdentifierKind, ProblemReporter, WarningKind};
trait ResultExt<T> {
fn or_bail(self, p: &mut Parser, ctxt: ErrorContext) -> Option<T>;
}
impl<... |
// Copyright (c) 2020 Huawei Technologies Co.,Ltd. All rights reserved.
//
// StratoVirt is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan
// PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.