text stringlengths 3.09k 13.9k |
|---|
use std::rc::Rc;
use std::cell::RefCell;
use crate::sim1::state::State;
use crate::sim1::types::{AttackType, WeaponType, Vision, FieldEnergy, VecFieldEnergy, Particle, PHYSICAL_GAUGE, PYRO_GAUGE1A, PYRO_GAUGE2B, HYDRO_GAUGE1A, HYDRO_GAUGE2B, ELECTRO_GAUGE1A, ELECTRO_GAUGE2B, CRYO_GAUGE1A, CRYO_GAUGE2B, ANEMO_GAUGE1A, ... |
use bytes::{
BufMut,
Bytes,
BytesMut,
};
use smallvec::SmallVec;
use std::{
io,
marker::Unpin,
str
};
use tokio::{
io::{
AsyncRead,
AsyncReadExt,
AsyncWrite,
AsyncWriteExt,
},
};
use super::header::{
self,
Header,
Kind as HeaderKind,
Maski... |
use crate::input::Input;
use std::cmp;
use std::error::Error;
use std::fmt::Write;
use std::iter;
type Digit = u8;
type DigitList = Vec<Digit>;
fn signal_from_input(i: &Input) -> Result<DigitList, Box<dyn Error>> {
i.raw
.trim()
.chars()
.map(|c| {
c.to_digit(10)
... |
//! Data transfer packet implementation
//! General packet format
//! ```text
//! +-----------------------------------------------------------+
//! | uint32 length of (this field + checksums + data) |
//! +-----------------------------------------------------------+
//! | uint16 length + PacketHeaderProto ... |
#![cfg_attr(not(feature = "std"), no_std)]
/// Edit this file to define custom logic or remove it if it is not needed.
/// Learn more about FRAME and the core library of Substrate FRAME pallets:
/// <https://docs.substrate.io/v3/runtime/frame>
pub use pallet::*;
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
#[cfg(... |
// Copyright 2017-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... |
use crate::register::PsrMode::User;
use crate::Bus;
use crate::Cpu;
use util::*;
#[inline]
pub fn interpret(cpu: &mut Cpu, bus: &mut impl Bus, instr: u32) {
execute(cpu, bus, decode(instr));
}
#[inline]
pub fn decode(instr: u32) -> (bool, bool, bool, bool, bool, u32, u32) {
debug_assert_eq!(instr.bits(27, 25)... |
// 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 crate::fs::*;
use crate::logging::not_implemented;
use crate::task::*;
use crate::types::as_any::AsAny;
use crate::types::*;
use zerocopy::AsBytes;
//... |
use anyhow::*;
use cgmath::*;
use wgpu::util::DeviceExt;
use crate::{bitmap_font::*, renderer::*};
#[repr(C)]
#[derive(Clone, Copy)]
pub struct OverlayInfoVertex {
pos: [f32; 4],
tex_coord: [f32; 2],
}
unsafe impl bytemuck::Pod for OverlayInfoVertex {}
unsafe impl bytemuck::Zeroable for OverlayInfoVertex {}
... |
use super::{ChaChaCore, Key, Nonce, CONSTANTS, STATE_WORDS};
use cipher::{
consts::{U10, U16, U24, U32, U4, U6, U64},
generic_array::{typenum::Unsigned, GenericArray},
BlockSizeUser, IvSizeUser, KeyIvInit, KeySizeUser, StreamCipherCore, StreamCipherCoreWrapper,
StreamCipherSeekCore, StreamClosure,
};
#... |
use std::collections::HashMap;
use std::time::{Duration, Instant};
use chrono::{DateTime, Utc};
use log::error;
use tokio::sync::{
mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
oneshot,
};
use crate::mqtt::ExtraTags;
use crate::mqtt::{IncomingMessage, PublishableMessage};
struct QueueCounter... |
use std::{
env,
fs::create_dir_all,
path::{Path, PathBuf},
};
use anyhow::bail;
use clap::{App, Arg, ArgMatches};
use remud_lib::{run_remud, TlsOptions, WebOptions};
use tracing_subscriber::{
fmt::{self, format},
layer::SubscriberExt,
util::SubscriberInitExt,
EnvFilter, Registry,
};
#[toki... |
use three_d::window::{Window, WindowSettings};
use three_d::frame::FrameOutput;
use three_d::core::{Screen, ClearState};
use three_d::object::MeshProgram;
use three_d::io::Loader;
use three_d::camera::{Camera, CameraControl};
use three_d::math::vec3;
mod viewport_geometry;
mod read_pto;
mod photo;
mod world_rectangle;... |
use anyhow::{anyhow, Result};
use fs_extra::copy_items;
use fs_extra::dir::{get_dir_content, get_dir_content2, CopyOptions, DirOptions};
use std::env::{current_dir, set_current_dir};
use std::fs::{create_dir_all, read_dir, File};
use std::io::Write;
use std::path::PathBuf;
use crate::page_creation::create_index_page;
... |
use core::{intrinsics::transmute, marker::PhantomData, mem::MaybeUninit, ops::Range};
use macros::once;
use mem::{PhysFrameAlloc, PhysFrameCursor, PhysicalMemory, boot_frame::PhysFrameIter, chunks::MemoryChunks};
use multiboot2::BootInformation;
use x86_64::{
structures::paging::{
mapper::{MapToError, Map... |
use std::num::ParseIntError;
use std::str::FromStr;
use bitcoin::{Address, Amount, Network, OutPoint, Script, Transaction, TxIn, TxOut};
use bitcoincore_rpc::json::ListUnspentResultEntry;
use bitcoincore_rpc::Client;
use crate::contracts::SwapCoin;
use crate::error::Error;
use crate::fidelity_bonds::get_locktime_fro... |
use proc_macro2::TokenStream;
use quote::ToTokens;
use crate::common::{Capture, OnFail, OnSuccess, WhenExpr};
#[cfg(all(debug_assertions, feature = "result-debug"))]
use crate::common::Message;
use crate::common::tokenize::build_captured;
use crate::common::tracing::trace_expansion;
use crate::result_macro::parts::Par... |
/* tag::catalog[]
Title:: Basic system health test
Goal:: Start an IC with 2 subnets, 4 nodes per subnet. Install canisters and
make update and query calls that require cross-subnet communication to
succeed. While this is happening, ensure the IC finalizes rounds correctly
across all nodes in each subnet. No real load... |
//!
//! # 基本类型定义
//!
use serde::{Deserialize, Serialize};
use std::{
collections::{BTreeMap, HashMap},
fmt,
};
/// VM CPU 默认数量
pub const CPU_DEFAULT: i32 = 2;
/// VM MEM 默认容量, 单位: MB
pub const MEM_DEFAULT: i32 = 1024;
/// VM DISK 默认容量, 单位: MB
pub const DISK_DEFAULT: i32 = 40 * 1024;
/// Cli ID
pub type CliId... |
//! In the RFC5545 and RFC7986 specified properties except for IANA and
//! non-standard properties ("X"-prefix parameters).
//!
//! Properties are key-value pairs which can have optionally several
//! parameters. A property forms a content line which is line folded (CRLF +
//! whitespace) after 75 bytes automatically ... |
#[macro_use]
extern crate lazy_static;
use itertools;
use std::str::FromStr;
use std::io::{self, prelude::*};
use regex::Regex;
use std::collections::{HashMap};
type Error = Box<std::error::Error>;
fn main() -> Result<(), Error> {
let mut input = String::new();
io::stdin().read_to_string(&mut input)?;
l... |
//shape.rs
use point::Point;
use vector::Vector;
use normal::Normal;
pub trait Shape{
fn is_inside(&self, x:i64, y:i64, z:i64)->bool;
fn normal(&self, x:i64, y:i64, z:i64)->Normal;
fn name(&self)->String;
}
pub struct Sphere{
radius:u64,
center:Point
}
pub struct Cube{
lower:Point,
uppe... |
use crate::codegen::utils::CodeWriter;
use crate::codegen::smithy_model::*;
use quote::{format_ident, quote};
use std::{collections::HashSet, path::Path};
/// GenCommands generates clap commands for every operation.
pub struct GenCommands<'a> {
pub model: &'a SmithyModel,
pub writer: CodeWriter,
}
impl<'a> Ge... |
extern crate proc_macro;
use proc_macro::{TokenStream};
use quote::{quote, ToTokens};
use syn::{ItemFn, ReturnType};
use crate::utils::{parse_fn_args, GenParam};
use crate::symbol::{HEADER, PARAM, BODY, PATH};
//use syn::NestedMeta::{Lit};
//use syn::NestedMeta::Lit;
//use syn::Lit::Str;
//use std::borrow::BorrowMut;
... |
//! Definitions and methods for the preset and multi parameters
use std::collections::HashMap;
use std::ops::RangeInclusive;
/// Enum containing all preset parameters
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum SoundParameter {
// Osc 1
Osc1Wave,
Osc1Coarse,
Osc1FMAmount,
Osc1Level... |
use libloading::{Library, Symbol};
use std::ffi::CString;
use std::fs;
use std::os::raw::c_char;
use wasmer::{Array, Instance, Memory, Module, NativeFunc, Store, Value, WasmPtr};
use wasmer_wasi::WasiState;
use crate::gut_lib;
#[derive(Clone, Debug, Default)]
pub struct Plugin {
descriptions: Vec<String>,
fun... |
// Copied from rustc-objc-foundation project by SSheldon, examples/custom_class.rs
// https://github.com/SSheldon/rust-objc-foundation/blob/master/examples/custom_class.rs
// Covered by MIT License: https://en.wikipedia.org/wiki/MIT_License
extern crate objc;
extern crate objc_foundation;
extern crate objc_id;
pub us... |
// External Dependencies ------------------------------------------------------
use std::thread;
use std::time::Duration;
use rand::{SeedableRng, XorShiftRng};
use glium::backend::glutin_backend::GlutinFacade;
use glium::{glutin, Surface, Frame};
use clock_ticks;
// Internal Dependencies -----------------------------... |
use std::fs::read_to_string;
use std::error::Error;
use std::collections::HashMap;
type AocResult<T> = std::result::Result<T, Box<dyn Error>>;
fn euclid(a: i32, b: i32) -> i32 {
if b == 0 {
a.abs()
} else {
euclid(b, a % &b)
}
}
#[derive(PartialEq, Copy, Clone, Debug)]
struct Point {
... |
use std::{
env,
fs::{self, File},
io::Write,
path::PathBuf,
process::{Command, Stdio},
};
use anyhow::{Error, Result};
use clap::Parser;
use form::util::create_directory_structure;
use log::{info, warn, LevelFilter};
use strum::{IntoEnumIterator, VariantNames};
use strum_macros::{Display, EnumIter,... |
use darling::{self, FromMeta};
use proc_macro::TokenStream;
use quote::{quote, ToTokens};
use syn::parse_macro_input;
fn find_meta_attrs(name: &str, args: &[syn::Attribute]) -> Option<syn::NestedMeta> {
args.as_ref()
.iter()
.filter_map(|a| a.parse_meta().ok())
.find(|m| m.path().is_ident(n... |
use {
super::{GltfAsset, GltfFormat},
crate::{
assets::{AssetHandle, AssetResult, Loader},
graphics::{Graphics, Scale},
prefab::Prefab,
resources::Res,
scene::{Global3, Local3},
},
gltf::Node,
hecs::{Entity, World},
};
pub struct GltfScene {
nodes: Box<[E... |
use crate::jobs::{self, Job, Scope};
use crate::resource::{self, Resource, ResourceTy};
use crate::world::{World};
use crate::notify;
use futures::future::FutureExt;
use std::mem;
use std::cell::RefCell;
use std::collections::HashMap;
use std::future::Future;
use std::collections::hash_map::Entry::{Vacant, Occupied};
u... |
use std::{
fs,
path::{Path, PathBuf},
sync::Arc,
};
use anyhow::Context;
use clap::Parser;
use path_absolutize::Absolutize;
use rayon::prelude::*;
use relative_path::RelativePath;
use swc::{
config::{Config, Options},
try_with_handler, Compiler, TransformOutput,
};
use swc_common::{sync::Lazy, File... |
use super::super::super::dbmodels::guild::Guild as GuildStruct;
use super::super::common::interaction_error::{channel_message_error, interaction_error};
use crate::commands::common::permissions_check::check_if_mod;
use crate::log::warn;
use mongodb::bson::doc;
use mongodb::*;
use serenity::model::prelude::application_... |
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// This file is part of Parity Bridges Common.
// Parity Bridges Common 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, ... |
#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
//! Runtime library calls. Note that wasm compilers may sometimes perform these
//! inline rather than calling them, particularly when CPUs have special
//! instructions which compute them directly.
use crate::instance::Instance;
use crate::vmcont... |
use std::{
env,
ffi::OsString,
iter,
path::{PathBuf, Path},
process::Command,
};
use anyhow::{ensure, Context, Result};
use git2::{IndexAddOption, RebaseOptions, Signature};
use git_subcopy::App;
use log::info;
use structopt::StructOpt;
#[derive(StructOpt)]
struct FetchOpts {
/// The repositor... |
use anyhow::{Context, Result};
use flate2::read::DeflateDecoder;
use regex::Regex;
use serde::{Deserialize, Deserializer};
use std::fs;
use std::io::Read;
use std::path::Path;
#[derive(Debug, Deserialize, PartialEq, Default, Clone)]
pub struct MxCell {
pub value: Option<String>,
}
impl MxCell {
pub fn get_lin... |
extern crate parking_lot;
extern crate regex;
extern crate serde_pickle;
// mod prob_start;
// mod prob_trans;
// mod prob_emit;
use regex::Regex;
use std::collections::HashMap as Map;
use std::collections::HashSet as Set;
use parking_lot::Mutex;
use super::compact::{char_slice, SplitCaptures, SplitState, get_modul... |
pub mod chart_header;
pub mod indicator;
pub mod instrument;
pub mod kline;
pub mod main_menu;
pub mod manual_trade;
pub mod sys_menu;
pub mod trades;
use self::instrument::InstrumentView;
use super::widget::Button;
use super::State;
use crate::app::command::{
QBOX_INSTRUMENT_CLICKED, QBOX_INSTRUMENT_SELECTED, QB... |
use failure::Error;
use std::env;
use std::fs::metadata;
use std::fs::File;
use std::io::prelude::*;
use std::str;
extern crate clap;
use clap::{App, AppSettings, Arg, SubCommand};
use std::fs::OpenOptions;
use std::io::{BufRead, BufReader};
use wasp_core::{compiler,parser};
const VERSION: &'static str = env!("CARGO_P... |
//! A function builder describes a block of runnable code and it's attributes as
//! it's being compiled.
use diagnostic::Span;
use common::{Get, Index};
use crate::{
error::{Error, Result},
internal::{capture::Capture, code::Code, local::Local},
opcode::Op,
Constant, Function, FunctionDebug,
};
#[d... |
//! # 全局属性
//! 禁用标准库
#![no_std]
//! 不使用 `main` 函数等全部 Rust-level 入口点来作为程序入口
#![no_main]
//! # 一些 unstable 的功能需要在 crate 层级声明后才可以使用
#![feature(llvm_asm)]
//! 内嵌整个汇编文件
#![feature(global_asm)]
//! panic! 时,获取其中的信息并打印
#![feature(panic_info_message)]
#![feature(alloc_error_handler)]
//!
//! 允许使用 naked 函数,即编译器不在函数前后添... |
#![deny(
clippy::clone_on_ref_ptr,
clippy::default_trait_access,
clippy::doc_markdown,
clippy::empty_enum,
clippy::empty_line_after_outer_attr,
clippy::enum_glob_use,
clippy::expl_impl_clone_on_copy,
clippy::fallible_impl_from,
clippy::filter_map,
clippy::float_cmp_const,
cli... |
use glam::Vec3;
use ordered_float::OrderedFloat;
use smallvec::{Array, SmallVec};
use std::ops::Index;
use crate::{
util::{barycentric_vector, ray_distance, SupportPoint},
ContactPoints, Ray, Simplex,
};
#[derive(Clone, Copy, Debug)]
pub struct Face {
pub indices: [u16; 3],
pub normal: Vec3,
pub d... |
//! Module with the definition of the [Writer](struct.Writer.html) that allows writing shapefile
//!
//! It is recommended to create a `Writer` using its [from_path](struct.Writer.html#method.from_path) method
//! to ensure that both the .shp and .shx files are created.
//! Then use its [writes_shapes](struct.Writer.ht... |
// Copyright 2020 <NAME>.
//
// 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 writ... |
#![no_std]
#![no_main]
//#![allow(warnings)]
#[macro_use]
extern crate rtt_target;
use core::cell::RefCell;
use cortex_m::asm;
use cortex_m_rt::entry;
use display::{LedPanel, LedPanelError};
use embedded_hal::{spi::Mode, spi::Phase, spi::Polarity};
use embedded_websocket as ws;
use max7219_dot_matrix::MAX7219;
use ne... |
use lazy_static::lazy_static;
use regex::Regex;
#[derive(Debug, PartialEq)]
struct Point {
x: usize,
y: usize,
}
/// In this system, lines can only ever be horizontal, vertical, or at 45 degrees.
#[derive(Debug, PartialEq)]
struct Line {
start: Point,
end: Point,
}
impl Line {
fn is_vertical(&sel... |
use crate::archive::{Archive, ArchiveType};
use crate::index::{Index, IndexType};
use std::collections::HashMap;
use std::convert::TryFrom;
use crate::errors::FileSystemError;
use std::fs::File;
use std::io::{Read, Seek, SeekFrom, Write};
use std::path::{Path, PathBuf};
// TODO should group these constants somehow
... |
extern crate clap;
extern crate regex;
use std::fs::File;
use std::io::BufReader;
use std::io::prelude::*;
use regex::Regex;
use clap::{App};
#[derive(Debug)]
struct Rect {
id: usize,
xpos: usize,
ypos: usize,
xdim: usize,
ydim: usize,
}
// find number of square inches with more than one claim ... |
use std::collections::VecDeque;
use std::io::IoSlice;
use super::Stream;
use crate::utils::RawFdContainer;
#[derive(Debug)]
pub(super) struct WriteBuffer {
data_buf: VecDeque<u8>,
fd_buf: Vec<RawFdContainer>,
}
impl WriteBuffer {
pub(super) fn new() -> Self {
// Buffer size chosen by checking wha... |
use super::*;
use util::{state::*};
impl<'w,E,W,Scroll> Widget<E> for Area<'w,E,W,Scroll> where
E: Env,
ERenderer<E>: RenderStdWidgets<E>,
EEvent<E>: StdVarSup<E>,
E::Context: CtxStdState<E> + CtxClipboardAccess<E>, //TODO make clipboard support optional; e.g. generic type ClipboardAccessProxy
W: A... |
//! An attempt to collect several proposals of [rust-lang/wg-allocators](https://github.com/rust-lang/wg-allocators) into a
//! MVP.
//!
//! [`Alloc`]: https://doc.rust-lang.org/1.38.0/alloc/alloc/trait.Alloc.html
//! [`AllocRef`]: crate::alloc::AllocRef
//! [`AllocRef::alloc`]: crate::alloc::AllocRef::alloc
//! [`Allo... |
/* ************************************************************************ **
** This file is part of rsp2, and is licensed under EITHER the MIT license **
** or the Apache 2.0 license, at your option. **
** **
** ... |
use std::{collections::HashMap, mem};
use log::info;
use mlua::FromLua;
use crate::{
cleanup::{WindowCleanup, WorkspaceCleanup},
config::Config,
direction::Direction,
lua::{self, graph_proxy::GraphProxy, LuaEvent, LuaRuntime},
platform::{Area, NativeWindow, Window, WindowId},
workspace::{Works... |
//! nom, eating data byte by byte
//!
//! nom is a parser combinator library with a focus on safe parsing,
//! streaming patterns, and as much as possible zero copy.
//!
//! The code is available on [Github](https://github.com/Geal/nom)
//!
//! There are a few [guides](home.html) with more details
//! about [the design... |
//! In this example, the token is saved into a cache file. If you are building a
//! real-world web app, you should store it in a database instead. In that case
//! you can disable `token_cached` in the `Config` struct passed to the client
//! when initializing it to avoid using cache files.
#![feature(proc_macro_hygi... |
use crate::proto::message_out::{
criminal_list::{criminal::CrimeType, Criminal},
CriminalList,
};
use tofn::{
collections::TypedUsize,
gg20::sign::malicious::Behaviour::{self, *},
};
use super::super::{run_test_cases, TestCase};
use super::{Disrupt, MaliciousData, Timeout};
use tracing_test::traced_t... |
//! The `generators` module contains API for producing a
//! set of generators for a rangeproof.
#![allow(non_snake_case)]
#![deny(missing_docs)]
use curve25519_dalek::ristretto::RistrettoPoint;
use curve25519_dalek::scalar::Scalar;
use curve25519_dalek::traits::MultiscalarMul;
use digest::{ExtendableOutput, Input, ... |
//! Lettre is a mailer written in Rust. It provides a simple email builder and several transports.
//!
//! This mailer contains the available transports for your emails. To be sendable, the
//! emails have to implement `SendableEmail`.
//!
#![doc(html_root_url = "https://docs.rs/lettre/0.8.0")]
#![deny(missing_docs, m... |
use std::mem;
use std::ops::Deref;
use std::slice;
use binarized::BinarizedCfg;
use history::{Binarize, AssignPrecedence, RewriteSequence, NullHistory};
use precedence::PrecedencedRuleBuilder;
use rule::{GrammarRule, Rule};
use rule::builder::RuleBuilder;
use rule::container::{RuleContainer, EmptyRuleContainer};
use s... |
#[macro_use]
extern crate beserial_derive;
mod hub;
mod network;
mod peer;
use beserial::{Deserialize, Serialize};
use derive_more::{Display, From, Into};
pub use hub::MockHub;
pub use network::{MockId, MockNetwork};
pub use peer::MockPeer;
/// The address of a MockNetwork or a peer thereof. Peer IDs are always equ... |
//! A lowering for `use`-paths (more generally, paths without angle-bracketed segments).
use std::{
fmt::{self, Display},
iter,
};
use crate::{db::AstDatabase, hygiene::Hygiene, name::Name};
use base_db::CrateId;
use either::Either;
use syntax::{ast, AstNode};
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd... |
use itertools::Itertools;
#[derive(Debug, Clone)]
pub struct Report {
pub beacons: Vec<Object>,
}
pub type ThreeD = [i32; 3];
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub struct Object {
pub coordinates: ThreeD,
}
#[derive(Debug, Clone)]
pub struct BeaconPair<'a> {
pub offsets: ThreeD,
pub beaco... |
use fu740_hal::pac::PRCI;
mod ddr_data;
// Required to write to registers whose `.svd` definition does not specify valid vs invalid bit patterns
#[allow(unsafe_code)]
pub fn init(prci: &PRCI) {
// Following initialization procedure described in
// [fu740 manual](https://sifive.cdn.prismic.io/sifive/de1491e5-0... |
use crate::datetime::{to_ordinal, Time};
use crate::iter::easter::easter;
use crate::iter::monthinfo::{rebuild_month, MonthInfo};
use crate::iter::yearinfo::{rebuild_year, YearInfo};
use crate::options::{Frequenzy, ParsedOptions};
use chrono::prelude::*;
pub struct IterInfo<'a> {
pub yearinfo: Option<YearInfo>,
... |
extern crate threadpool;
extern crate reqwest;
extern crate select;
extern crate serde;
extern crate serde_json;
#[macro_use]
extern crate serde_derive;
use std::collections::{HashMap, HashSet};
use std::hash;
use std::sync::{Arc, Mutex};
use select::document::Document;
use select::node::Node;
use select::predicate::... |
#[derive(Debug)]
pub enum Opcode {
SYS,
CLS,
RET,
JP(u16),
CALL(u16),
SE(u8, u8),
SNE(u8, u8),
SER(u8, u8),
LD(u8, u8),
ADD(u8, u8),
LDR(u8, u8),
OR(u8, u8),
AND(u8, u8),
XOR(u8, u8),
ADDR(u8, u8),
SUBR(u8, u8),
SHR(u8),
SUBN(u8, u8),
SHL(u8),
... |
use crate::state::{
increase_last_order_id, read_last_order_id, read_order, read_orders,
read_orders_with_bidder_indexer, remove_order, store_order, Order,
};
use cosmwasm_std::{
attr, Addr, CosmosMsg, Decimal, Deps, DepsMut, MessageInfo, Response, StdError, StdResult,
Uint128,
};
use mirror_protocol::c... |
// Copyright (c) The Starcoin Core Contributors
// SPDX-License-Identifier: Apache-2.0
use anyhow::Result;
use starcoin_abi_resolver::ABIResolver;
use starcoin_abi_types::TypeInstantiation;
use starcoin_crypto::HashValue;
use starcoin_resource_viewer::{AnnotatedMoveStruct, AnnotatedMoveValue, MoveValueAnnotator};
use ... |
/*
* Rust-FMOD - Copyright (c) 2016 <NAME>.
*
* The Original software, FmodEx library, is provided by FIRELIGHT TECHNOLOGIES.
*
* This software is provided 'as-is', without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from
* the use of this software.
*
* Permiss... |
//! An implementation of the
//! [Hybrid Logical Clock](http://www.cse.buffalo.edu/tech-reports/2014-04.pdf)
//! for Rust.
extern crate time;
use std::fmt::{Formatter, Display, Error};
use std::sync::Mutex;
/// The `HLTimespec` type stores a hybrid logical timestamp (also called
/// timespec for symmetry with time::... |
use {
proc_macro::{
TokenStream,
Span,
Delimiter
},
crate::macro_lib::*,
std::fmt::Write
};
pub fn live_register_impl(input: TokenStream) -> TokenStream {
let mut parser = TokenParser::new(input);
let mut tb = TokenBuilder::new();
if let Some(span) = parser.span() {
... |
extern crate channel;
extern crate mio;
use mio::Poll;
use mio::Events;
use mio::net::TcpStream;
use mio::Token;
use mio::net::TcpListener;
use channel::channels::Channel;
use std::collections::HashMap;
use std::thread::{Thread, Builder};
use std::thread;
use std::mem;
use std::time::Duration;
use std::sync::mpsc::cha... |
use std::sync::Arc;
use anyhow::Result;
use crate::algorithms::replace::ReplaceFst;
use crate::fst_properties::mutable_properties::concat_properties;
use crate::fst_properties::FstProperties;
use crate::fst_traits::{AllocableFst, CoreFst, Fst, FstIterator, MutableFst, StateIterator};
use crate::semirings::Semiring;
u... |
#[cfg(not(target_arch = "wasm32"))]
use glutin::ContextBuilder;
use winit::event_loop::EventLoop;
use winit::window::WindowBuilder;
use winit::{dpi::*, window::WindowId};
use femtovg::{renderer::OpenGl, Canvas, Color};
use crate::cursor::translate_cursor;
use vizia_core::{Context, Event, View, WindowDescription, Wind... |
#[macro_use]
extern crate serenity;
extern crate chrono;
extern crate rand;
extern crate kitsu;
extern crate time;
extern crate cleverbot_io;
extern crate env_logger;
extern crate kankyo;
extern crate colored;
extern crate psutil;
extern crate schedule_recv;
extern crate serde_json;
extern crate typemap;
extern crate r... |
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
#![deny(warnings)]
extern crate futures;
extern crate hyper;
extern crate pretty_env_logger;
extern crate webrust;
extern crate net2;
extern crate tokio_core;
extern crate tk_listen;
use futures::Stream;
use net2::unix::UnixTcpBuilderExt;
use tokio_core::reactor::Core;
use tokio_core::net::TcpListener;
use std::thread... |
// Merging Chapter 5 and 6 together, as they are common in other laguages as well
/**
* Breakdown #1
* - Struct Definition
* - `&'static str` is used for defining string literal data type.
* TODO: find out what &' is used for...
* - use attribute #[derive(Debug)] for User to be printable.
* -- https... |
mod color;
mod direction;
mod number;
mod token;
mod statement;
mod field;
pub use color::*;
pub use direction::*;
pub use number::*;
pub use token::*;
pub use statement::*;
pub use field::*;
use std::cmp::Ordering;
#[derive(Clone, Debug)]
pub enum Value {
Num(i64),
Arr(Vec<Value>),
Bool(bool)
}
impl P... |
use anyhow::Context as _;
use std::{collections::HashSet, path::PathBuf};
use crate::features::Workspace;
/// Local disk registry (cargo and our own)
pub struct Registry {
cached: HashSet<Crate>,
local: HashSet<Crate>,
}
impl Registry {
/// Create a registry from the local cache (cargos and ours)
pub... |
// 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.
// spell-checker:ignore (ToDO) COMFOLLOW Passwd RFILE RFILE's derefer dgid duid
#[macro_use]
extern crate u... |
use rustc_hash::FxHashMap;
use swc_atoms::{js_word, JsWord};
use swc_common::{collections::AHashSet, sync::Lrc};
use swc_ecma_ast::*;
use swc_ecma_utils::{collect_decls, Id};
use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith};
pub fn inline_globals(
envs: Lrc<FxHashMap<JsWord, Expr>... |
//--------------------------------------------------------------------
// curve.rs
//--------------------------------------------------------------------
// Provides the proxy enumeration Curve, which acts as a dispatcher
// between the known types of curves
//-----------------------------------------------------------... |
//! The Application is the core component of crius.
//! It manages the setup of the engine's sub-systems and
//! runs the main loop.
pub mod settings;
use crate::core::application::settings::Settings;
use crate::core::event::ApplicationEvent;
use crate::core::scene::{Context, Scene, SceneManager, Transition};
use cra... |
use std::{
fs::{File, OpenOptions},
io::{BufReader, Write},
os::unix::prelude::OpenOptionsExt,
path::{Path, PathBuf},
process::{Command, Stdio},
};
use magic_vlsi::MagicInstance;
use serde::Serialize;
use crate::{
error::Result,
lvs::Lvs,
protos::lvs::{LvsInput, LvsOutput},
};
#[cfg(t... |
use crate::{
audio::{
AudioPlayer,
Sound,
},
dimensions::{
Attack,
LrDirection,
OctoDirection,
time::{
DeltaTime,
Timer,
}
},
items::{
ItemConfig,
ItemPickup,
},
math::RandGen,
particles::{
... |
// This file is part of Sulis, a turn based RPG written in Rust.
// Copyright 2018 <NAME>
//
// Sulis 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 opt... |
use std::env;
// use errno::errno;
use libc;
use std::collections::HashMap;
// use std::mem;
use regex::Regex;
use parsers;
//use tools::{self, clog};
use tools::{self};
#[derive(Debug, Clone)]
pub struct Shell {
pub alias: HashMap<String, String>,
pub previous_dir: String,
pub previous_cmd: String,
... |
//! # One-pulse Mode
use crate::prelude::*;
use crate::rcc::*;
use crate::stm32::*;
use crate::time::{Hertz, MicroSecond};
use crate::timer::pins::TimerPin;
use crate::timer::*;
use core::marker::PhantomData;
pub trait OpmExt: Sized {
fn opm(self, period: MicroSecond, rcc: &mut Rcc) -> Opm<Self>;
}
pub struct Opm... |
mod clipboard;
pub mod create;
mod events;
mod handler;
mod setup;
mod tx_wrapper;
mod ui_commands;
use std::{path::Path, process::Stdio, sync::Arc, thread};
use log::{error, info, warn};
use nvim_rs::UiAttachOptions;
use tokio::process::Command;
use crate::{
cmd_line::CmdLineSettings, error_handling::ResultPani... |
use super::{Fp, P1};
use crate::kzg_types::{ArkG1, ArkG2, FsFr as BlstFr};
use ark_bls12_381::{Fr, Fq, g1, g2};
use ark_ec::{
models::short_weierstrass_jacobian::GroupProjective,
};
use ark_ff::{biginteger::BigInteger256, biginteger::BigInteger384, Fp2, Fp384};
use ark_poly::univariate::DensePolynomial as DensePoly... |
use crate::index::token_filter::alpha_num_only::{
create_alpha_num_only_filter, NAME as ALPHA_NUM_ONLY,
};
use crate::index::token_filter::ascii_folding::{
create_ascii_folding_filter, NAME as ASCII_FOLDING,
};
use crate::index::token_filter::lower_case::{create_lower_case_filter, NAME as LOWER_CASE};
use crate... |
use crate::error::*;
use crate::parser::Lexer;
use crate::parser::read_xref_and_trailer_at;
use crate::xref::XRefTable;
use crate::primitive::Dictionary;
use crate::object::*;
use std::ops::Deref;
use std::ops::{
RangeFull,
RangeFrom,
RangeTo,
Range,
};
pub trait Backend: Sized {
fn read<T: Index... |
use std::path::{Path, PathBuf};
use image::{ImageFormat, RgbaImage};
use inox_filesystem::{convert_from_local_path, File};
use inox_log::debug_log;
use inox_messenger::MessageHubRc;
use inox_resources::{
Data, DataTypeResource, Handle, ResourceEvent, ResourceId, ResourceTrait, SerializableResource,
SharedData,... |
//! Convenience
//! It is a module that provides sugar-type and helper function.
use crate::prelude::*;
/// No size type, API compliant consistency.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct MyUnit;
impl DelayTaskHandler for MyUnit {
fn quit(self: Box<Self>) -> AnyResult<()> {
Ok(())
}
}
//... |
use base64;
use config::{Variant, Version};
use output::HashRaw;
use Error;
pub(crate) fn decode_rust(hash: &str) -> Result<HashRaw, Error> {
let (rest, intermediate) = parse_hash(hash).map_err(|e| Error::HashDecodeError(e))?;
let raw_hash_bytes = base64::decode_config(rest, base64::STANDARD_NO_PAD)
.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.