text stringlengths 7.05k 33.9k |
|---|
use crate::hexaa;
use log::debug;
/// For the purposes of readability, note the following definitions.
/// hex : means the string form of a hexadecimal number. E.g. "0259acef". (It does not represent the underlying hexadecimal bytes, nor the ASCII bytes)
/// b64 : means the string form of a base-64 number. E.g. "8QoRv... |
// Copyright 2018 The Exonum Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
use cpal::traits::{DeviceTrait, HostTrait, EventLoopTrait};
const CLOCK_FREQUENCY_FACTOR: u64 = 3;
const ENVELOPE_MAX: u32 = 0x1FF;
const SICLENCE_THRESHOLD: u32 = 0x180;
const ENVELOPE_CLOCK_FREQUENCY: f32 = 14318180.0/(8*36) as f32; // 49715.9 Hz
const KEY_FREQUENCY_FACTOR: f32 = 20.973;
const PHASE_BITS: usize = 10... |
use std::marker::PhantomData;
use bellperson::gadgets::{
boolean::Boolean,
sha256::sha256 as sha256_circuit,
{multipack, num},
};
use bellperson::{Circuit, ConstraintSystem, SynthesisError};
use ff::PrimeField;
use fil_sapling_crypto::jubjub::JubjubEngine;
use paired::bls12_381::{Bls12, Fr};
use storage_p... |
use miniaudio_sys as sys;
#[inline(always)]
pub(crate) const fn to_bool32(b: bool) -> sys::ma_bool32 {
b as u32 as _
}
#[inline(always)]
pub(crate) const fn from_bool32(b32: sys::ma_bool32) -> bool {
b32 != 0
}
pub(crate) const fn to_bool8(b: bool) -> sys::ma_bool8 {
b as u8 as _
}
#[inline(always)]
pub... |
// Copyright 2020 The Facebook AI Research Team Authors
// Copyright 2020-present, the HuggingFace Inc. team.
// 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
// ... |
// SPDX-License-Identifier: MIT
// Copyright (c) 2022 <NAME> <https://github.com/AndrielFR>
use crate::models::Character;
use crate::models::Color;
use crate::models::Cover;
use crate::models::Date;
use crate::models::Format;
use crate::models::Language;
use crate::models::Manga;
use crate::models::MediaType;
use crat... |
use im;
use moniker::{Binder, Embed, FreeVar, Var};
use num_bigint::BigInt;
use std::io;
use crate::semantics::{nf_term, Context, Definition, InternalError};
use crate::syntax::core;
use crate::syntax::Label;
#[derive(Debug)]
pub enum ParseError {
InvalidType(core::RcType),
InvalidValue(core::RcValue),
In... |
use crate::SongOptions;
use ggez::{
event::{KeyCode, KeyMods},
graphics::{self, Color},
Context, GameError,
};
use notedata::{
timingdata::{GameplayInfo, Judgement, TimingColumn, TimingData},
ChartMetadata, NOTEFIELD_SIZE,
};
use serde_derive::{Deserialize, Serialize};
use std::sync::mpsc::channel;
... |
use std::cmp;
use std::collections::HashMap;
use std::env;
use std::mem;
use anyhow::{anyhow, bail, Error};
use walrus::ir::Value;
use walrus::{DataId, FunctionId, InitExpr, ValType};
use walrus::{ExportItem, GlobalId, GlobalKind, ImportKind, MemoryId, Module};
use wasm_bindgen_wasm_conventions as wasm_conventions;
c... |
//! Simplistic obj loader.
use std::fs::File;
use std::io::Read;
use std::str::FromStr;
use std::io::Result as IoResult;
use std::iter::repeat;
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::sync::{Arc, RwLock};
use std::path::{Path, PathBuf};
use std::iter::Filter;
use std::str::Split;... |
// 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 {
fuchsia_async as fasync,
fuchsia_zircon::{self as zx, AsHandleRef},
futures::{future::FutureExt, stream::FusedStream, Sink, Stream},
... |
// Copyright 2019 Parity Technologies (UK) Ltd.
// Copyright 2020 Netwarps Ltd.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the ... |
#![allow(dead_code)]
use rand::Rng;
use crate::{font::FONT_STANDARD, HEIGHT, WIDTH};
const RAM: usize = 4096;
const VRAM: usize = 2048;
pub struct Processor {
// Registers and indexes
v: [u8; 16],
idxr: u16,
pc: usize,
// Memory
ram: [u8; RAM],
vram: [u8; VRAM],
draw_flag: bool,
/... |
use anyhow::Context;
use anyhow::*;
use cgmath::InnerSpace;
use lifeguard::*;
use std::{
collections::{HashMap, VecDeque},
};
use crate::rendering::gpu_resources::GpuResources;
use super::mesh_builder;
use super::{
chunk::Chunk,
rendering::voxel_rendering::{self},
};
use super::{
chunk::{ChunkMesh, Lo... |
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless ... |
use std::{io::Write, path::PathBuf};
use anyhow::Result;
use directories::ProjectDirs;
use druid::{
piet::{PietText, Text, TextLayout, TextLayoutBuilder},
theme, Color, Env, ExtEventSink, FontDescriptor, FontFamily, Key, Size, Target,
};
use hashbrown::HashMap;
use serde::{de::DeserializeOwned, Deseri... |
use ordered_float::OrderedFloat;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::collections::{BTreeMap, HashMap, HashSet};
pub type PointIdType = u64;
/// Type of point index across all segments
pub type PointOffsetType = u32;
/// Type of point index inside a segment
pu... |
use core::cell::Cell;
use kernel::hil;
use kernel::hil::i2c::{self, Error, I2CHwMasterClient, I2CMaster};
use kernel::platform::chip::ClockInterface;
use kernel::utilities::cells::{OptionalCell, TakeCell};
use kernel::utilities::registers::interfaces::{ReadWriteable, Readable, Writeable};
use kernel::utilities::regist... |
use crate::chat::{ChatRowContent, ToClientMessage};
use crate::lua::*;
use crate::object::executor::ExecutionState as S;
use crate::object::types::*;
use crate::world::actor::WorldActor;
use rlua;
use rlua::ExternalResult;
use rlua::ToLua;
use std::collections::HashMap;
fn get_children(_lua_ctx: rlua::Context, object_... |
// Copyright 2021 <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 writi... |
pub mod config;
pub mod fetch;
pub mod resolution;
mod scan;
mod workarounds;
use crate::{Krate, Krates};
use anyhow::Context as _;
use krates::Utf8PathBuf as PathBuf;
use rayon::prelude::*;
pub use resolution::Resolved;
use std::{cmp, sync::Arc};
const LICENSE_CACHE: &[u8] = include_bytes!("../spdx_cache.bin.zstd");... |
//! A ExecutionContext model which is synchronized with LanguageServer state.
use crate::prelude::*;
use crate::model::execution_context::ComputedValueInfoRegistry;
use crate::model::execution_context::LocalCall;
use crate::model::execution_context::Visualization;
use crate::model::execution_context::VisualizationId;... |
// Copyright 2020 Veil Rust Developers
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disc... |
#![allow(dead_code)]
//! This module is designed to communicate with the PicoBorg Reverse via Rust
//! and the [embedded-hal](https://crates.io/crates/embedded-hal) traits.
//!
//! See the PiBorg website at www.piborg.org/picoborgreverse for more details
//! on the PicoBorgRev board.
//!
//! **Important:** This is sti... |
//! The local cache for a single RRDP server.
//!
//! This is a private module and exists only for organizational reasons.
use std::{cmp, fs, io};
use std::io::{BufRead, BufReader, Read, Write};
use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::sync::Mutex;
use std::sync::atomic::AtomicBool;
use std::syn... |
// 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
//! Event manager — toolkit API
use log::*;
use smallvec::... |
use crate::force_align;
use alloc::boxed::Box;
use core::alloc::Layout;
use core::marker::PhantomData;
use core::num::NonZeroUsize;
use core::ptr::{NonNull, Pointee};
use core::{mem, ptr};
/// The offset + metadata for each element, stored at the end
pub struct PtrData<T: ?Sized> {
offset: usize,
meta: <T as P... |
// Copyright 2020 <NAME>
// SPDX-License-Identifier: Apache-2.0
use crate::{
account_manager::AccountStore,
address::{Address, IotaAddress},
client::ClientOptions,
message::{Message, MessageType},
signing::{with_signer, SignerType},
};
use chrono::prelude::{DateTime, Utc};
use getset::{Getters, Se... |
#![no_main]
#![no_std]
#[cfg(not(test))]
extern crate panic_semihosting;
#[macro_use] // for the `hprintln!` macro
extern crate cortex_m;
extern crate cortex_m_rt;
use crate::ui::Cmd::*;
use embedded_hal::spi;
use epd_waveshare::prelude::*;
use hal::gpio::v2::pin;
use portable::datetime::DateTime;
use portable::{a... |
extern crate byteorder;
extern crate bytes;
extern crate tokio;
use byteorder::{BigEndian, ByteOrder};
use bytes::{Buf, BytesMut};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::path::PathBuf;
use std::time;
use tokio::io::{AsyncReadExt, AsyncW... |
// Copyright 2020-2021 <NAME> under the terms of the MIT License as detailed
// in the accompanying file README.md or <https://opensource.org/licenses/MIT>.
//! [`Tool`] and related.
use std::borrow::Cow;
use std::sync::Arc;
use std::{fmt, hash};
use crate::block::{Block, AIR};
use crate::character::{Character, Char... |
// This file is part of Substrate.
// Copyright (C) 2017-2021 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... |
use std::fs::{create_dir_all, File};
use std::io::Write;
use clap::ArgMatches;
use rusoto_core::ChainProvider;
use aws::credentials_provider;
use encryption::Encryptor;
use error::KawsResult;
use pki::CertificateAuthority;
pub struct Cluster<'a> {
name: &'a str,
region: &'a str,
}
pub struct ExistingCluster... |
use crate::spreadsheets::{LexicalEntryWithForms, SheetResult};
use anyhow::Result;
use dailp::{
convert_udb, seg_verb_surface_forms, AnnotatedDoc, AnnotatedForm, Contributor, Date,
DocumentMetadata, LexicalConnection, MorphemeId, MorphemeSegment, PositionInDocument,
};
use log::info;
pub async fn migrate_dicti... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Wakeup Detect Mode Request Register 0 (P0/P1/P2/P3)"]
pub wud_req0: crate::Reg<wud_req0::WUD_REQ0_SPEC>,
#[doc = "0x04 - Wakeup Detect Mode Request Register 1 (P4/P5/P6)"]
pub wud_req1: crate::Reg<wud_req1::WUD_REQ1_SPEC>,
... |
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
extern crate glfw;
use self::glfw::{Context, Key, Action};
extern crate gl;
use self::gl::types::*;
use std::ptr;
use std::mem;
use std::os::raw::c_void;
use std::path::Path;
use std::ffi::{CStr, CString};
use std::ops::Add;
use image;
use image::Generic... |
use std::collections::HashSet;
use crate::code_move::fix_path;
use crate::collector::{HookCollect, Id};
use crate::entry_strategy::EntryPolicy;
use crate::parse::PathData;
use crate::words::*;
use anyhow::{bail, Error};
use lazy_static::lazy_static;
use regex::Regex;
use std::sync::{Arc, Mutex};
use swc_atoms::JsWord... |
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021-Present Datadog, Inc.
use crate::DEFAULT_API_VERSION;
use super::{
data::{self, Application, Dep... |
use crate::{
bindings::{
kernel::{itimerval, setitimer, user_desc, ITIMER_REAL},
ptrace::{PTRACE_EVENT_EXIT, PTRACE_INTERRUPT},
},
kernel_abi::{syscall_instruction_length, syscall_number_for_gettid, SupportedArch},
kernel_metadata::syscall_name,
log::LogLevel::{LogDebug, LogWarn},
... |
use self::currency::CurrencyId;
pub use self::currency::*;
use crate::{self as pallet_lending, *};
use composable_support::math::safe::SafeAdd;
use composable_traits::{
currency::{Exponent, LocalAssets},
defi::DeFiComposableConfig,
governance::{GovernanceRegistry, SignedRawOrigin},
oracle::Price,
};
use frame_suppo... |
#[cfg(test)]
#[path = "../../../tests/unit/solver/population/rosomaxa_test.rs"]
mod rosomaxa_test;
use super::*;
use crate::algorithms::gsom::*;
use crate::algorithms::nsga2::Objective;
use crate::algorithms::statistics::relative_distance;
use crate::construction::heuristics::*;
use crate::models::problem::ObjectiveCo... |
//! High performance buffer writes.
#![allow(unused_imports, dead_code)]
use std::ops::{Deref, DerefMut};
use futures::{Future, Poll, Async};
use core::{self, OclPrm, Mem as MemCore, MemMap as MemMapCore,
MemFlags, MapFlags, ClNullEventPtr, ClWaitListPtr, AsMem};
use standard::{Event, EventList, Queue, Buffer, Cl... |
use super::sprite::{BatchedSprite, Sprites};
use crate::{
id::{HasId, Id},
prelude::{Camera, Font, Transform3d},
renderer::{Drawable, PassNode, PassNodeCtx, RenderCtx, SampleCount, TargetFormat},
texture::Texture,
};
use bytemuck::{cast_slice, Pod, Zeroable};
use glam::{Vec2, Vec3};
use std::{borrow::Co... |
use std::collections::HashMap;
use std::f32::consts::PI;
use std::io;
use std::path::Path;
use gleam::gl;
use gleam::gl::types::{GLsizei, GLuint};
use matrix::{identity, matmul, rotate_x, rotate_y, scale, translate};
use rand::Rng;
use super::{Context, U32_SIZE};
use error::io_error;
use obj::{load_obj, vec3, Group, ... |
//! The Client module to connect through IRI with API usages
use crate::api::*;
use crate::builder::ClientBuilder;
use crate::error::*;
pub use crate::node::Topic;
use crate::node::*;
use crate::types::*;
use bee_message::prelude::{Address, Ed25519Address, Message, MessageId, UTXOInput};
use bee_signing_ext::Seed;
us... |
#[allow(unused_imports)]
#[rustfmt::skip]
pub mod pac {
// The nRF5340 has a secure and non-secure (NS) mode.
// To avoid cfg spam, we remove _ns or _s suffixes here.
pub use nrf5340_app_pac::{
interrupt,
Interrupt,
Peripherals,
cache_s as cache,
cachedata_s as cach... |
#![windows_subsystem = "windows"]
use raw_window_handle::HasRawWindowHandle;
use gpu_allocator::d3d12::{Allocator, AllocatorCreateDesc, Dx12DevicePtr};
mod all_dxgi {
pub use winapi::shared::{
dxgi::*, dxgi1_2::*, dxgi1_3::*, dxgi1_4::*, dxgi1_6::*, dxgiformat::*, dxgitype::*,
};
}
use winapi::um::d... |
/*
Copyright 2021 <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 writi... |
use calendar::{Date, Feast};
use language::Language;
use lectionary::Reading;
use library::CommonPrayer;
use perseus::{t, Html, RenderFnResult, RenderFnResultWithCause, Template};
use serde::{Deserialize, Serialize};
use sycamore::{
futures::spawn_local_in_scope,
generic_node::GenericNode,
prelude::{
... |
//! All items are `hidden`.
use anyhow::{anyhow, bail, Context as _};
use arrayvec::ArrayVec;
use cargo_metadata::{CargoOpt, MetadataCommand, Package, Resolve, Target};
use derivative::Derivative;
use duct::cmd;
use fixedbitset::FixedBitSet;
use itertools::Itertools as _;
use proc_macro2::LineColumn;
use serde::Deseri... |
extern crate libsoundio_sys as raw;
use super::error::*;
use super::format::*;
use super::sample::*;
use super::util::*;
use std::marker::PhantomData;
use std::os::raw::{c_double, c_int};
use std::ptr;
use std::slice;
/// This is called when an outstream needs to be written to. The `OutStreamUserData` struct is obta... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Version ID Register"]
pub verid: crate::Reg<verid::VERID_SPEC>,
#[doc = "0x04 - Parameter Register"]
pub param: crate::Reg<param::PARAM_SPEC>,
#[doc = "0x08 - FlexIO Control Register"]
pub ctrl: crate::Reg<ctrl::CTR... |
//! Synchronization from and to local files.
use cdchunking::{Chunker, ZPAQ};
use futures::channel::mpsc::{Receiver, channel};
use futures::sink::SinkExt;
use futures::stream::StreamExt;
use log::{log_enabled, debug, info};
use log::Level::Debug;
use std::cell::RefCell;
use std::collections::VecDeque;
use std::ffi::Os... |
#![recursion_limit = "128"]
#[macro_use]
extern crate proc_macro_hack;
#[macro_use]
extern crate quote;
use std::mem;
use std::os::raw::c_void;
use std::string::String;
use quote::{Tokens, Ident};
proc_macro_expr_impl! {
pub fn structure_impl(input: &str) -> String {
let format = trim_quotes(input);
... |
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::string_lit_as_bytes)]
//! BLX claimer
//! This pallet a stakeholder claiming an ApnToken via parcel number
//! It is a WIP
use frame_support::{
codec::{Decode, Encode}, // used to on-chain storage
decl_event, decl_module, decl_storage, debug, decl_error, //... |
//! Internal server that accepts raw commands, queues them up, and transmits
//! them to the Tick Processor asynchronously. Commands are re-transmitted
//! if a response isn't received in a timout period.
//!
//! Responses from the Tick Processor are sent back over the commands channel
//! and are sent to worker proce... |
#![feature(proc_macro)]
#![no_std]
extern crate cortex_m;
extern crate cortex_m_rtfm as rtfm;
extern crate stm32f30x_hal as hal;
extern crate ls010b7dh01;
extern crate rn4870;
extern crate embedded_graphics as graphics;
extern crate panic_abort;
extern crate nb;
mod display;
mod ble;
use cortex_m::asm;
use cortex_m:... |
use bevy::input::mouse::{MouseButtonInput, MouseWheel};
use bevy::prelude::*;
use bevy_ecs_ldtk::prelude::*;
use bevy_ecs_tilemap::{Layer, Map, MapQuery, TileParent, TilePos};
use crate::constants;
use crate::{GameState, MainCamera};
//use crate::ingame_ui::{UIBlocks, BlockKeyInput};
use crate::ingame_ui::PointerStatu... |
pub mod parse;
pub mod math_parser;
use std::convert::TryFrom;
use std::collections::HashMap;
use std::sync::Arc;
use bumpalo::Bump;
use bumpalo::collections::Vec as BumpVec;
use crate::none_err;
use crate::conv_err;
use crate::Outline;
use crate::util::{
Either::*,
Str,
SortIdent,
TermIdent,
As... |
use std::borrow::Cow;
use std::collections::btree_map::Entry;
use std::collections::HashMap;
use std::fs::File;
use std::io::{Read, Seek, SeekFrom};
use std::time::Instant;
use grenad::CompressionType;
use itertools::Itertools;
use log::info;
use roaring::RoaringBitmap;
use serde_json::{Map, Value};
use super::helper... |
use std::collections::HashMap;
use bytes::Bytes;
use futures::{FutureExt, SinkExt};
use http::{Request, Uri};
use hyper::Body;
use serde::{Deserialize, Serialize};
use serde_json::{json, map};
use snafu::Snafu;
use crate::{
config::{log_schema, AcknowledgementsConfig, Input, SinkConfig, SinkContext, SinkDescripti... |
//! seccomp profile handling
use crate::{
capability::{Capabilities, Capability},
oci::spec::runtime::{
Arch, LinuxSeccomp, LinuxSeccompAction, LinuxSeccompArgBuilder, LinuxSeccompBuilder,
LinuxSeccompOperator, LinuxSyscall, LinuxSyscallBuilder,
},
};
use anyhow::{bail, format_err, Context,... |
pub(crate) use self::scope::ScopeKind;
use self::{
control_flow::{CondFacts, Facts},
import::ImportFinder,
pat::PatMode,
props::ComputedPropMode,
scope::Scope,
stmt::AmbientFunctionHandler,
util::ResultExt,
};
use crate::{
debug::duplicate::DuplicateTracker,
errors::{Error, Errors},
... |
// Copyright 2021 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 file.
//! formats: Utility file for dealing with DRM and VK formats, and canonical
//! size calculations.
use std::fmt;
use crate::checked_arithmetic;
use ... |
//! Difftastic is a syntactic diff tool.
//!
//! For usage instructions and advice on contributing, see [the
//! manual](http://difftastic.wilfred.me.uk/).
//!
// This tends to trigger on larger tuples of simple types, and naming
// them would probably be worse for readability.
#![allow(clippy::type_complexity)]
// ==... |
use std::io::{self, Write};
use embedded_time::rate::Hertz;
/// Prescaler
#[derive(Clone, Copy)]
pub enum Prescaler {
NotDivided,
Div2,
Div4,
Div8,
Div16,
Div32,
Div64,
Div128,
Div256,
Div512,
}
impl Prescaler {
fn write_code(&self, to: &mut dyn Write) -> io::Result<()> {
... |
//! # Ruby Exception Hierarchy
//!
//! The built-in subclasses of
//! [`Exception`](https://ruby-doc.org/core-2.6.3/Exception.html) are:
//!
//! - `NoMemoryError`
//! - `ScriptError`
//! - `LoadError`
//! - `NotImplementedError`
//! - `SyntaxError`
//! - `SecurityError`
//! - `SignalException`
//! - `Interrupt`... |
use std::fs::File;
use std::io::Read;
use std::path::Path;
use std::time::Duration;
use consts::{BITRATES, SAMPLING_FREQ};
use enums::{ChannelType, Copyright, CRC, Emphasis, Error, Genre, Layer, Status, Version};
use types::{AudioTag, Frame, MP3Metadata, OptionalAudioTags};
use utils::{compute_duration, create_utf8_st... |
use super::keys::PublicKey;
use super::signature::{compute_b_const_time, Signature};
use crate::commitments::pok_vc::{PoKVCError, PoKVCErrorKind};
use crate::errors::prelude::*;
use std::collections::{HashMap, HashSet};
use amcl_wrapper::extension_field_gt::GT;
use amcl_wrapper::field_elem::{FieldElement, FieldElemen... |
//! A simple key-value store.
use crate::config;
use crate::error::{Result, TinkvError};
use crate::segment::{DataEntry, DataFile, HintFile};
use glob::glob;
use log::{debug, info, trace};
use std::collections::{BTreeMap, HashMap};
use std::fs;
use std::fs::create_dir_all;
use std::time;
use std::path::{Path, PathBuf}... |
//---------------------------------------------------------------------------//
// Copyright (c) 2017-2020 <NAME>. All rights reserved.
//
// This file is part of the Rusted PackFile Manager (RPFM) project,
// which can be found here: https://github.com/Frodo45127/rpfm.
//
// This file is licensed under the MIT license... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Part Device Identification Number Register"]
pub sys_pdid: crate::Reg<sys_pdid::SYS_PDID_SPEC>,
#[doc = "0x04 - System Reset Status Register"]
pub sys_rststs: crate::Reg<sys_rststs::SYS_RSTSTS_SPEC>,
#[doc = "0x08 - Per... |
/*
* Copyright 2019 The Starlark in Rust Authors.
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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/lic... |
// functions already exported by bindgen : 6
// -----------------------------------------
// cell_duplicate
// cell_extended_gcluster
// cell_load
// cell_release
// cells_double_box
// cells_rounded_box
//
// static inline functions total: 42
// ------------------------------------------ (implement / remaining)
// (X)... |
// Copyright 2020 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... |
// 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... |
use rand::prelude::SliceRandom;
use rand::Rng;
use ast::types::{DataType, MemoryViewType, ScalarType};
use ast::{
BinOp, BinOpExpr, Expr, ExprNode, FnCallExpr, FnInput, Lit, Postfix, PostfixExpr, StructDecl,
TypeConsExpr, UnOp, UnOpExpr, VarDeclStatement, VarExpr,
};
use super::cx::Func;
#[derive(Clone, Copy... |
// SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
// SPDX-License-Identifier: Apache-2.0
pub mod irq;
pub mod mem;
pub mod process;
pub mod rand;
pub mod syscall;
use std::cell::RefCell;
use std::convert::TryInto;
use std::env;
use std::io::Read;
use std::net::{IpAddr, Ipv4Addr, SocketAddr, TcpListener, TcpStream, ToS... |
mod utils;
use wasm_bindgen::prelude::*;
///////////////////////////////////////////////////////
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = console)]
fn log(s: &str);
#[wasm_bindgen(js_namespace = console, js_name = log)]
fn log_u32(a: u32);
#[wasm_bindgen(js_namespace = console,... |
// This file is part of Substrate.
// Copyright (C) 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
//
// http://... |
//! This module contains the actor that tracks event outcomes.
//!
//! Outcomes describe the final "fate" of an event. As such, for every event exactly one outcome
//! must be emitted in the entire ingestion pipeline. Since Relay is only one part in this pipeline,
//! outcomes may not be emitted if the event is accepte... |
use crate::absm::command::blend::SetBlendAnimationsPoseSourceCommand;
use crate::{
absm::{
canvas::{AbsmCanvasBuilder, AbsmCanvasMessage},
command::{
blend::SetBlendAnimationByIndexInputPoseSourceCommand, AbsmCommand,
ChangeSelectionCommand, CommandGroup, MovePoseNodeCommand,... |
use serde::{Deserialize, Serialize};
use std::{convert::TryFrom, fmt, io::Read};
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct Job {
pub classes: Vec<Class>,
pub location: Location,
pub stats: Stats,
pub weaponry: Weaponry,
pub ammo: bool,
pub skills: Option<Vec<u32>>,
}... |
use crate::char::write_escaped_char;
use crate::error::Error;
use crate::error::Error::ExpectedType;
use crate::number::Number;
use crate::vm::continuation::Continuation;
use crate::vm::environment::LexicalEnvironment;
use crate::vm::lambda::Lambda;
use crate::vm::opcode::OpCode;
use crate::vm::transform::Transform;
us... |
use proc_macro2::TokenStream;
use syn::{parse::Error, Ident, Result};
use crate::ast::{self, Enum};
pub fn impl_instruction(input: &syn::DeriveInput) -> Result<TokenStream> {
let ast = ast::get(input)?;
ast.validate()?;
generate_lookup_tables(ast)
}
fn generate_lookup_tables(ast: Enum<'_>) -> Result<Tok... |
//! Use [`SafeJoin::safe_join`] in place of [`Path::join`] to help prevent directory traversal
//! attacks.
//!
//! A call of the form `dir.safe_join(path)` returns an error if any prefix of `path` refers to a
//! directory outside of `dir`.
//!
//! Example:
//! ```
//! # use safe_join::SafeJoin;
//! # let home_dir = s... |
// Copyright 2018 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 async_trait::async_trait;
use error_chain::bail;
use std::pin::Pin;
#[allow(unused_imports)]
use tracing::{debug, error, info, warn};
use bytes::Bytes;
#[allow(unused_imports)]
#[cfg(feature = "enable_caching")]
use cached::Cached;
#[cfg(feature = "enable_caching")]
use cached::*;
use fxhash::FxHashMap;
#[cfg(feat... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
changed_since::changed_since_impl,
config::CargoConfig,
context::XContext,
utils::{apply_sccache_if_possible, project_root},
Result,
};
use anyhow::anyhow;
use guppy::graph::DependencyDirection;
use ind... |
// tokio / futures
use futures::{Future, Stream};
use tokio_core::reactor::Core;
// hyper
use hyper::client::{Client, HttpConnector};
use hyper::StatusCode;
use hyper::{Body, HeaderMap, Method, Request, Uri};
#[cfg(feature = "rustls")]
use hyper_rustls::HttpsConnector;
#[cfg(feature = "rust-native-tls")]
use hyper_tls... |
//! The application runtime. This is low-level module useful when you are
//! implementing a backend, but otherwise not meant to be used directly by an
//! end application.
use smallvec::SmallVec;
use std::{collections::HashMap, fmt::Debug, time::Instant};
use crate::{
component::{
layout::{LaidCanvas, La... |
// 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.
//! A `Link` describes an established communications channel between two nodes.
use crate::{
async_quic::NextSend,
future_help::{log_errors, Obser... |
/*
* ARIADNE Experiment, Department of Physics, University of Liverpool
*
* -----------------------
* Timepix Clustering Tool
* -----------------------
*
* timepix-spidr-data-parser/src/bin/clustering_tool.rs
*
* Authors: <NAME>
*/
use std::collections::VecDeque;
use std::convert::TryFrom;
use std::fs;
use s... |
use crate::game_state::Vector2d;
use crate::*;
use core::time::Duration;
use std::collections::BTreeSet;
// The state of user input at some point in time. i.e. what buttons is
// the user holding down?
#[derive(Clone, Copy, Default, Debug, PartialEq, Eq)]
pub struct InputState {
pub up: bool,
pub down: bool,
pub... |
use crate::game;
use crate::prove;
use serde::Serialize;
use std::simd::u16x8;
use std::io;
#[derive(Default, Serialize, Debug, Clone)]
pub struct Stats {
pub attacker_critical: usize,
pub defender_critical: usize,
pub both_critical: usize,
pub unwinnable: usize,
pub prove_attacker: usize,
pu... |
mod windows;
mod posix;
use std::{convert::TryInto, iter};
use rustc_hir::def_id::DefId;
use rustc::mir;
use rustc::ty;
use rustc::ty::layout::{Align, Size};
use rustc_apfloat::Float;
use rustc_span::symbol::sym;
use rustc_ast::attr;
use crate::*;
impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalConte... |
#![recursion_limit = "512"]
#![allow(clippy::unneeded_field_pattern)]
#![allow(clippy::cognitive_complexity)]
mod pinger;
mod state;
mod stream;
mod utils;
use libtiny_common::{ChanName, ChanNameRef};
pub use libtiny_wire as wire;
use pinger::Pinger;
use state::State;
use stream::{Stream, StreamError};
use futures:... |
use std::error::Error;
use std::env;
use std::io;
use std::process;
use std::cmp::Ordering;
use std::thread;
use std::sync::mpsc;
use std::sync::mpsc::Sender;
use std::time::{Duration};
use std::collections::HashMap;
pub mod artifact;
pub mod attack;
pub mod cli;
pub mod element;
pub mod record;
pub mod simulate;
pub... |
use crate::KeyCode;
use parking_lot::Mutex;
use std::{
cell::RefCell,
collections::hash_map::{Entry, HashMap},
mem, ptr,
sync::{
mpsc::{channel, Sender},
Arc,
},
thread,
};
use winapi::{
ctypes::c_int,
shared::{
minwindef::{DWORD, LPARAM, LRESULT, UINT, WPARAM},
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.