text stringlengths 9.08k 47.9k |
|---|
/**
* Module : nais.rs
* Copyright : 2021 PAB
* License : MIT
* Maintainer : shiyong <<EMAIL>>
* Stability : Experimental
* Description:
*/
mod inter_call;
use ic_cdk::{storage, trap};
use candid::{CandidType, Principal, candid_method, encode_args};
use ic_cdk::api::{caller, id};
use ic_cdk::ap... |
use log::*;
use crate::util::arm::*;
use crate::util::bit::{combine64, split64, BitUtilExt};
use crate::exception::Exception;
use crate::mode::Mode;
use crate::reg::{self, cpsr, Reg};
use crate::{Cpu, Memory};
#[derive(Clone, Copy, PartialEq, Debug)]
enum Instruction {
BranchEx, // Branch and exchange (i.e. swit... |
//! Interface for accesing the lib in WebAssembly.
//! The Javascript name (js_name) have been chosen with <NAME>
use std::collections::HashMap;
extern crate cdshealpix;
extern crate wasm_bindgen;
// see https://rustwasm.github.io/wasm-bindgen/
use wasm_bindgen::prelude::*;
use cdshealpix::nested::{hash, center, ne... |
use euclid::Point2D;
use glium::implement_vertex;
use glium::vertex::{Attribute as GLAttribute, AttributeType as GLAttributeType};
use crate::geometry::Line as GLine;
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Vf2(pub f32, pub f32);
impl Vf2 {
pub const fn new(x: f32, y: f32) -> Vf2 {
... |
use web_sys::console;
use wasm_bindgen::JsValue;
// use image::dxt::{DXTEncoder, DXTVariant};
use std::cmp;
// use std::fmt;
use std::io::{BufWriter, Write};
struct BmdHeader {
num_frames: usize,
num_pixels: usize,
num_rows: usize,
}
#[derive(Copy, Clone, Debug)]
struct BmdFrameInfo {
frame_type: u32,
dx: ... |
#![allow(non_snake_case)] // sorry, need this because this is a rewrite of existing Java code
#![allow(non_upper_case_globals)]
/*!
Implement sets of fields using 64-bit integers
*/
use std::fmt::Formatter;
use std::fmt::{Debug, Display};
use std::iter::FromIterator;
use std::ops::Add;
use std::ops::Mul;
use std::... |
use crate::riichi::hand::Hand;
use crate::riichi::riichi_error::RiichiError;
use crate::riichi::rules::Rules;
use crate::riichi::scores::Score;
use crate::riichi::shapes::{ClosedShape, Shape};
use crate::riichi::tile::Tile;
use crate::riichi::yaku::{Yaku, YakuFinder};
use serde_json::{Map, Value};
/// Representation o... |
pub(crate) mod sealed {
pub trait Instance: crate::rcc::sealed::RccPeripheral {
fn regs() -> crate::pac::fmc::Fmc;
}
}
pub trait Instance: sealed::Instance + 'static {}
pin_trait!(SDNWEPin, Instance);
pin_trait!(SDNCASPin, Instance);
pin_trait!(SDNRASPin, Instance);
pin_trait!(SDNE0Pin, Instance);
pi... |
use serde::{Serialize,Deserialize};
use ring::signature::{Ed25519KeyPair, Signature, KeyPair, VerificationAlgorithm, EdDSAParameters};
use crate::crypto::hash::{H256, Hashable, H160, Hashable_160};
use crate::network::message::{Message};
use crate::network::server::Handle as ServerHandle;
use crate::accumulator::Accumu... |
//! `UsbBus` implementation
use core::{
mem,
ptr::{self, NonNull},
slice,
sync::atomic::{self, Ordering},
};
use usb_device::{
bus::{PollResult, UsbBus},
endpoint::{EndpointAddress, EndpointType},
UsbDirection, UsbError,
};
use super::{
dqh::dQH,
token::{Status, Token},
util::... |
use futures::future::join_all;
use git_testament::{git_testament, render_testament};
use graph::{ipfs_client::IpfsClient, prometheus::Registry};
use lazy_static::lazy_static;
use std::io::{BufRead, BufReader};
use std::path::Path;
use std::str::FromStr;
use std::time::Duration;
use std::{collections::HashMap, env};
use... |
//! ECMAScript lexer.
//!
//! In future, this might use string directly.
#![allow(unused_mut)]
#![allow(unused_variables)]
pub use self::{
input::Input,
state::{TokenContext, TokenContexts},
};
use self::{state::State, util::*};
use crate::{
error::{Error, SyntaxError},
token::*,
Context, JscTarget... |
//! Run a GraphQL query and fetch all the entitied needed to build the
//! final result
use anyhow::{anyhow, Error};
use graph::constraint_violation;
use graph::data::value::Object;
use graph::prelude::{r, CacheWeight};
use graph::slog::warn;
use graph::util::cache_weight;
use lazy_static::lazy_static;
use std::collec... |
//! Container types
use std::fmt;
use uuid::Uuid;
use rustwlc::handle::{WlcView, WlcOutput};
use rustwlc::{Geometry, ResizeEdge, Point, Size,
VIEW_FULLSCREEN, VIEW_BIT_MODAL};
use ::render::{Renderable, Drawable};
use ::layout::commands::CommandResult;
use super::borders::{Borders, ViewDraw, ContainerD... |
//! Build runner, choosing and executing tasks as determined by out of date inputs.
use crate::db;
use crate::densemap::DenseMap;
use crate::graph::*;
use crate::progress;
use crate::progress::Progress;
use crate::task;
use crate::trace;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::time::Dur... |
//! Implementation of a standard Riscv64 ABI.
use core::panic;
use crate::ir;
use crate::ir::types::*;
use crate::ir::AbiParam;
use crate::ir::ExternalName;
use crate::ir::MemFlags;
use crate::isa;
use crate::isa::riscv64::{inst::EmitState, inst::*};
use crate::isa::CallConv;
use crate::machinst::*;
use crate::mac... |
//! # MNT token Module
//!
//! Provides functionality for minting MNT tokens.
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::unused_unit)]
use frame_support::{pallet_prelude::*, sp_std::cmp::Ordering, transactional};
use frame_system::pallet_prelude::*;
use liquidity_pools::PoolData;
use minterest_primit... |
#![no_main]
#![no_std]
extern crate cortex_m;
extern crate cortex_m_rt;
extern crate embedded_hal;
extern crate panic_abort;
extern crate stm32f042_hal as hal;
extern crate numtoa;
use hal::i2c::*;
use hal::prelude::*;
use hal::stm32f042;
use embedded_hal::blocking::i2c::Write;
use numtoa::NumToA;
use cortex_m_r... |
use std::convert::TryFrom;
use std::convert::TryInto;
use std::fmt::{self, Debug, Display};
use std::iter;
use tract_nnef::internal::*;
use tract_ndarray::{
Array1, Array2, ArrayD, ArrayView1, ArrayView2, ArrayViewD, ArrayViewMut1, Axis, Ix1, Ix2,
};
use tract_num_traits::AsPrimitive;
macro_rules! ensure {
... |
//! Convert between characters and their standard names.
//!
//! This crate provides two functions for mapping from a `char` to the
//! name given by the Unicode standard (8.0). There are no runtime
//! requirements so this is usable with only `core` (this requires
//! specifying the `no_std` cargo feature). The tables... |
/*!
A reimplementation of Mark Rosenfelder's [pronunciation algorithm][spell] for English.
Mostly an example for rust-soundchange, but also serves as an approximate algorithm.
[spell]: http://zompist.com/spell.html
*/
#![feature(core)]
#[macro_use] extern crate soundchange;
#[macro_use] extern crate log;
use std::c... |
#[cfg(target_arch = "x86")]
use core::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::*;
use crate::guts::{
assemble_count, count_high, count_low, final_block, flag_word, input_debug_asserts, Finalize,
Job, Stride,
};
use crate::{Word, BLOCKBYTES, IV, SIGMA};
use arrayref::{array_refs, mut... |
// Copyright (c) 2018-2021 The MobileCoin Foundation
//! The TestClient supports two use-cases:
//! - End-to-end testing (used in continuous deployment)
//! - Fog canary (sends transactions in prod to alert if it fails, and collect
//! timings)
use crate::{counters, error::TestClientError};
use mc_account_keys::Sh... |
use log::{debug, error, info, trace};
use serde_json::json;
use std::collections::HashMap;
use std::io::Read;
mod runtime_error;
use crate::runtime_error::{as_str, Result, RuntimeError};
mod slack;
use crate::slack::{
add_reaction, channel_type, conversations_history, post_ephemeral_attachments, post_message,
... |
use std::{
cell::RefCell,
rc::Rc,
};
use crate::{
chunk::{Op, Chunk},
interner::StringInterner,
obj::{copy_string, Obj, ObjValue, Fun, FunKind},
parser::Parser,
scanner::{Token, TokenKind},
value::Value,
};
#[cfg(debug_assertions)]
use crate::debug;
#[derive(PartialEq, PartialOrd)]
enum Precedence {
... |
use crate::queue::FnOnceQueue;
use std::cmp::Ordering;
use std::collections::btree_map::Entry;
use std::collections::BTreeMap;
use std::mem;
use std::time::{Duration, Instant};
// TODO: Switch to N-ary Heap for storing (WrapTime, slot-index),
// e.g. Octonary heap, and use slots for normal timers as well as
// min/max... |
//! This interface defines an xdg_surface role which allows a surface to, among
//! other things, set window-like properties such as maximize, fullscreen, and
//! minimize, set application-specific metadata like title and id, and well as
//! trigger user interactive operations such as interactive resize and move.
//! u... |
//! Ingest handler
use crate::{
data::{IngesterData, IngesterQueryResponse, SequencerData},
lifecycle::{run_lifecycle_manager, LifecycleConfig, LifecycleManager},
partioning::DefaultPartitioner,
poison::PoisonCabinet,
querier_handler::prepare_data_to_querier,
stream_handler::{
sink_adap... |
#[cfg(feature = "debugger")]
pub mod disass;
pub mod exec;
use serde::{Deserialize, Serialize};
use super::alu::*;
use crate::arm7tdmi::{Addr, InstructionDecoder};
use crate::bit::BitIndex;
use crate::byteorder::{LittleEndian, ReadBytesExt};
use crate::num::FromPrimitive;
use std::io;
#[derive(Debug, PartialEq)]
p... |
#![feature(
drain_filter,
exact_size_is_empty,
option_expect_none,
duration_zero,
clamp
)]
use {
anyhow::*,
crossbeam_channel::{Receiver, Sender},
derivative::*,
hashbrown::HashMap,
nalgebra as na,
rlua::prelude::*,
serde::{Deserialize, Serialize},
smallvec::SmallVec... |
//! The toolbar widget
use druid::kurbo::{Affine, BezPath, Line, Shape, Vec2};
use druid::widget::prelude::*;
use druid::widget::{Painter, WidgetExt};
use druid::{Color, Data, HotKey, KeyEvent, Rect, SysMods, WidgetPod};
use crate::consts;
use crate::tools::ToolId;
const TOOLBAR_ITEM_SIZE: Size = Size::new(40.0, 40.... |
use super::*;
use crate::helpers::construction::clustering::vicinity::*;
use crate::helpers::models::problem::{get_job_id, SingleBuilder, TestTransportCost};
fn get_check_insertion_fn(disallow_insertion_list: Vec<&str>) -> Arc<CheckInsertionFn> {
let disallow_insertion_list = disallow_insertion_list.into_iter().ma... |
use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::ffi::OsStr;
use std::fmt;
use std::path::PathBuf;
use std::str::FromStr;
use rustc_data_structures::fx::FxHashMap;
use rustc_session::config::{self, parse_crate_types_from_list, parse_externs, CrateType};
use rustc_session::config::{
build_codegen... |
//! Inventory manager.
//! Takes care of sending and fetching inventories.
//!
//! ## Handling of reverted blocks
//!
//! When a block is reverted, the inventory manager is notified, via the
//! [`InventoryManager::block_reverted`] function. Since confirmed transactions are held
//! for some time in memory, the transac... |
//! Adaptation/port of [`SQLite` tokenizer](http://www.sqlite.org/src/artifact?ci=trunk&filename=src/tokenize.c)
use std::result::Result;
use memchr::memchr;
use phf;
mod error;
pub use scan::Splitter;
pub use sql::error::Error;
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum TokenType {
// Keywords:
Abort,... |
use {
crate::onefetch::{error::*, utils::num_to_color},
colored::Color,
regex::Regex,
serde::Serialize,
std::collections::HashMap,
std::env,
strum::{EnumIter, EnumString, IntoStaticStr},
};
pub struct Colors {
basic_colors: Vec<Color>,
true_colors: Option<Vec<Color>>,
}
macro_rules... |
// 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 {
anyhow::{format_err, Error},
fidl_fuchsia_bluetooth_bredr as bredr,
fidl_fuchsia_sys::ComponentControllerEvent,
fuchsia_bluetooth::{
... |
use super::openjpeg::*;
use ::libc;
extern "C" {
fn opj_malloc(size: size_t) -> *mut libc::c_void;
fn opj_calloc(numOfElements: size_t, sizeOfElements: size_t) -> *mut libc::c_void;
fn opj_realloc(m: *mut libc::c_void, s: size_t) -> *mut libc::c_void;
fn opj_free(m: *mut libc::c_void);
}
#[repr(C)]
#[deriv... |
// This file is part of Substrate.
// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the F... |
pub mod net;
pub mod proto;
use self::net::*;
use super::ConvergenceLayerAgent;
use async_trait::async_trait;
use bp7::{Bundle, ByteBuffer};
use futures::lock::Mutex;
//use futures_util::stream::StreamExt;
use log::{debug, error, info, warn};
use std::collections::HashMap;
use std::convert::TryFrom;
use std::net::Soc... |
// Copyright © 2020 <NAME>
//
// 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, merge, publish, distribu... |
use dates::Date;
use data::curves::RcRateCurve;
use data::curves::RateCurve;
use data::curves::RelativeBump;
use data::forward::log_discount_with_borrow;
use data::forward::discount_with_borrow;
use core::qm;
use std::sync::Arc;
use std::f64::NAN;
use std::ops::Deref;
use serde as sd;
/// A dividend is a corporate act... |
use super::super::*;
///Internet protocol headers version 4 & 6
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum IpHeader {
Version4(Ipv4Header, Ipv4Extensions),
Version6(Ipv6Header, Ipv6Extensions)
}
impl IpHeader {
/// Renamed to `IpHeader::from_slice`
#[deprecated(
since = "0.10.1",
... |
//! Traits and datastructures representing a collection trace.
//!
//! A collection trace is a set of updates of the form `(key, val, time, diff)`, which determine the contents
//! of a collection at given times by accumulating updates whose time field is less or equal to the target field.
//!
//! The `Trace` trait des... |
//
//! Copyright 2020 Alibaba Group Holding Limited.
//!
//! Licensed under the Apache License, Version 2.0 (the "License");
//! you may not use this file except in compliance with the License.
//! You may obtain a copy of the License at
//!
//! http://www.apache.org/licenses/LICENSE-2.0
//!
//! Unless required ... |
use std::fs::File;
use std::io::SeekFrom;
use std::io::Cursor;
use std::io::{Read, Seek, BufReader};
use std::io::SeekFrom::{Start,Current,};
use super::parser::Parser;
use super::fourcc::{FourCC, ReadFourCC, FMT__SIG, DATA_SIG, BEXT_SIG, LIST_SIG,
JUNK_SIG, FLLR_SIG, CUE__SIG, ADTL_SIG, AXML_SIG, IXML_SIG};
use... |
// Copyright 2019 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0
//! Module for error types
//!
//! This module provides the error reporting framework for the crate. Error provenience is marked
//! as a variant of an enum, distinguishing between errors coming from the TSS stack and those
//... |
use futures::{channel::mpsc, prelude::*, stream::iter, SinkExt};
use log::{debug, error, log_enabled, trace, warn};
use std::{
collections::HashMap,
io::{self, ErrorKind},
pin::Pin,
sync::{atomic::Ordering, Arc},
task::{Context, Poll},
time::Duration,
};
use tokio::io::{AsyncRead, AsyncWrite};
u... |
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode};
use escrow_contracts_wrapper::{
escrow_exec::{CallStamp, DeferredStorageWrite},
exec::{ExecError, ExecResult, ExecutionContext},
storage::write_contract_storage,
wasm::{
code_cache::load as load_code, // ToDo: Solve the typ... |
use crate::{
auth,
data::{current, previous},
error, Result,
};
use anyhow::{bail, Context};
use serde::{de::DeserializeOwned, Serialize};
use std::fs::{self, File};
use std::io::BufReader;
use std::path::{Path, PathBuf};
pub struct Db {
pub dirs: DbDirs,
pub users: Table<previous::User, current::U... |
use fxhash::FxHashMap;
use crate::rules::Color;
use crate::rules::pieces::PieceType;
use crate::rules::pieces::movement::{Move, SlideDirection, PawnMovement};
use crate::rules::pieces::{Piece, movement::CastleType};
use super::bitboards::{get_bit_for_square, set_bit_at_square, unset_bit_at_square, get_diagonal_bitboa... |
use std::collections::HashMap;
use std::ops::Neg;
use rtlola_frontend::ir::{
ArithLogOp, Constant, Expression, ExpressionKind, Offset, OutputStream, StreamReference, Trigger, Type,
};
use rtlola_frontend::RTLolaIR;
use z3::ast::{Ast, Bool, Int};
use z3::{Config, Context, Optimize, SatResult};
use crate::utils::{get... |
mod touch_state;
use crate::data::input::*;
use crate::{emath::*, util::History};
use std::collections::{BTreeMap, HashSet};
pub use crate::data::input::Key;
pub use touch_state::MultiTouchInfo;
use touch_state::TouchState;
/// If the pointer moves more than this, it won't become a click (but it is still a drag)
con... |
use crate::{
event,
event::{Event, LogEvent, Value},
shutdown::ShutdownSignal,
topology::config::{DataType, GlobalOptions, SourceConfig, SourceDescription},
};
use chrono::TimeZone;
use futures::{
compat::Future01CompatExt,
executor::block_on,
future::{select, Either, FutureExt, TryFutureExt... |
// 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::ast::{self, BanjoAst, Decl},
crate::backends::util::{to_c_name, ValuedAttributes},
crate::backends::Backend,
failure::{format_... |
use bit_util::*;
use super::*;
use super::reg::*;
use super::util::*;
use super::mode::Mode;
#[derive(Clone, Copy, PartialEq, Debug)]
enum Instruction {
BranchEx, // Branch and exchange (i.e. switch to THUMB)
Branch,
DataProc0,
DataProc1,
DataProc2,
PsrImm,
PsrReg,
Multiply,
MulLon... |
// Copyright 2021 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use crate::protocol::{FidlCompatible, FromFidlExt, IntoFidlExt};
use anyhow::Context;
use serde::{Deserialize, Serialize};
use serde_json;
use std::collect... |
#![warn(
clippy::all,
//clippy::restriction,
clippy::pedantic,
clippy::needless_pass_by_value,
clippy::unwrap_used,
clippy::clone_on_ref_ptr
)]
#![allow(
clippy::missing_errors_doc,
clippy::as_conversions,
clippy::clone_on_ref_ptr,
clippy::else_if_without_else,
clippy::implicit_return,
clippy::i... |
#![feature(derive_default_enum)]
use codec::{Decode, Encode,MaxEncodedLen};
use sp_runtime::traits::{AppendZerosInput, Saturating, StaticLookup, Zero};
use sp_runtime::RuntimeDebug;
use sp_std::prelude::*;
use sp_std::{fmt::Debug, iter::once, ops::Add};
use scale_info::TypeInfo;
pub type KYCIndex = u32;
pub type Curv... |
//! Intraprocedural step of the analysis.
use rustc::hir::def_id::DefId;
use rustc::mir::*;
use rustc::mir::tcx::PlaceTy;
use rustc::ty::{Ty, TyKind};
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_target::abi::VariantIdx;
use analysis::labeled_ty::{LabeledTy, LabeledTyCtxt};
use super::{Var, PermVar, L... |
use crate::nal::sei::HeaderType;
use crate::nal::sei::SeiMessage;
#[derive(Debug)]
pub enum ItuTT35Error {
NotEnoughData { expected: usize, actual: usize }
}
#[derive(Debug, PartialEq)]
pub enum ItuTT35 {
Japan,
Albania,
Algeria,
AmericanSamoa,
GermanyFederalRepublicOf(u8),
Anguilla,
A... |
extern crate actix_web;
extern crate clap;
#[macro_use] extern crate serde_derive;
#[macro_use] extern crate serde_json;
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate mysql;
extern crate time;
extern crate tokio;
extern crate uuid;
extern crate linereader;
extern crate tempdir;
extern crate regex;
u... |
mod effects;
pub mod formats;
#[macro_use]
mod forward;
use core::geometry::Position;
use core::geometry::M44;
use core::resource::ResourceLoader;
use std::clone::Clone;
use cgmath;
use frontend::render::forward::PrimitiveIndex;
use frontend::render::forward::Vertex;
use frontend::render::forward::VertexIndex;
use s... |
use crate::period::{PeriodDescr, PeriodIterator};
use crate::{EverUSDBalance, Expired, MIN_BOND_DURATION};
use frame_support::{
codec::{Decode, Encode, EncodeLike},
dispatch::{DispatchResult, Vec},
sp_runtime::{
traits::{AtLeast32Bit, SaturatedConversion, UniqueSaturatedInto},
RuntimeDebug,
... |
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused_parens)]
#![feature(lang_items)]
#![no_std]
#![no_main]
//use crate libc;
// no_std
#[lang = "panic_fmt"] extern fn panic_fmt() -> ! { let mut n = 0; loop { n += unsafe{ *(0 as *const c_int) };} }
#[no_mangle] pub fn rust_eh_register_frames (... |
type ImgFuture = mt::Future<mt::Then<mt::ReadFile, mt::Async<io::Result<img::Result<(img::Metadata, img::AnyImage)>>>>>;
//
// CUBEMAPS
//
fn create_1st_cube_map_tab() -> gx::Texture {
let levels = 1;
let level = 0;
let internal_format = gl::RGB8;
let format = gl::RGB;
let type_ = gl::UNSIGNED_BY... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
//! Implementation of an in-memory repository.
use std::{
borrow::Cow,
collections::VecDeque,
mem::size_of,
rc::Rc,
sync::{atomic::Ordering, Arc},
thread::JoinHandle,
};
#[cfg(test)]
use cr... |
use std::borrow::Cow;
use std::io;
use std::str::Utf8Error;
use crate::Variant;
use crate::decoding::from_utf8_slice;
use crate::decoding::from_utf8_vec;
use crate::encoding;
use crate::decoding;
use crate::Cesu8Error;
use crate::encoding::utf8err_inc;
#[cfg(test)] use crate::encoding::enc_surrogates;
#[cfg(test)] use... |
use crate::assembler::debug_model::DebugModel;
use crate::constants::code::RET;
use crate::constants::{get_addr_byte_offset, is_jump_op};
use crate::device::comm::Output;
use crate::device::internals::{Device, RunResult};
use crate::device::util::{convert_and_fit, fit_in_lines};
use crate::device::Dump;
use anyhow::Res... |
use std::collections::HashMap;
// todo: remove unused imports.
use sdl2;
use sdl2::pixels::Color;
use sdl2::rect::{Point, Rect};
use sdl2::render::{Canvas, Texture, TextureCreator};
use sdl2::video::{Window, WindowContext};
use crate::entity_manager::{Entity, EntityManager};
use crate::utils::{manhat_distance};
/... |
use super::super::world;
use crate::map::world::World;
use crate::tile::world::types as world_types;
use crate::tile::zone::types;
use crate::util;
use rand::distributions::WeightedIndex;
use rand::prelude::*;
use std::error::Error;
use std::fs::File;
use std::io::Write;
use std::path::Path;
#[derive(PartialEq, Debug)... |
// TODO: Clean up the HWND bullshit, somehow
#![feature(custom_derive)]
extern crate kernel32;
extern crate user32;
extern crate winapi;
extern crate time;
#[macro_use]
extern crate lazy_static;
extern crate rustc_serialize;
extern crate toml_config;
mod implying;
use implying::*;
mod wide;
use wide::ToWide;
use std:... |
// Copyright 2018 sqlparser-rs contributors. All rights reserved.
// Copyright Materialize, Inc. All rights reserved.
//
// This file is derived from the sqlparser-rs project, available at
// https://github.com/andygrove/sqlparser-rs. It was incorporated
// directly into Materialize on December 21, 2019.
//
// Licensed... |
//! ED25519 Signature Scheme
//!
//! # Examples
//!
//! Creating a signature, and verifying the signature:
//!
//! ```
//! use cryptoxide::ed25519;
//!
//! let message = "messages".as_bytes();
//! let secret_key = [0u8;32]; // private key only for example !
//! let (keypair, public) = ed25519::keypair(&secret_key);
//!... |
//! Load test for stand alone transport
//!
//! How this works:
//! - Client sends requests to the server. The request specifies a message size
//! - Server responds with a message of the requested size
//! This simulates the P2P chunk request/chunk response exchange
//!
//! Usage:
//! - This example runs the server... |
#[macro_use]
extern crate savefile_derive;
extern crate pancurses;
extern crate savefile;
extern crate snm_rand_utils;
mod block;
mod game;
mod leaderboard;
mod tests;
mod util;
use crate::block::*;
use crate::game::*;
use crate::leaderboard::*;
use crate::util::*;
use snm_rand_utils::range_rng::*;
use std::time;
co... |
use std::borrow::Cow;
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::convert::Infallible;
use std::future::Future;
use std::mem;
use std::pin::Pin;
use std::rc::Rc;
use std::str::FromStr;
use std::sync::Arc;
use std::sync::atomic::{Ordering, AtomicU64, AtomicI64};
use std::time::Duration;
us... |
// Copyright (c) 2015, The Radare Project. All rights reserved.
// See the COPYING file at the top-level directory of this distribution.
// Licensed under the BSD 3-Clause License:
// <http://opensource.org/licenses/BSD-3-Clause>
// This file may not be copied, modified, or distributed
// except according to those term... |
//! Direct memory access (DMA) controller
//!
//! Currently DMA is only supported for STM32F303 MCUs.
// To learn about most of the ideas implemented here, check out the DMA section
// of the Embedonomicon: https://docs.rust-embedded.org/embedonomicon/dma.html
use crate::{
pac::{self, dma1::ch::cr},
rcc::AHB,... |
use crate::scene::game::GameState;
use crate::tilemap::tile_animation::TileAnim;
use crate::tilemap::Tilemap;
use crate::utils::timer::Timer;
use crate::DEBUG;
use macroquad::prelude::*;
use macroquad::texture::Texture2D;
use quad_snd::decoder;
use quad_snd::mixer::{Sound, SoundMixer};
use std::collections::HashMap;
us... |
use crate::resource::*;
use crate::system::*;
use crate::{file::File, slice_reader::SliceReader};
use crate::{serializer::*, util::w_add_u32};
use crate::{staticres::*, util::w_mul_i16};
use anyhow::Result;
use std::cmp::Ordering;
struct StrEntry {
id: u16,
val: String,
}
#[derive(Clone, Copy, Default)]
pub s... |
use super::*;
use std::fmt;
pub mod astgraph;
pub mod locals_graph;
pub mod tygraph;
// To add a bit of comp-time checking that the _correct_ node index is being passed around,
// I am going to implement struct wrappers which can iter-op with NodeIndex and move away from
// using a raw NodeIndex
macro_rules! wrapr {
... |
//! N-dimensional generalization of quadtrees.
//!
//! To store an infinite N-dimensional universe, we start with power-of-2-sized
//! hypercubes of cells, which are stored in a flat array (see the crate root
//! documentation for more details). To build larger universes, we combine
//! 2^NDIM of these hypercubes into ... |
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
use std::cell::{Cell, RefCell};
use std::rc::Rc;
use std::fmt;
use typed_arena::Arena;
use ast::{Node, Loc, Id};
use define::MethodVisibility;
use abstract_type::{TypeNodeRef, Prototype};
// can become NonZero<u64> once NonZero for non-pointer types hits st... |
// Copyright 2012-2016 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... |
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd};
use std::string::ToString;
use crate::codec::error::Error;
use crate::codec::Result;
use crate::expr::EvalContext;
/// BinaryLiteral is the internal type for storing bit / hex literal type.
#[... |
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
anyhow::{Context as _, Error},
async_utils::hanging_get::client::HangingGetStream,
fidl::endpoints::{create_proxy, ClientEnd},
fidl_f... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
config::ConsensusProposerType::{FixedProposer, MultipleOrderedProposers, RotatingProposer},
keys::{ConsensusKeyPair, NetworkKeyPairs},
seed_peers::{SeedPeersConfig, SeedPeersConfigHelpers},
trusted_peers::{... |
//! # Mockwork
//! ## Asynchronous Network Simulator.
//! ### Introduction
//! This program presents a simulator of nodes interconnected by physical media.
//! Nodes run a protocol stack that facilitate exchange of data between nodes.
//! The code runs on WebAssembly which is loaded to a single Web Worker.
//!
//![scre... |
//! Flux start-up.
use std::collections::HashSet;
use std::env::consts;
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use crate::ast;
use crate::parser;
use crate::semantic::convert::convert_file;
use crate::semantic::env::Environment;
use crate::semantic::fresh::Fresher;
use crate::semantic::import::Impo... |
use crate::common::file_operations::{atomic_save_bin, read_bin};
use crate::common::utils::rev_range;
use crate::entry::entry_point::OperationResult;
use crate::index::hnsw_index::entry_points::EntryPoints;
use crate::index::hnsw_index::point_scorer::FilteredScorer;
use crate::index::hnsw_index::search_context::SearchC... |
// Copyright (c) 2018 <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 t... |
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... |
use color_eyre::eyre::eyre;
use color_eyre::eyre::Report;
use crate::serialization::BitcoinDeserialize;
use crate::{block::Block, parameters::NetworkUpgrade};
use super::super::*;
// Alias the struct constants here, so the code is easier to read.
const PRECISION: u32 = CompactDifficulty::PRECISION;
const SIGN_BIT: u... |
//! Contains all the helper objects and functions for the SimBroker. Helpers inlclude objects to hold
//! data about the SimBroker's state and their corresponding functions and trait implementations.
use serde_json;
use std::intrinsics::unlikely;
use std::slice::{Iter, IterMut};
use std::fmt::{self, Formatter, Debug... |
#![allow(unreachable_patterns)]
use std::ffi::{CString, CStr};
use libc::c_char;
use std::mem::transmute;
use sys;
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[repr(i32)]
pub enum Keycode {
Backspace = sys::SDLK_BACKSPACE as i32,
Tab = sys::SDLK_TAB as i32,
Return ... |
use std::{
collections::{BTreeMap, HashMap, HashSet},
fmt::Debug,
sync::Arc,
time::{Duration, Instant},
};
use crate::{
appservice_server, database::pusher, server_server, utils, Database, Error, PduEvent, Result,
};
use federation::transactions::send_transaction_message;
use ring::digest;
use rock... |
#![deny(
missing_docs,
non_camel_case_types,
non_snake_case,
path_statements,
trivial_casts,
trivial_numeric_casts,
unsafe_code,
unused_allocation,
unused_import_braces,
unused_imports,
unused_must_use,
unused_mut,
while_true,
array_into_iter,
c... |
///! This module implements structs and traits for pod and node identity management. They are the
///! building blocks of pod scheduling as implemented in the scheduler module.
///!
///! Operators are expected to implement the [`PodIdentityFactory`] trait or use the implementation
///! provided here called [`LabeledPod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.