text stringlengths 7.05k 33.9k |
|---|
mod empty_read;
mod sys_out;
mod regular_file;
use crate::syscall_defs::*;
use crate::*;
use std::io::{Write, Read};
use empty_read::EmptyRead;
use sys_out::SysOutObj;
use regular_file::RegularFile;
#[derive(Clone, Copy, PartialEq, Eq)]
#[repr(transparent)]
pub struct FileDescriptor(pub i32);
const BAD_FD: FileDescr... |
//! Low level and internal http and https implementation.
use std::cmp;
use std::collections::HashMap;
use std::mem;
use std::time::Duration;
use std::vec::Vec;
use async_std::io::{self, stderr, Read, Result as IoResult, Write};
use async_std::net::{SocketAddr, TcpStream};
use async_std::prelude::*;
use log::Level::{I... |
//! The standalone (command line) MM1 compiler interface.
//!
//! This is similar to [`mm0_rs::server`] but it reports diagnostics using Rust-style errors using
//! the [`annotate_snippets`] crate.
//!
//! Additionally, unlike the server, the MM1 compiler will go on and generate MMB or MMU proofs,
//! which can then be... |
extern crate serde_json;
use chrono;
use context;
use feedfetcher;
use feedproxy_api;
use transit_realtime;
use prost;
use result;
use rustful;
use std;
use stops;
use utils;
use webclient_api;
fn get_debug_info(info: &mut Option<webclient_api::DebugInfo>) -> &mut webclient_api::DebugInfo {
if info.is_none() {
... |
#[macro_use]
extern crate failure;
extern crate fnv;
extern crate rustling_core;
extern crate rustling_ml;
pub use rustling_core::regex;
pub use rustling_core::{
AttemptFrom, AttemptInto, BoundariesChecker, InnerStashIndexable, Node, NodePayload,
ParsedNode, Range, RuleSet, RuleSetBuilder, StashIndexable, Sym,... |
use crate::frame::{Frame, FrameDecoder, FrameEncoder};
use crate::util::{self, WebSocketKey};
use crate::{Error, ErrorKind, Result};
use async_std::net::TcpStream;
use bytecodec::io::{IoDecodeExt, IoEncodeExt, ReadBuf, StreamState, WriteBuf};
use bytecodec::{Decode, Encode, EncodeExt};
use httpcodec::{
HeaderField,... |
#![warn(trivial_casts, trivial_numeric_casts, unused_import_braces)]
#![deny(missing_debug_implementations, missing_copy_implementations)]
#![warn(clippy::expl_impl_clone_on_copy)]
#![warn(clippy::float_cmp_const)]
#![warn(clippy::linkedlist)]
#![warn(clippy::map_flatten)]
#![warn(clippy::match_same_arms)]
#![warn(clip... |
struct Context<'s>(&'s str);
struct Parser<'c, 's: 'c> {
context: &'c Context<'s>,
}
impl<'c, 's> Parser<'c, 's> {
fn parse(&self) -> Result<(), &'s str> {
Err(&self.context.0[1..])
}
}
fn parse_context<'a>(context: &'a Context) -> Result<(), &'a str> {
Parser { context }.parse()
}
struct ... |
//! This module offers methods to build and create/update configmaps.
//!
//! ConfigMaps using this module are required to implement certain labels to be identifiable via
//! a LabelSelector:
//! * `labels::APP_NAME_LABEL`
//! * `labels::APP_INSTANCE_LABEL`
//! * `labels::APP_COMPONENT_LABEL`
//! * `labels::APP_ROLE_GR... |
// TODO: this is likely not final design either, I don't like that we always traverse & interpret whole tree
// and I think it should be possible to have something like retained-mesh design (create_mesh() -> Id),
// where every mesh/model is updated in .update() and render() can just (sequentially) draw tho... |
use crate::{layout, primitives};
use primitives::{Atom, AtomContent, Token};
use serde::{Deserialize, Serialize};
pub mod bind;
/// A fatal error returned by the parser.
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub struct Err<'a> {
#[serde(borrow)]
pub stanza: layout::Stanza<'a>,
pub... |
use crate::layout::GlyphRasterConfig;
use crate::math::{Geometry, Line};
use crate::platform::{as_i32, ceil, fract, is_negative};
use crate::raster::Raster;
use crate::FontResult;
use alloc::vec;
use alloc::vec::*;
use core::mem;
use core::num::NonZeroU16;
use core::ops::Deref;
use hashbrown::HashMap;
use ttf_parser::F... |
#![cfg_attr(
not(test),
warn(
clippy::disallowed_method,
clippy::disallowed_type,
clippy::indexing_slicing,
clippy::todo,
clippy::unwrap_used,
clippy::panic
)
)] // allow in tests#![warn(clippy::unseparated_literal_suffix, clippy::disallowed_type)]
#![cfg_attr(not(feature = "std"), no_std)]
#![warn(
bad... |
// 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.
//! Test tools for building and serving TUF repositories containing Fuchsia packages.
use {
crate::{package::Package, serve::ServedRepositoryBuilder},... |
// Copyright 2020 Folyd
// Copyright 1999 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 applica... |
//! stm32ral module for stm32h735
/// Number of priority bits implemented by the NVIC
pub const NVIC_PRIO_BITS: u8 = 4;
/// Interrupt-related magic for this device
pub mod interrupts;
pub use self::interrupts::Interrupt;
pub use self::interrupts::Interrupt as interrupt;
pub use super::instances::ac;
pub mod adc;
pub... |
use cosmwasm_bignumber::{Decimal256, Uint256};
use cosmwasm_std::{
log, to_binary, Api, BankMsg, Binary, Coin, CosmosMsg, Env, Extern, HandleResponse,
HandleResult, HumanAddr, InitResponse, InitResult, MigrateResponse, MigrateResult, Querier,
StdError, StdResult, Storage, WasmMsg,
};
use crate::collateral:... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Status and Control register"]
pub sc: SC,
#[doc = "0x04 - Modulus register"]
pub mod_: MOD,
#[doc = "0x08 - Counter register"]
pub cnt: CNT,
#[doc = "0x0c - Interrupt Delay register"]
pub idly: IDLY,
#[d... |
// wdget
//
// (C) 2020 Count Count
//
// Distributed under the terms of the MIT license.
use std::cmp::min;
use std::collections::BTreeMap;
use std::ffi::OsStr;
use std::fs;
use std::fs::OpenOptions;
use std::io::{Read, Write};
use std::num::NonZeroUsize;
use std::path::{Path, PathBuf};
use bytes::Bytes;
use bzip2::r... |
//! Helper struct to build a `Function`.
use device::Device;
use helper::{AutoOperand, LogicalDim, MetaStatement};
use ir::{self, mem, op, Parameter, Type};
use ir::{
AccessPattern, Function, InstId, Operand, Operator, Signature, ValueDef, ValueId,
};
use itertools::Itertools;
use search_space::{Action, DimKind, In... |
pub use egui;
pub use egui::color_picker;
pub use egui_wgpu_backend;
use egui::{pos2, ClippedMesh, CtxRef};
use egui_wgpu_backend::{epi, ScreenDescriptor};
use nannou::{wgpu, winit::event::VirtualKeyCode, winit::event::WindowEvent::*};
use std::{
cell::RefCell,
ops::Deref,
sync::{Arc, Mutex},
time::Dur... |
#![allow(non_snake_case, non_camel_case_types, deprecated, unused_assignments)]
extern crate rand;
use xdr_codec;
use xdr_codec::Pack;
use std::convert::TryFrom;
use std::fmt;
use std::str::FromStr;
use crc16::{State, XMODEM};
use data_encoding;
extern crate byteorder;
use byteorder::ByteOrder;
use crypto::ed25519;
... |
use crate::interner::StrId;
use crate::lexical::{Keyword::*, LexerError, Symbol::{self, *}, Token, TokenKind, TokenResult};
use crate::span::{Span, Spanned};
use crate::syntax::{Block, Expr, ExprKind, InfixOp, Item, ItemKind, Local, Literal::*, Stmt, StmtKind, Type, TypeKind, UnaryOp};
use crate::syntax::items::FnSig;
... |
use crate::hal;
use crate::misaligned;
global_asm!(include_str!("rv64.S"));
global_asm!(include_str!("trap.S"));
#[allow(unused)]
#[derive(Debug)]
struct TrapFrame {
ra: usize,
t0: usize,
t1: usize,
t2: usize,
t3: usize,
t4: usize,
t5: usize,
t6: usize,
a0: usize,
a1: usize,
... |
// TODO: More user-friendly error messages.
// TODO: Check duplication of record field name.
use crate::ast::*;
use crate::impl_prelude::*;
use super::env::{TEnv, VEnv};
use super::{func_context::FuncContext, type_alias::AliasResolver};
pub struct SemanticAnalyzer {
venv: VEnv,
tenv: TEnv,
depth: u32,
... |
use super::Route;
use http::uri::URI;
use http::ContentType;
use request::Request;
/// The Collider trait is used to determine if two items that can be routed on
/// can match against a given request. That is, if two items `collide`, they
/// will both match against _some_ request.
pub trait Collider<T: ?Sized = Self... |
extern {
fn RCS_getexpand(arg1 : *mut rcsnode) -> *mut u8;
fn RCS_getrevtime(
rcs : *mut rcsnode, rev : *const u8, date : *mut u8, fudge : i32
) -> isize;
fn RCS_getversion(
rcs : *mut rcsnode,
tag : *const u8,
date : *const u8,
force_tag_match : i32,
simp... |
use std::f32::{INFINITY, NEG_INFINITY};
use math::*;
// use core::Object3D;
#[derive(Debug,PartialEq,Copy,Clone)]
pub struct Box2 {
pub min: Vector2,
pub max: Vector2,
}
impl Box2 {
pub const EMPTY: Box2 = Box2 {
min: Vector2 {
x: INFINITY,
y: INFINITY,
},
... |
//! Utilities to handle smoothing parameter changes over time.
use atomic_float::AtomicF32;
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
use std::sync::atomic::{AtomicI32, Ordering};
use crate::buffer::Block;
/// Controls if and how parameters gets smoothed.
#[derive(Debug, Clone, Copy)]
pub enum SmoothingStyl... |
// Copyright (c) The cargo-guppy Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Facilities for writing out TOML data from a Hakari map.
use crate::hakari::{HakariBuilder, OutputMap};
#[cfg(feature = "cli-support")]
use crate::summaries::HakariBuilderSummary;
use camino::Utf8PathBuf;
use cfg_if::cfg_if... |
#![recursion_limit="1024"] // Recursion limit for error-chain, value used as recommended by the crates documentation.
// Copyright 2020 sacn Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opens... |
// Copyright (c) 2017 <NAME>, RWTH Aachen University
// <NAME>, RWTH Aachen University
//
// MIT License
//
// 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 restr... |
use std;
use std::collections::HashMap;
use std::vec::Vec;
use std::io;
use std::io::{Read, Write};
use std::sync::{Mutex, Arc, atomic};
use std::thread;
use console::{Term, style};
use failure::Error;
use crate::stack_trace::{StackTrace, Frame};
pub struct ConsoleViewer {
#[allow(dead_code)]
console_config:... |
use super::*;
// use super::vm_area::VMArea;
// use super::free_space_manager::VMFreeSpaceManager;
use super::vm_area::*;
use super::vm_perms::VMPerms;
use std::collections::BTreeSet;
use intrusive_collections::rbtree::{Link, RBTree};
use intrusive_collections::Bound;
use intrusive_collections::RBTreeLink;
use intrus... |
//! Compact formats for the leap second list
//! ========================================
//!
//! The `leapsecs` crate can read and write the list of leap seconds
//! in a number of formats.
//!
//! * A compact text format, implemented by the [`txt`][] module.
//! For example, the current list is:
//!
//! ```text... |
//! voyager
//!
//! With voyager you can easily extract structured data from websites.
//!
//! Write your own crawler/crawler with Voyager following a state machine model.
//!
//! # Example
//!
//! ```no_run
//! # use voyager::scraper::Selector;
//! # use reqwest::Url;
//! /// Declare your scraper, with all the selecto... |
use std::alloc::{GlobalAlloc, Layout, System};
use std::collections::{BTreeMap, HashMap};
use std::iter::FromIterator;
use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
use graph::prelude::{lazy_static, q};
use rand::SeedableRng;
use rand::{rngs::SmallRng, Rng};
use structopt::StructOpt;
use graph::util::cache_... |
//! Test relational schemas that use `Bytes` to store ids
use diesel::connection::SimpleConnection as _;
use diesel::pg::PgConnection;
use graph_mock::MockMetricsRegistry;
use hex_literal::hex;
use lazy_static::lazy_static;
use std::borrow::Cow;
use std::{collections::BTreeMap, sync::Arc};
use graph::prelude::{
o,... |
// Allow dead code in here in case I want to publish it as a crate at some
// point.
#![allow(dead_code)]
extern crate enum_primitive_derive;
extern crate libc;
extern crate num_traits;
use bitflags::bitflags;
use enum_primitive_derive::Primitive;
use libc::size_t;
use num_traits::FromPrimitive;
use std::ffi::CString... |
use algebra::{
fields::{
mnt4753::Fr as MNT4753Fr,
mnt6753::Fr as MNT6753Fr,
}, PrimeField, MulShort,
};
use primitives::crh::poseidon::PoseidonParameters;
use crate::crh::FieldBasedHashGadget;
use primitives::crh::{
poseidon::PoseidonHash,
parameters::{
MNT4753PoseidonParameters... |
//! Types for handling [`Bundle`]s.
//!
//! This module contains the [`Bundle`] trait and some other helper types.
pub use bevy_ecs_macros::Bundle;
use crate::{
archetype::{AddBundle, Archetype, ArchetypeId, Archetypes, ComponentStatus},
component::{Component, ComponentId, ComponentTicks, Components, StorageT... |
//! # Lab
//!
//! Tools for converting RGB colors to L\*a\*b\* measurements.
//!
//! RGB colors, for this crate at least, are considered to be an array
//! of `u8` values (`[u8; 3]`), while L\*a\*b\* colors are represented
//! by its own struct that uses `f32` values.
//!
//! # Usage
//! ## Converting single values
//!... |
use hdfs_comm::rpc::Protocol;
use hdfs_comm::protos::hdfs::{AddBlockResponseProto, AddBlockRequestProto, BlockStoragePolicyProto, CompleteResponseProto, CompleteRequestProto, CreateResponseProto, CreateRequestProto, DirectoryListingProto, GetBlockLocationsResponseProto, GetBlockLocationsRequestProto, GetFileInfoRespons... |
use rand::{RngCore, SeedableRng};
use rand_xorshift::XorShiftRng;
use runiversal::common::{mk_t, RangeEnds, Timestamp};
use runiversal::model::common::EndpointId;
use runiversal::model::message as msg;
use runiversal::paxos::{PaxosConfig, PaxosContextBase, PaxosDriver, PaxosTimerEvent};
use runiversal::simulation_utils... |
extern crate minifb;
extern crate rand;
extern crate rodio;
use std::{
error::Error,
fs,
env
};
use rodio::Sink;
use minifb::{
Key,
Window,
WindowOptions,
Scale
};
const WIDTH: usize = 64;
const HEIGHT: usize = 32;
const RAM_SIZE: usize = 4096;
const REGISTER_COUNT: usize = 16;
const P... |
mod fov;
mod setup;
mod ui;
use self::ui::{Logs, MyCanvas};
use crate::{
dungeon_crawl::ui::LogMessage,
world_map::{GridPosition, TileFlags, WorldMap},
AppState,
};
use bevy::{ecs::system::QuerySingleError, prelude::*};
use rand::random;
use std::collections::{HashMap, VecDeque};
#[derive(Debug, Clone, Co... |
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless ... |
use std::f32::EPSILON;
use std::mem::swap;
use geom::mesh::{Mesh, Vertex};
use math::{lerp, Linear};
use math::vec::Vec4;
use Visibility::*;
pub fn hidden_surface_removal<VA, FA>(mesh: &mut Mesh<VA, FA>, bbox_vis: Visibility)
where
VA: Copy + Linear<f32>,
FA: Copy,
{
let mut mesh2 = Mesh {
verts: ... |
//! The implementation of the query system itself. This defines the macros that
//! generate the actual methods on tcx which find and execute the provider,
//! manage the caches, and so forth.
use crate::dep_graph::DepGraph;
use crate::ty::query::Query;
use crate::ty::tls::{self, ImplicitCtxt};
use crate::ty::{self, T... |
#![crate_name = "uu_numfmt"]
/*
* This file is part of the uutils coreutils package.
*
* (c) <NAME> <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
extern crate getopts;
use getopts::{Matches, Options};
use std::io::Bu... |
use std::io::{self, Write};
use byteorder::{LittleEndian, WriteBytesExt};
use crate::error::Result;
use crate::raw::counting_writer::CountingWriter;
use crate::raw::error::Error;
use crate::raw::registry::{Registry, RegistryEntry};
use crate::raw::{CompiledAddr, FstType, Output, Transition, EMPTY_ADDRESS, NONE_ADDRES... |
extern crate atom_syndication;
extern crate chrono;
extern crate clap;
extern crate env_logger;
extern crate futures;
#[macro_use]
extern crate log;
extern crate reqwest;
extern crate serde;
#[macro_use]
extern crate serde_json;
extern crate sxd_document;
extern crate sxd_xpath;
extern crate tokio_core;
extern crate to... |
#[macro_use]
pub mod errors;
mod ftlstream;
use std::cmp;
use std::result;
use std::str;
use self::errors::ErrorKind;
pub use self::errors::ParserError;
use self::ftlstream::ParserStream;
use super::ast;
pub type Result<T> = result::Result<T, ParserError>;
pub fn parse(source: &str) -> result::Result<ast::Resource,... |
extern crate proc_macro;
use proc_macro::TokenStream;
use proc_macro2::{self, TokenStream as TokenStream2};
use syn::{self, Ident, Meta, parse_macro_input};
use syn::spanned::Spanned;
use quote::quote;
use std::collections::HashMap;
/// creates a syn::Error from a span and a errormessage
fn mk_error<D: std::fmt::Dis... |
// Copyright 2017-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 ... |
//! Bacon's cipher, or the Baconian cipher, hides a secret message in plain sight rather than
//! generating ciphertext (steganography). It was devised by <NAME> in 1605.
//!
//! Each character of the plaintext message is encoded as a 5-bit binary character.
//! These characters are then "hidden" in a decoy message thr... |
use crypto::digest::Digest;
use crypto::sha2::Sha256;
use maybe_owned::MaybeOwned;
use num::{Integer, One, Zero};
use serde::{Deserialize, Serialize};
use std::hash::Hash;
use std::{
collections::{HashMap, HashSet},
fmt::Display,
ops::Add,
};
use thiserror::Error;
/// The height of the tree
pub type LogHei... |
use core::panic;
use pest::{iterators::Pair, prec_climber::PrecClimber, Parser};
use once_cell::{self, sync::Lazy};
use crate::{
ast::*,
parse_util::{get_operator_table, QCPairs},
};
use crate::{grammar::*, parse_util::QCPair};
fn parse_builtin_type(pair: QCPair) -> BuiltinType {
let mut inner = pair.as... |
use super::{Lab, EPSILON, KAPPA};
use std::arch::x86_64::*;
use std::{iter, mem};
static BLANK_RGB: [u8; 3] = [0u8; 3];
/// Converts a slice of `[u8; 3]` RGB triples to `Lab`s using 256-bit SIMD operations.
///
/// # Panics
/// This function will panic if executed on a non-x86_64 CPU or one without AVX
/// and SSE 4.... |
use anyhow::{Result, bail};
use clap::Clap;
use ctclient::CTClient;
use serde::Deserialize;
use std::{convert::TryInto, io::Write};
use std::io::Read;
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use sha2::{Sha256, Digest};
use rocksdb::{DB, Options};
mod cert_ext;
#[derive(Deserialize)]
struct OperatorL... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - OTG_FS device configuration register (OTG_FS_DCFG)"]
pub dcfg: crate::Reg<dcfg::DCFG_SPEC>,
#[doc = "0x04 - OTG_FS device control register (OTG_FS_DCTL)"]
pub dctl: crate::Reg<dctl::DCTL_SPEC>,
#[doc = "0x08 - OTG_FS de... |
//! # UTFcrawler
//!
//! ### Authors: <NAME>, <NAME>, <NAME>, <NAME>
//!
//! ## About
//! This is a program to render a top-down view of a dungeon crawler game that can be played in a
//! termial. A terminal size of 103 cols x 30 lines is highly recommended for the maps to display
//! correctly. A terminal font with a ... |
extern crate winapi;
use self::winapi::{
ctypes,
shared::basetsd,
shared::guiddef,
shared::minwindef,
shared::windef,
shared::winerror,
// um::consoleapi,
um::errhandlingapi,
um::handleapi,
um::libloaderapi,
um::memoryapi,
um::minwinbase,
um::processthreadsapi,
... |
// Copyright 2019 The Exonum 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 agreed to i... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
crate::{
known_ess_store::EssJsonRead,
network_config::{NetworkConfig, NetworkIdentifier},
},
failure::{self, bail, forma... |
use super::{BestTimes, ElmaError};
use byteorder::{WriteBytesExt, LE};
use constants::TOP10_SIZE;
use nom::{le_i32, le_u32, le_u8};
use shared::TimeEntry;
use std::fs;
use std::path::PathBuf;
use std::str;
use utils::boolean;
use utils::null_padded_string;
use utils::to_bool;
use utils::{string_null_pad, write_top10};
... |
#![allow(clippy::module_name_repetitions)]
//! Names for keys in mappings and such.
//!
use nvim_api::sys::api::nvim::NvimString;
use std::{borrow::Borrow, fmt};
/// :help key-codes
///
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum KeyCode {
/// `<Nul>`, zero
Nul,
/// `<Bs>`, bac... |
// https://developer.apple.com/documentation/appkit/nscursor
// https://github.com/servo/core-foundation-rs
// https://github.com/rust-windowing/winit
use super::{CursorData, ResultType};
use cocoa::{
base::{id, nil, BOOL, NO, YES},
foundation::{NSDictionary, NSPoint, NSSize, NSString},
};
use core_foundation:... |
/*
Day 18: Snailfish
Help snailfish with their homework. Snailfish numbers are in pairs
that contain either a number or another pair.
To add two numbers together, create a new pair of the two numbers
If a pair is 4 levels deep, it explodes
If a whole number is greater than 9, it splits
A number's magnitude is 3 * the... |
//! Source code locations (some parts borrowed from [qluon])
//!
//! [qluon]: https://github.com/gluon-lang/gluon/blob/master/base/src/pos.rs
use std::fmt;
use std::borrow::Cow;
use std::num::NonZeroU32;
use std::cell::RefCell;
use std::rc::Rc;
use crate::diagnostic::Diagnostic;
use crate::parse::lexer;
pub type Fil... |
//! Control flow analysis for the session type CFG.
use {
std::collections::{HashSet, VecDeque},
thunderdome::Index,
};
use crate::cfg::{Cfg, Ir};
/// The output of a flow analysis is two sets: the "passable" set, indicating which nodes have a
/// possible path "through" them to their continuation - and the ... |
use anyhow::{bail, ensure, Context, Result};
use rusqlite::{params, Connection, DatabaseName, NO_PARAMS};
use std::rc::Rc;
use tracing::{event, Level};
#[derive(Debug, Clone, Default)]
pub struct Database {
pub schema_sql: Vec<String>, // TODO: Optimize to do this only once
pub last_modified: String,
pub l... |
// Copyright 2018-2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// 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) a... |
//! online reinforcement learner (double deep q learning) with experience replay
#![allow(dead_code)]
extern crate rand;
extern crate nn;
extern crate rustc_serialize;
use std::fs::File;
use std::io::{BufReader, BufWriter};
use std::io::prelude::*;
use self::rustc_serialize::json;
use self::rand::Rng;
use self::nn::{... |
use cartridge::mappers::{ChrBaseData, ChrData, PrgBaseData};
use cartridge::mirroring::MirroringMode;
use cartridge::CartridgeHeader;
use cartridge::CpuCartridgeAddressBus;
use cartridge::PpuCartridgeAddressBus;
use cpu::CpuCycle;
use log::{debug, info};
use ppu::PpuCycle;
#[derive(Debug, PartialEq)]
enum PRGBankMode ... |
mod parse;
use std::hash::Hash;
use devise::{Spanned, SpanWrapped, Result, FromMeta, Diagnostic};
use devise::ext::TypeExt as _;
use proc_macro2::{TokenStream, Span};
use crate::proc_macro_ext::StringLit;
use crate::syn_ext::{IdentExt, TypeExt as _};
use crate::http_codegen::{Method, Optional};
use crate::attribute:... |
use crate::{Flag, RustFlags};
enum FlagConstructor {
Flag(Flag),
Opt(fn(&str) -> Option<Flag>),
Repeated(fn(&str) -> Option<(Flag, usize)>),
Unrecognized,
}
mod opt {
use crate::{
Color, CrateType, Emit, ErrorFormat, Flag, LibraryKind, LinkKind, LinkModifier,
LinkModifierPrefix, Li... |
//! # MongoDB Rust Driver
//!
//! A driver written in pure Rust, providing a native interface to MongoDB.
//!
//! ## Connecting to MongoDB
//!
//! The Client is an entry-point to interacting with a MongoDB instance.
//!
//! ```no_run
//! # use mongodb::{Client, ClientOptions, ThreadedClient};
//! # use mongodb::common:... |
//! # Known Answer Tests for the key schedule
//!
//! See <https://github.com/mlswg/mls-implementations/blob/master/test-vectors.md>
//! for more description on the test vectors.
//!
//! If values are not present, they are encoded as empty strings.
use std::convert::TryFrom;
use crate::{ciphersuite::*, config::*, gro... |
// 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::error::PowerManagerError;
use crate::message::{Message, MessageReturn};
use crate::node::Node;
use crate::shutdown_request::{RebootReason, Shutd... |
use std::{
ffi::c_void,
fmt,
};
use num_traits::{One, Zero};
use crate::{
core::{self, Boxed, ToInputArray, ToInputOutputArray, ToOutputArray},
Error,
manual::core::sized::*,
Result,
sys::Result as SysResult,
};
fn index_check(idx: (usize, usize), rows: usize, cols: usize) -> Result<()> {
if idx.0 >= rows {
... |
// https://llvm.org/docs/StackMaps.html#stackmap-section
use byteorder::{LittleEndian, ReadBytesExt};
use std::io::{self, Cursor};
use wasmer_runtime_core::vm::Ctx;
use wasmer_runtime_core::{
module::ModuleInfo,
structures::TypedIndex,
types::{GlobalIndex, LocalOrImport, TableIndex},
};
#[derive(Default, ... |
// 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.
///! This module provides types for managing the set of wayland objects for a
///! connection. The |ObjectMap| associates a numeric object id with a
///! |... |
use super::*;
use ::test_helpers::{dummy_candidate_descriptor, dummy_hash};
use bitvec::bitvec;
use elexeum_primitives::v1::{OccupiedCore, ScheduledCore};
pub fn occupied_core(para_id: u32) -> CoreState {
CoreState::Occupied(OccupiedCore {
group_responsible: para_id.into(),
next_up_on_available: None,
occupie... |
use std::{
collections::{HashMap, HashSet},
path::{Path, PathBuf},
sync::Arc,
};
use ash::{version::DeviceV1_0, vk};
use vkutil::*;
use serde::{Deserialize, Serialize};
use crate::renderer::{Renderer, NUM_BUFFER_SLOTS, NUM_IMAGE_SLOTS};
type Result<T> = std::result::Result<T, Box<dyn std::error::Error>... |
//! Utility code for building [`Layout`]s in common scenarios.
use std::collections::HashSet;
use bellframe::{Bell, Mask, PlaceNot, Stage};
use itertools::Itertools;
use serde::Deserialize;
use super::Link;
pub mod coursewise;
pub mod leadwise;
/// The ways that [`Layout::single_method`] can fail
#[derive(Debug, C... |
use std::mem;
use std::os::raw::c_void;
use std::path::Path;
use std::ptr;
use std::time::Duration;
use c_str_macro::c_str;
use cgmath::perspective;
use cgmath::prelude::SquareMatrix;
use gl::types::{GLfloat, GLsizei};
use imgui::im_str;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
mod image_manager;
mod shad... |
use std::sync::{Arc, Mutex};
use std::cell::RefCell;
use std::str::FromStr;
use crypto;
use crypto::digest::Digest;
use futures::{self, Future, Stream, Async};
use futures_cpupool::CpuPool;
use base64;
use bytes::Bytes;
use serde_json::json;
use positioned_io::WriteAt;
use actix_web::{
client,
HttpMessage,
... |
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
use std::{convert::TryInto, fmt::Display, io, sync::Arc};
use cloud::blob::{none_to_empty, BlobConfig, BlobStorage, BucketConf, StringNonEmpty};
use futures_util::{
future::TryFutureExt,
io::{AsyncRead, AsyncReadExt, Cursor},
stream::{Strea... |
use crate::error::{self, Error, Result};
use crate::memory::GuestPhysAddr;
use crate::{vcpu, vmcs};
use alloc::fmt::Debug;
use bitflags::bitflags;
use core::convert::TryFrom;
use num_enum::TryFromPrimitive;
extern "C" {
pub fn vmexit_handler_wrapper();
}
#[repr(C)]
#[repr(packed)]
#[derive(Clone, Copy, Debug)]
pu... |
//! Terra is a large scale terrain generation and rendering library built on top of wgpu.
#![cfg_attr(test, feature(test))]
#[cfg(test)]
extern crate test;
#[macro_use]
extern crate lazy_static;
extern crate rshader;
mod asset;
mod cache;
mod coordinates;
mod generate;
mod gpu_state;
mod mapfile;
mod sky;
mod srgb;
... |
// Copyright 2020. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclai... |
use crate::network::{self, NetworkController, NetworkProcessor, NetEvent, Endpoint, ResourceId};
use crate::events::{self, EventSender, EventReceiver};
use crate::util::thread::{NamespacedThread, OTHER_THREAD_ERR};
use std::sync::{
Arc, Mutex,
atomic::{AtomicBool, Ordering},
};
use std::time::{Duration};
use s... |
/*!
Amazon S3 releases
*/
use crate::{
errors::*,
get_target,
update::{Release, ReleaseAsset, ReleaseUpdate},
version::bump_is_greater,
};
use indicatif::ProgressStyle;
use quick_xml::events::Event;
use quick_xml::Reader;
use regex::Regex;
use reqwest;
use std::cmp::Ordering;
use std::env;
use std::path... |
// std
use std::sync::atomic::{AtomicI32, AtomicU64, Ordering};
// others
use strum::IntoEnumIterator;
// pbrt
use crate::core::geometry::{Bounds2i, Point2f, Point2i, Vector2i, XYEnum};
use crate::core::lowdiscrepancy::{
compute_radical_inverse_permutations, inverse_radical_inverse, radical_inverse,
scrambled_r... |
//! Access to Zebra chain tip information.
//!
//! Zebra has 3 different interfaces for access to chain tip information:
//! * [zebra_state::Request](crate::request): [tower::Service] requests about chain state,
//! * [LatestChainTip] for efficient access to the current best tip, and
//! * [ChainTipChange] to `await` s... |
pub mod graphics;
pub mod engine;
use graphics::{Transform, draw_text};
use macroquad::{prelude::{Texture2D, rand, Rect, screen_width, screen_height, Color, Vec2, BLACK, draw_rectangle, vec2, next_frame, KeyCode}, miniquad::date, camera::{set_camera, set_default_camera, Camera2D}, rand::srand};
#[derive(Debug)]
pub en... |
// 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.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according ... |
use arraydeque::ArrayDeque;
use arrayvec::ArrayVec;
use thiserror::Error;
use crate::token::{self, KeywordClass, Token};
use crate::Span;
mod parse;
use self::parse::parse_token;
const MODE_STACK_CAPACITY: usize = 256;
const INDENT_STACK_CAPACITY: usize = 32;
const DELAY_QUEUE_CAPACITY: usize = 32;
/// Block-level... |
use ark_ff::{fields, PrimeField, Zero};
use ark_poly::{polynomial::univariate::DensePolynomial, UVPolynomial};
use ark_poly::{EvaluationDomain, Evaluations as EvaluationsOnDomain, GeneralEvaluationDomain};
use ark_std::{cfg_into_iter, cfg_iter, cfg_iter_mut};
use rand::RngCore;
use zkp_r1cs::{ConstraintSynthesizer, Syn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.