text stringlengths 9.08k 47.9k |
|---|
#![feature(proc_macro_hygiene, decl_macro)]
#![feature(plugin)]
#![feature(type_ascription)]
///
/// A werserver connecting the search engine
/// The api is a horrible mess, don't use it.
///
#[macro_use]
extern crate rocket;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate serde_derive;
#[macro_use]
... |
#![warn(missing_docs)]
#![deny(missing_debug_implementations)]
#![deny(unsafe_code)]
//! This is a crate that allows one to easily use a basic form of curses. It is
//! based upon [pancurses](https://docs.rs/crate/pancurses) and so it's cross
//! platform between windows and unix. It exposes a simplified view of curse... |
use core::mem::ManuallyDrop;
use counters::flavors::{Counter, CounterType};
use counters::Counters;
use crossbeam_queue::ArrayQueue;
use fwd::ZERO_IP;
use std::alloc::alloc;
use std::alloc::Layout;
use std::cmp::min;
use std::collections::VecDeque;
use std::mem;
use std::net::Ipv4Addr;
use std::ops::{Deref, DerefMut};
... |
/*
* Copyright 2019 <NAME>. <<EMAIL>>
*
* 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 agre... |
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the THIRD-PARTY file.
use libc::{c_char, c_... |
#![cfg_attr(not(feature = "std"), no_std)]
/// runtime module implementing Substrate side of PolkadaiBridge token exchange bridge
/// You can use mint to create tokens backed by locked funds on Ethereum side
/// and transfer tokens on substrate side freely
///
/// BUGS:
/// 1. Tests can fail with assert_noop! bug: ... |
use crate::{
ddval::DDValue,
profile::{get_prof_context, with_prof_context, ProfMsg},
program::{
arrange::ArrangementFlavor, RecursiveRelation, RelId, Relation, TKeyAgent, TValAgent,
Weight,
},
program::{
arrange::{Arrangement, Arrangements},
config::{Config, Profilin... |
//! This module generates AST datatype used by rust-analyzer.
//!
//! Specifically, it generates the `SyntaxKind` enum and a number of newtype
//! wrappers around `SyntaxNode` which implement `syntax::AstNode`.
use std::{
collections::{BTreeSet, HashSet},
fmt::Write,
};
use itertools::Itertools;
use proc_macr... |
//! Clients for high level interactions with TUF repositories.
//!
//! # Example
//!
//! ```no_run
//! #![feature(async_await, futures_api)]
//! # use futures::executor::block_on;
//! # use hyper::client::Client as HttpClient;
//! # use std::path::PathBuf;
//! # use std::str::FromStr;
//! # use tuf::{Result, Tuf};
//! ... |
// 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 in the LICENSE-APACHE file or at:
// https://www.apache.org/licenses/LICENSE-2.0
use crate::make_layout;
use proc_macro2::{Span, TokenStream... |
use super::memory::registers as memreg;
use super::memory::Memory;
use flagset::{flags, FlagSet};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PPUMode {
HBlank,
VBlank,
OAMSearch,
Rendering,
}
impl PPUMode {
#[inline]
pub fn into_stat_flag(self) -> memreg::StatFlag {
match sel... |
// Copyright 2019 The vault713 Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or a... |
pub use super::listeners::*;
use backend::*;
use backend::errors::*;
use backend::for_context::ForContext;
use codeviz::java::*;
use naming::{self, FromNaming};
use options::Options;
use std::fs::File;
use std::fs;
use std::io::Write;
use std::path::PathBuf;
use super::models as m;
const JAVA_CONTEXT: &str = "java";
... |
use std::{
convert::TryInto,
ffi::OsStr,
fs, io,
io::{BufRead, BufReader, Read, Write},
path::{Path, PathBuf},
time::{Duration, SystemTime},
};
use chrono::{offset::Utc, DateTime};
use crypto::digest::Digest;
use crypto::sha1::Sha1;
use ureq::Agent;
use url::Url;
use super::constants::{PACK_EX... |
// PNG Pong
//
// Copyright © 2019-2020 <NAME>
// Copyright © 2014-2017 <NAME>
// Copyright © 2005-2016 <NAME>
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// https://apache.org/licenses/LICENSE-2.0>, or the Zlib License, <LICENSE-ZLIB
// or http://opensource.org/licenses/Zlib>, at your opti... |
use crate::world::Item;
use crate::world::MissionState;
use crate::world::MobKind;
use crate::world::PLAYER_MAX_HEALTH;
use crate::world::{Offset, Pos, TileKind};
use bracket_lib::prelude::*;
use rand::rngs::SmallRng;
use rand::seq::SliceRandom;
use rand::Rng;
use rand::SeedableRng;
use std::collections::HashSet;
use t... |
use std::io::{Read, Seek, SeekFrom, Result, Write, copy};
use std::collections::HashMap;
use std::marker::PhantomData;
use std::mem::size_of;
use std::str::{self, FromStr};
use std::fmt;
use bytemuck::{Pod, Zeroable};
use enumflags2::{bitflags, BitFlags, BitFlag};
use crate::bin::{self, DataSource, Fixed, Positioned, ... |
// planeshift/src/lib.rs
//
// Copyright © 2018 The Pathfinder Project 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 cop... |
// TODO later: dont depend on sdl2 in the core crate (process events with something else?)
use sdl2::keyboard::{Keycode, Mod};
use crate::cpu::{CPU, R, FLAG_ZF};
use crate::memory::MMU;
use crate::machine::Component;
const DEBUG_KEYBOARD: bool = false;
#[cfg(test)]
#[path = "./keyboard_test.rs"]
mod keyboard_test;
... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control Register"]
pub cr: CR,
#[doc = "0x04 - Clock Mode Register"]
pub cmr: CMR,
_reserved2: [u8; 8usize],
#[doc = "0x10 - Receive Clock Mode Register"]
pub rcmr: RCMR,
#[doc = "0x14 - Receive Frame Mode R... |
use super::*;
/// The various named pixel formats that SDL2 supports.
///
/// There's various checks you can perform on each pixel format.
///
/// Note that the "fourcc" formats, anything that gives `true` from the
/// [is_fourcc](PixelFormatEnum::is_fourcc) method, are industry specified special
/// values, and do no... |
use crate::FieldBytes;
use elliptic_curve::{
subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption},
zeroize::Zeroize,
};
#[derive(Clone, Copy, Debug)]
pub struct FieldElement10x26(pub(crate) [u32; 10]);
impl FieldElement10x26 {
pub const fn zero() -> Self {
Self([0, 0, 0, 0, 0, 0, 0,... |
use crate::normalize_deep::DeepNormalizer;
use crate::slg::{self, ResolventOps, TruncatingInferenceTable};
use crate::{ExClause, Literal, TimeStamp};
use chalk_ir::fold::shift::Shift;
use chalk_ir::fold::Fold;
use chalk_ir::interner::{HasInterner, Interner};
use chalk_ir::zip::{Zip, Zipper};
use chalk_ir::*;
use chalk_... |
use yaxpeax_arch::Arch;
use std::collections::{HashMap, HashSet, VecDeque};
use std::hash::Hash;
use std::cmp::Eq;
use petgraph::graphmap::GraphMap;
use petgraph;
use petgraph::visit::Bfs;
use std::cell::RefCell;
use std::rc::Rc;
use std::fmt::Debug;
use analyses::control_flow::{BasicBlock, ControlFlowGraph};
use m... |
use bytemuck::{Pod, Zeroable};
use legion::prelude::*;
use nalgebra_glm::{Vec3, Vec4};
use std::sync::Arc;
use super::{BindGroup, GPUResourceManager, RenderTarget};
use crate::{
graphics::{pipeline_manager::PipelineManager, RenderGraph},
scene::components::CameraData,
AssetManager,
};
//use crate::graphics... |
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
use keys::origin_key;
use std::cmp::Ordering::*;
use std::fmt::{self, Debug, Display};
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
use std::sync::{Arc, Mutex};
use txn_types::Key;
use engine_rocks::RocksEngine;
use engine_traits::{CfName... |
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// 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 ... |
pub mod pddl;
pub mod sexpr;
use crate::chronicles::*;
use crate::classical::state::{SvId, World};
use crate::parsing::pddl::{PddlFeature, TypedSymbol};
use crate::chronicles::constraints::Constraint;
use crate::parsing::sexpr::SExpr;
use anyhow::*;
use aries_model::bounds::Bound;
use aries_model::lang::*;
use aries_... |
//! This service keeps track of which shard subnet the beacon node should be subscribed to at any
//! given time. It schedules subscriptions to shard subnets, requests peer discoveries and
//! determines whether attestations should be aggregated and/or passed to the beacon node.
use super::SubnetServiceMessage;
use st... |
use std::ops::{Add, Sub, Div, Mul};
use bindings::{AsNative, FromNative, ffi};
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
pub struct Color {
pub r: u8,
pub g: u8,
pub b: u8,
}
impl AsNative<ffi::TCOD_color_t> for Colo... |
/*!
The fuzzcheck_traits crate defines the `Mutator` and `Serializer` traits
used by all fuzzcheck-related crates.
*/
use crate::fuzzer::PoolStorageIndex;
use fuzzcheck_common::FuzzerEvent;
use std::fmt::Display;
use std::path::PathBuf;
/**
A [`Mutator`] is an object capable of generating/mutating a value for the pu... |
// A simple type checker for better diagnostics.
// (Z3 and the Z3 crate will also type-check, but their type errors are uninformative panics)
use crate::ast::{
BinaryOp, BindX, Binder, BinderX, Binders, Constant, Decl, DeclX, Expr, ExprX, Ident, MultiOp,
Query, QueryX, Stmt, StmtX, Typ, TypX, TypeError, Typs,... |
use rand_os::rand_core::RngCore;
use secret_integers::*;
use sha3::digest::{ExtendableOutput, Input, XofReader};
use sha3::{Digest, Sha3_256, Sha3_512};
use crate::params::*;
use crate::poly::Poly;
use crate::*;
pub(crate) trait Vector<I: SaberImpl>: Clone + Default + Sized {
#[must_use]
fn polys(&self) -> &[... |
use {
std::{
ptr,
time::Instant,
collections::HashMap,
os::raw::{c_void}
},
makepad_shader_compiler::makepad_math::{
Vec2,
},
crate::{
platform::{
apple::frameworks::*,
cocoa_delegate::*,
cocoa_window::CocoaWindow,
... |
use std::{collections::BTreeMap, env::current_dir, fs, path::PathBuf, sync::Arc};
use anyhow::*;
use cgmath::{MetricSpace, Vector2};
use corrode::{
api::{remove_physics_entity, EngineApi},
physics::PhysicsWorld,
time::PerformanceTimer,
};
use hecs::{Entity, World};
use rapier2d::prelude::*;
use rayon::{
... |
//-
// Copyright (c) 2017 <NAME>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHO... |
pub extern crate pulldown_cmark;
pub extern crate serde_yaml;
#[macro_use]
extern crate lazy_static;
mod context;
mod frontmatter;
mod references;
mod walker;
pub use context::Context;
pub use frontmatter::{Frontmatter, FrontmatterStrategy};
pub use walker::{vault_contents, WalkOptions};
use frontmatter::{frontmatt... |
//! Texture is an image that used to fill faces to add details to them.
//!
//! In most cases textures are just 2D images, however there are some exclusions to that -
//! for example cube maps, that may be used for environment mapping. rg3d supports 1D, 2D,
//! 3D and Cube textures.
//!
//! ## Supported formats
//!
//!... |
// SPDX-License-Identifier: Apache-2.0
//! syscall interface layer between assembler and rust
use crate::addr::{HostVirtAddr, ShimPhysUnencryptedAddr};
use crate::eprintln;
use crate::frame_allocator::FRAME_ALLOCATOR;
use crate::hostcall::{self, shim_write_all, HostFd, HOST_CALL};
use crate::paging::SHIM_PAGETABLE;
u... |
// Copyright 2022 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::{
path_to_string::PathToStringExt, CreationManifest, MetaPackage, PackageManifest, RelativeTo,
},
anyhow::{anyhow, bail, e... |
use {
crate::{
error::MetaplexError,
state::{
AuctionManager, AuctionManagerStatus, BidRedemptionTicket, Key,
OriginalAuthorityLookup, Store, WhitelistedCreator, WinningConfigItem,
MAX_BID_REDEMPTION_TICKET_SIZE, PREFIX,
},
},
arrayref::array_ref,
... |
//! # Elefren: API Wrapper around the Mastodon API.
//!
//! Most of the api is documented on [Mastodon's
//! github](https://github.com/tootsuite/mastodon/blob/master/docs/Using-the-API/API.md#tag)
//!
//! ```no_run
//! # extern crate elefren;
//! # fn main() {
//! # try().unwrap();
//! # }
//! # fn try() -> elefren... |
use std::{
fmt::{self, Debug, Display, Formatter},
net::SocketAddr,
sync::Arc,
};
use casper_types::{AsymmetricType, ProtocolVersion, PublicKey, SecretKey, Signature};
use datasize::DataSize;
use serde::{
de::{DeserializeOwned, Error as SerdeError},
Deserialize, Deserializer, Serialize, Serializer,... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - DMA_IntStatus."]
pub dma_int_status: crate::Reg<dma_int_status::DMA_INTSTATUS_SPEC>,
#[doc = "0x04 - DMA_IntTCStatus."]
pub dma_int_tcstatus: crate::Reg<dma_int_tcstatus::DMA_INTTCSTATUS_SPEC>,
#[doc = "0x08 - DMA_IntTC... |
#[cfg(feature = "image")]
extern crate image;
#[cfg(feature = "glium_backend")]
#[macro_use]
extern crate glium;
extern crate euclid;
extern crate time;
use euclid::{point2, rect, vec2, Point2D, Rect, Size2D, Vector2D};
use std::collections::HashMap;
use std::iter;
use std::mem;
mod atlas;
pub use atlas::Atlas;
mo... |
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
// A macOS application bundle package is laid out like:
//
// foobar.app # Actually a directory
// Contents # A further subdirectory
// Info.plist # An xm... |
//! The file module
//!
//! Here we define file structures and methods. It is implemented using [`tokio`] so we don't block
//! progress output during the process.
use std::env::temp_dir;
use std::ffi::OsStr;
use std::fs::{self, write};
use std::io::{BufReader, Read, Seek, Write};
use std::path::{Path, PathBuf};
use s... |
//! Import and export functionality for MMB binary proof format
//!
//! See [`mm0-c/verifier.c`] for information on the MMB format.
//!
//! [`mm0-c/verifier.c`]: https://github.com/digama0/mm0/blob/master/mm0-c/verifier.c
use std::convert::TryFrom;
use crate::elab::environment::{SortID, TermID, ThmID, Modifiers};
use ... |
use petgraph::{algo::dijkstra, graph::NodeIndex, Graph, Undirected};
use std::collections::HashMap;
struct Orbits<'a> {
nodes: HashMap<&'a str, NodeIndex>,
orbits: Graph<&'a str, (), Undirected>,
}
impl<'a> Orbits<'a> {
fn from_input(input: &'a str) -> Self {
let mut nodes = HashMap::new();
... |
// MOI command-line interface
#[macro_use] extern crate json;
extern crate mosquitto_client;
extern crate lapp;
extern crate toml;
extern crate md5;
extern crate libc;
extern crate ansi_term;
#[macro_use] extern crate log;
// our own common crate (shared with daemon)
#[macro_use]
extern crate moi;
mod strutil;
mod que... |
//! Healer fuzz
#[macro_use]
pub mod fuzzer_log;
pub mod arch;
pub mod config;
pub mod crash;
pub mod feedback;
pub mod fuzzer;
pub mod stats;
pub mod util;
use crate::{
config::Config,
crash::CrashManager,
feedback::Feedback,
fuzzer::{Fuzzer, SharedState, HISTORY_CAPACITY},
stats::Stats,
util... |
use full_moon::{ast::punctuated::Pair, ast::*, tokenizer::*, visitors::Visitor};
use convert_case::{Case, Casing};
use std::fs;
/// Holds an entry in a table
#[derive(Debug, Default)]
pub struct TableEntry {
/// Name of the entry
pub name: String,
/// String data if ("" if no string data)
pub str_data:... |
// Copyright 2022 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 2019-2020 <NAME>, <NAME>. All Rights Reserved.
//
// 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 ... |
#![feature(alloc_error_handler)]
#![cfg_attr(not(test), no_std)]
#![cfg_attr(not(test), no_main)]
extern crate alloc;
mod heap;
mod msg;
mod rsa;
mod uart;
use rand::Rng;
use rand_core::SeedableRng;
use rand_hc::Hc128Rng;
use riscv::asm;
use riscv::interrupt;
use riscv_rt::entry;
use core::alloc::Layout;
use core::... |
use crate::configuration::{Configuration, Cors, ListenAddr};
use crate::get_dispatcher;
use crate::http_server_factory::{HttpServerFactory, HttpServerHandle, Listener};
use crate::FederatedServerError;
use apollo_router_core::http_compat::{Request, Response};
use apollo_router_core::prelude::*;
use apollo_router_core::... |
use std::vec::Vec;
use gameboy::Gameboy;
use gameboy::cpu::registers::{ Registers, Register, RegisterPair };
use gameboy::mmu::Mmu;
use gameboy::assembly;
use gameboy::ppu::Bitmap;
use gameboy::cartridge::Cartridge;
use gameboy::ppu::PPU;
type BreakpointCallback = FnMut(Breakpoint) + Send;
#[derive(Copy, Clone, Debu... |
use core::{
alloc::Layout,
cell::RefCell,
sync::atomic::{AtomicI32, AtomicU32, AtomicU64, Ordering},
};
use alloc::{boxed::Box, sync::Arc};
use twizzler_abi::{
aux::{AuxEntry, KernelInitInfo, KernelInitName},
object::ObjID,
syscall::{ThreadSpawnArgs, ThreadSpawnError},
upcall::UpcallInfo,
}... |
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MI... |
use std::collections::BTreeMap;
use std::fmt;
use std::io::{Error, ErrorKind};
use std::path::{Path, PathBuf};
use std::sync::atomic::Ordering;
use std::sync::Arc;
use anyhow::Context;
use futures::channel::oneshot;
use futures::future::{BoxFuture, FutureExt, Shared, TryFutureExt};
use parking_lot::Mutex;
use sentry::... |
#![deny(warnings)]
#![cfg_attr(test, deny(warnings))]
//! A small library for reading and writing BMP images.
//!
//! The library supports uncompressed BMP Version 3 images.
//! The different decoding and encoding schemes is shown in the table below.
//!
//! |Scheme | Decoding | Encoding | Compression |
//! |-------|-... |
// Copyright 2017 The xi-editor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
use std::marker::PhantomData;
use bellperson::gadgets::num;
use bellperson::{Circuit, ConstraintSystem, SynthesisError};
use fil_sapling_crypto::jubjub::JubjubEngine;
use paired::bls12_381::{Bls12, Fr};
use crate::circuit::por::PoRCompound;
use crate::circuit::{
constraint,
stacked::{
hash::hash3,
... |
//! Module for configuring the cache system.
use super::worker;
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use core::time::Duration;
use directories::ProjectDirs;
use lazy_static::lazy_static;
use log::{debug, error, trace, warn};
use serde::{
de::{self, Deserializer},
Deserialize,
};
use spin... |
//! Reactor used to join the network.
mod memory_metrics;
use std::{
collections::BTreeMap,
env,
fmt::{self, Display, Formatter},
};
use datasize::DataSize;
use derive_more::From;
use prometheus::Registry;
use serde::Serialize;
use tracing::{error, info, warn};
use casper_types::{PublicKey, U512};
use ... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved_0_dll: [u8; 4usize],
_reserved_1_dlm: [u8; 4usize],
_reserved_2_fcr: [u8; 4usize],
#[doc = "0x0c - Line Control Register. Contains controls for frame formatting and break generation."]
pub lcr: LCR,
_reserved4: [u8; 4usiz... |
use mm0_util::{SortId, TermId, ThmId};
use crate::{DeclKey, Environment};
fn mk_array<A, const N: usize>(mut f: impl FnMut(usize) -> A) -> [A; N] {
let mut i = 0_usize;
[(); N].map(|_| { let a = f(i); i += 1; a })
}
fn mk_remap<'a, A, const N: usize>(
arr: &'a [A; N],
mut f: impl FnMut(usize, &'a A) -> A
) -... |
use crate::ciphersuite::*;
use crate::codec::*;
use crate::config::Config;
use crate::credentials::*;
use crate::key_packages::*;
use crate::messages::proposals::*;
// Tree modules
pub(crate) mod codec;
pub mod errors;
pub(crate) mod hashes;
pub mod index;
pub mod node;
pub(crate) mod path_keys;
pub(crate) mod private... |
use crate::auth::default_token_issuer::DefaultTokenIssuer;
use crate::errors::{ApiError, ApplicationError};
use crate::SITE_NAME;
use chrono::Duration;
use db::models::{EmailProvider, Environment};
use db::utils::errors::EnumParseError;
use dotenv::dotenv;
use itertools::Itertools;
use std::env;
use std::fmt;
use std::... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Activate QSPI interface"]
pub tasks_activate: TASKS_ACTIVATE,
#[doc = "0x04 - Start transfer from external flash memory to internal RAM"]
pub tasks_readstart: TASKS_READSTART,
#[doc = "0x08 - Start transfer from interna... |
//
// Author: <NAME>
//
use sdl2::render::{Canvas, Texture, TextureAccess};
use sdl2::Sdl;
/// Emulated screen width in pixels
const SCREEN_WIDTH: usize = 256;
/// Emulated screen height in pixels
const SCREEN_HEIGHT: usize = 240;
/// Screen texture size in bytes
const SCREEN_SIZE: usize = SCREEN_WIDTH * SCREEN_HEIGH... |
//! Creation and manipulation of composition graphs. This implements routines for creating and
//! optimising such graphs, in preparation for performing tree search.
mod falseness;
pub mod optimise;
use std::{
cmp::{Ordering, Reverse},
collections::{BinaryHeap, HashMap, HashSet},
ops::Index,
sync::Mu... |
use std::{
collections::HashMap,
ops::Deref,
path::{Path, PathBuf},
time::SystemTime,
};
use crossbeam_channel::Sender;
use notify::DebouncedEvent;
use serde_json::Value;
use sled::{
transaction::{self, TransactionError, Transactional},
Batch, Db, IVec, Tree,
};
use crate::{
audio_folder::... |
//! ress
//! A crate for parsing raw JS into a token stream
//!
//! The primary interfaces are the function [`tokenize`][tokenize] and
//! the struct [`Scanner`][scanner]. The [`Scanner`][scanner] struct impls [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html)
//! and the [`tokenize`][tokenize] functi... |
/*!
This library provides the floating-bar type, which allows for efficient
representation of rational numbers without loss of precision. It is based on
[<NAME>'s blog post exploring the concept](http://www.iquilezles.org/www/articles/floatingbar/floatingbar.htm).
```rust
use floating_bar::r32;
let fullscreen = r32!(... |
use crate::allocator::*;
use crate::arena::*;
use crate::atom_table::*;
use crate::debray_allocator::*;
use crate::forms::*;
use crate::instructions::*;
use crate::iterators::*;
use crate::targets::QueryInstruction;
use crate::types::*;
use crate::parser::ast::*;
use crate::parser::rug::ops::PowAssign;
use crate::pars... |
use crate::{
COLUMN_BLOCK_BODY, COLUMN_BLOCK_EPOCH, COLUMN_BLOCK_EXT, COLUMN_BLOCK_HEADER,
COLUMN_BLOCK_PROPOSAL_IDS, COLUMN_BLOCK_UNCLE, COLUMN_CELL_META, COLUMN_CELL_SET, COLUMN_EPOCH,
COLUMN_INDEX, COLUMN_META, COLUMN_TRANSACTION_INFO, COLUMN_UNCLES,
};
use ckb_chain_spec::consensus::Consensus;
use ckb_c... |
//! 2D convolution layer
use arrayfire::*;
use std::convert::{TryFrom};
use std::fmt;
use crate::activations::*;
use crate::errors::Error;
use crate::initializers::*;
use crate::regularizers::*;
use crate::tensor::*;
use super::Layer;
/// Defines the type of padding applied to the inputs.
///
/// * Same: a same convo... |
/*
* Queries that get information from blockchain data.
*
*/
pub mod smart_contracts;
use smart_contracts::objects::meta::api::data::endpoints::{get_terra_lcd, get_terra_fcd};
use smart_contracts::objects::*;
use serde_json::Value;
use core::str::FromStr;
use smart_contracts::objects::meta::api::{
query_api... |
/// A runtime module template with necessary imports
/// Feel free to remove or edit this file as needed.
/// If you change the name of this file, make sure to update its references in runtime/src/lib.rs
/// If you remove this file, you can remove those references
/// For more guidance on Substrate modules, see the ... |
// This file is part of Substrate.
// Copyright (C) 2019-2020 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... |
#[macro_use]
extern crate log;
use std::collections::hash_map::Entry;
use std::collections::{HashMap, HashSet};
use std::rc::Rc;
use serde::{Deserialize, Serialize};
pub mod app;
pub mod cmd;
pub mod config;
mod keys;
pub mod layout;
mod navigation;
mod screen;
mod viewport;
mod x;
use crate::x::{Crtc, CrtcChange, ... |
//! This crate provides basic functionality to find likely positions of a subimage within a larger
//! image by calculating an image distance. It has a naive scalar implementation in rust, and a simd
//! implementation that selects the best implementation based on cpu features at runtime in rust
//! using the [simdeez]... |
use crate::lang::argument::{column_names, Argument};
use crate::lang::command::CrushCommand;
use crate::lang::command::OutputType::*;
use crate::lang::data::dict::Dict;
use crate::lang::errors::{argument_error_legacy, data_error, eof_error, error, mandate, to_crush_error, CrushResult};
use crate::lang::execution_contex... |
use std::{
array::TryFromSliceError,
borrow::Borrow,
collections::BTreeSet,
convert::TryInto,
fs,
io::Error as IoError,
path::{Path, PathBuf},
sync::Arc,
};
use bincode::config::{BigEndian, DefaultOptions, Options as _, WithOtherEndian};
use derive_more::{AsRef, Deref};
use lazy_static:... |
extern crate cc;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;
pub fn source_dir() -> PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR")).join("openssl")
}
pub fn version() -> &'static str {
env!("CARGO_PKG_VERSION")
}
pub struct Build {
out_dir: Option<PathBuf>,
... |
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-BSD-3-Clause file.
//
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-... |
use std::*;
use collections::HashMap;
use convert::TryInto;
use cmp::max;
use ops::RangeInclusive;
use cell::Cell;
use crate::config::CompilerOptions;
use crate::tokenizer::token;
use token::*;
use crate::parser;
use parser::{ScopeTable, MultiMap};
use parser::analyzer::*;
use parser::ast;
use ast::flat_ast::*;
use as... |
// Copyright 2015 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
use crate::linker::Definition;
use crate::store::{InstanceId, StoreOpaque, Stored};
use crate::types::matching;
use crate::{
AsContextMut, Engine, Export, Extern, Func, Global, Memory, Module, StoreContextMut, Table,
Trap, TypedFunc,
};
use anyhow::{anyhow, bail, Context, Error, Result};
use std::mem;
use std::... |
// Copyright 2019 The n-sql Project 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
// ex... |
// Copyright 2019 Zhizhesihai (Beijing) Technology Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by a... |
// Copyright 2017 Databricks, 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 agreed to in writi... |
//!
//! # Gds21 Byte-Encoding and Writing
//!
// Local imports
use super::*;
/// Gds Writing Helper
pub struct GdsWriter<'wr> {
/// Write Destination
dest: Box<dyn Write + 'wr>,
}
impl<'wr> GdsWriter<'wr> {
/// Create new [GdsWriter] with destination file `fname`
pub fn open(fname: impl AsRef<Path>) -... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Configuration Register"]
pub cfg: CFG,
#[doc = "0x04 - Payload Data Length"]
pub datalen: DATALEN,
#[doc = "0x08 - Authentication Data Length"]
pub prefixlen: PREFIXLEN,
#[doc = "0x0c - Interrupt Enable Register... |
use super::{
draw::DrawUniforms,
gpu::{
arc::{ArcBindGroup, ArcBuffer, ArcRenderPipeline, ArcShaderModule},
bind_group::{BindGroupBuilder, BindGroupCache},
growing::GrowingBufferArena,
pipeline::PipelineCache,
text::TextRenderer,
},
image::{Image, ImageFormat},
... |
use algebra::bytes::{FromBytes, ToBytes};
use algebra::{to_bytes, PrimeField};
use crate::Error;
use algebra::UniformRand;
use rand::Rng;
use std::marker::PhantomData;
use crypto_primitives::{CommitmentScheme, FixedLengthCRH, NIZK, PRF, merkle_tree::*};
use crypto_primitives::{CommitmentGadget, FixedLengthCRHGadget, N... |
// 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 ... |
//! Peripheral Reset and Enable Control (REC)
//!
//! This module contains safe accessors to the RCC functionality for each
//! peripheral.
//!
//! At a minimum each peripheral implements
//! [ResetEnable](trait.ResetEnable.html). Peripherals that have an
//! individual clock multiplexer in the PKSU also have methods
/... |
#[cfg(feature = "fresh")]
extern crate bindgen;
use std::env;
#[cfg(feature = "fresh")]
use std::fs;
use std::path::{PathBuf};
#[cfg(all(
not(feature = "fresh"),
not(any(
feature = "cuda_6_5",
feature = "cuda_7_0",
feature = "cuda_7_5",
feature = "cuda_8_0",
feature = "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.