text stringlengths 7.05k 33.9k |
|---|
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
use std::{
io::{Error as IoError, ErrorKind, Read, Result as IoResult, Seek, SeekFrom, Write},
pin::Pin,
};
use futures_util::{
io::AsyncRead,
task::{Context, Poll},
};
use kvproto::encryptionpb::EncryptionMethod;
use openssl::symm::{C... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::AccountData;
use anyhow::{bail, ensure, format_err, Error, Result};
use libra_json_rpc::{
errors::JsonRpcError,
views::{
AccountStateWithProofView, AccountView, BytesView, EventView, StateProofView,
T... |
// Virtio (Virtual I/O Device)
// https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html
// https://github.com/mit-pdos/xv6-riscv/blob/riscv/kernel/virtio_disk.c
// https://syuu1228.github.io/howto_implement_hypervisor/part12.html
// https://syuu1228.github.io/howto_implement_hypervisor/part20.... |
#[allow(dead_code)] // Dead variants for completeness
pub mod codes {
//! # Codes
//!
//! This module contains a list of US QWERTY key code constants, based around rows/columns on a keyboard.
//! This is used because, for example, in a game using WASD, you're looking for the characters in that position,... |
// Copyright 2022 <NAME>
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms... |
use geo_utm::{Utm, UtmRelative};
use serde::{Deserialize, Serialize};
use std::time::Instant;
use chrono::Local;
/// Information about a single drone
///
/// Mostly provides details about the camera on the drone
/// For simplicity, we assume exactly one camera per drone (or at least all cameras have
/// the exact same... |
extern crate image;
extern crate clap;
use clap::{Arg, App, AppSettings};
use image::{ImageBuffer, GenericImageView, Rgba};
use std::fs::File;
use std::io::Read;
use std::io::Write;
//use std::io::BufReader;
use std::path::Path;
//use std::process::exit;
//use image::GenericImageView
//use std::ffi::OsString;
//use s... |
use clap::crate_version;
use clap::App;
use clap::AppSettings;
use clap::Arg;
use clap::ArgMatches;
use log::LevelFilter;
use regex::Regex;
use std::str::FromStr;
use strum::Display;
use strum::EnumString;
const GROUP_ID_DEFAULT: &str = "kafcat";
const BROKERS_DEFAULT: &str = "localhost:9092";
const MSG_DELIMITER_DEFA... |
// This file contains logic to define how templates are rendered
use crate::errors::*;
use crate::Request;
use crate::Translator;
use futures::Future;
use std::collections::HashMap;
use std::pin::Pin;
use std::rc::Rc;
use sycamore::prelude::{template, GenericNode, Template as SycamoreTemplate};
use sycamore::rx::{Cont... |
use crate::capnp_db::{CapnpCursor, DBTransaction, Environment, MessageReader, RwTransaction};
use crate::error::{Error, Result};
use atelier_core::{utils, AssetRef, AssetUuid};
use atelier_importer::{ArtifactMetadata, AssetMetadata};
use atelier_schema::data::{
self, artifact_metadata, asset_change_log_entry,
a... |
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
extern crate libc;
#[macro_use]
extern crate serde_derive;
extern crate curv;
extern crate serde;
extern crate serde_json;
use crate::curv::arithmetic::t... |
use std::ptr::null_mut;
use std::sync::atomic::{AtomicUsize, Ordering};
use byteorder::{ByteOrder, LittleEndian};
use libc::c_void;
use bw_dat::dialog::{Control, Dialog, Event, EventHandler};
use bw_dat::{Game, unit, Unit, UnitId, order, OrderId, Sprite};
use crate::bw;
use crate::config::Config;
use crate::unit_sea... |
//! This crate provides an interface based on the `scoped-threadpool` crate adapted for use with the `threadpool` crate's `ThreadPool`
//!
//! It can be used to execute a number of short-lived jobs in parallel
//! without the need to respawn the underlying threads.
//!
//! Jobs are runnable by borrowing the pool for a ... |
//! Configures and runs the inbound proxy.
//!
//! The inbound proxy is responsible for terminating traffic from other network
//! endpoints inbound to the local application.
#![deny(warnings, rust_2018_idioms)]
pub use self::endpoint::{HttpEndpoint, ProfileTarget, RequestTarget, Target, TcpEndpoint};
use self::preve... |
use crate::cx::*;
use makepad_trapezoidator::Trapezoidator;
use makepad_geometry::{AffineTransformation, Transform, Vector};
use makepad_internal_iter::*;
use makepad_path::PathIterator;
impl Cx {
/*
pub fn load_font_style(&mut self, style: &str) -> Font {
self.load_font_path(&self.font(style))
}
... |
use langtag::LanguageTag;
// Tests from RFC 5646 2.2.1
#[test]
fn test_primary_language() {
assert_eq!(
"fr",
LanguageTag::parse("fr")
.unwrap()
.language().unwrap().primary()
);
assert_eq!(
"de",
LanguageTag::parse("de")
.unwrap()
.language().unwrap().primary()
);
assert_eq!(
None,
Langua... |
use crate::input::{InputFile, Scope};
use anyhow::anyhow;
use itertools::Itertools;
use pulldown_cmark::{
Alignment, BrokenLink, CodeBlockKind, CowStr, Event, LinkType, Options, Parser, Tag
};
use std::{
collections::{BTreeMap, VecDeque},
fmt::{self, Write as _},
io
};
use syn::Path;
use tera::Tera;
use url::Url;
... |
#[macro_use]
extern crate log;
extern crate mio;
extern crate byteorder;
#[path="../shared/frame.rs"]
pub mod frame;
use frame::{MessageFrame, ToFrame, Message};
#[path="../shared/state.rs"]
pub mod state;
use state::{ClientState, Position, Rotation, Transform};
use mio::tcp::*;
use mio::TryWrite;
use mio::util::Sla... |
use std::ops::Deref;
use gc::Gc;
use regex::Regex;
use crate::{
builtins::{
function::NativeFunctionData,
object::{InternalState, Object, ObjectKind, PROTOTYPE},
property::Property,
value::{from_value, to_value, FromValue, ResultValue, Value, ValueData},
},
exec::Interprete... |
// Copyright 2020 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 std::str;
// use std::ascii::{AsciiExt};
fn main() {
let tao = str::from_utf8(&[0xE9u8, 0x81u8, 0x93u8]).unwrap();
assert_eq!("道", tao);
assert_eq!("道", String::from("\u{9053}"));
let unicode_x = 0x9053;
let utf_x_hex = 0xe98193;
let utf_x_bin = 0b111010011000000110010011;
println!("uni... |
use crate::feature::{ Element, BracketSymbol, BracketAromatic };
use super::{ scanner::Scanner, Error, missing_character::missing_character };
pub fn read_symbol(scanner: &mut Scanner) -> Result<BracketSymbol, Error> {
match scanner.peek() {
Some('*') => {
scanner.pop();
Ok(Bracket... |
// 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.
// This button sample implements a rotation scheme that is a prototype
// for how Carnelian and apps will deal with drawing to the frame buffer
// on devic... |
//! Pdf document parsers (see spec for distinction between document and file)
//!
use primitive::{Dictionary, Array, Boolean, Ref, Primitive, Name, PdfString, MaybeRef};
use file::{PdfVersion};
use {ErrorKind, Result, Parse, ParseFrom, Downcast};
use std::fmt;
/// A name object specifying the page layout to be used wh... |
//! To limit the potential number of texels that need to be accessed,
//! filtering methods use an image pyramid of increasingly lower
//! resolution prefiltered versions of the original image to
//! accelerate their operation.
// std
use std::ops::{Add, AddAssign, Div, Mul};
// pbrt
use crate::core::geometry::{Point2... |
// Copyright Rivtower Technologies 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 ... |
use crate::{
abc_wrappers::{DiatonicPitchClass, MaybeAccidental, MusicSymbol},
accidentals::{AccidentalTracker, KeySignatureMap},
errors::AbcParseError,
key_signatures::{key_signature, parse_abc_key_signature_to_midi},
midly_wrappers::{MidiMessage, Smf, Track},
time_signatures::{parse_abc_time_s... |
use std::{marker::PhantomData, mem};
use stdweb::{Reference, Value};
use {
constants::{Direction, Part, ResourceType, ReturnCode},
memory::MemoryReference,
objects::{
Attackable, ConstructionSite, Creep, FindOptions, HasPosition, Resource, RoomPosition,
Source, StructureController, Structu... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! Implementation of the unary RPC protocol as per [DiemNet wire protocol v1].
//!
//! ## Design:
//!
//! The unary RPC protocol is implemented here as two independent async completion
//! queues: [`InboundRpcs`] and [`OutboundRpcs`].
... |
use nannou::prelude::*;
use std::cell::RefCell;
mod data;
/* Generates vertices on a subdivided isocahedron, normalized to 1.
* It is used for creating a sphere for which the vertices are spread more
* regularly than it would be with for instance polar coordinates (which is the case for UV map).
* See https://en.w... |
mod utils;
mod render;
use std::vec;
use wasm_bindgen::prelude::*;
use js_sys::Math;
use web_sys::{console, WebGlProgram};
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc:... |
//! [](http://i.imgur.com/RUEw8EW.png)
//!
//! bspline
//! ===
//! A library for computing B-spline interpolating curves on generic control points. bspline can
//! be used to evaluate B-splines of varying orders on any type that can be linearly interpolated,
//! ranging from float... |
extern crate wasm_bindgen;
extern crate web_sys;
extern crate js_sys;
extern crate console_error_panic_hook;
extern crate log;
extern crate console_log;
use crate::shader_loader::{program_wrapper::ProgramWrapper, Program, program_wrapper};
use wasm_bindgen::{prelude::*, JsCast};
use web_sys::{WebGl2RenderingContext as... |
use crate::updates::decoder::{Decode, Decoder, DecoderV1};
use crate::updates::encoder::{Encode, Encoder, EncoderV1};
use crate::{Doc, StateVector};
use lib0::decoding::{Cursor, Read};
use lib0::encoding::Write;
use rand::prelude::SliceRandom;
use rand::rngs::ThreadRng;
use rand::{thread_rng, Rng};
use std::cell::{RefC... |
//! Linux syscall implementations
#![no_std]
#![deny(warnings, unsafe_code, unused_must_use, unreachable_patterns)]
#![feature(bool_to_option)]
#[macro_use]
extern crate alloc;
#[macro_use]
extern crate log;
use {
self::{consts::*, util::*},
alloc::sync::Arc,
kernel_hal::{user::*, GeneralRegs},
linu... |
// Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved
// Copyright (c) 2017, The rav1e contributors. All rights reserved
//
// This source code is subject to the terms of the BSD 2 Clause License and
// the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
// was not distributed... |
//! This module contains an analysis to infer ownership information for pointers. It analyzes code
//! using raw pointers and indicates, for each pointer, whether it appears to be owned, mutably
//! borrowed, or immutably borrowed. It can also infer ownership-polymorphic function signatures,
//! which handles cases w... |
use super::GameBoy;
use image::GenericImage;
// seems to be the right value to meet the apparent framerate
const CYCLES_PER_LINE: u64 = 113;
/// Game Boy video memory state
pub struct VideoData {
t: u64,
vram: [u8; 0x2000],
// background palette register
bgp: u8,
// background scroll/offset x and... |
use crate::{
character::Character,
control_scheme::{ControlButton, ControlScheme},
level::UpdateContext,
message::Message,
};
use rg3d::{
core::rand::Rng,
core::{
algebra::{Matrix3, UnitQuaternion, Vector3},
math::Vector3Ext,
pool::Handle,
visitor::{Visit, VisitRe... |
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
extern crate glfw;
use self::glfw::Context;
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;
use common::{process_events, processInput};
use shader::Shader;
use camera::... |
#[derive(Clone)]
#[allow(non_camel_case_types)]
pub struct Sage_fifo {
support_level: SupportLevel,
data: DataHolder,
code: String,
imports: String,
main_file_path: String,
plugin_root: String,
cache_dir: String,
interpreter: String,
current_output_id: u32,
user_sage_config: boo... |
#![allow(non_snake_case)]
use merge::Merge;
use std::collections::BTreeMap;
use shipcat_definitions::{
structs::{
autoscaling::AutoScaling,
metadata::{default_format_string, Contact, Context, Language, SlackChannel},
security::DataHandling,
tolerations::Tolerations,
volume:... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use super::cfg::BlockCFG;
use crate::{
hlir::ast::{Command, Command_, Exp, ExpListItem, UnannotatedExp_, Value, Value_},
naming::ast::{BuiltinTypeName, BuiltinTypeName_},
parser::ast::{BinOp, BinOp_, UnaryOp, UnaryOp_},
};
u... |
// Copyright 2021 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot 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) any late... |
use std::io::{Read, Write, BufRead, BufReader};
use std::{io, path, fs, ops};
use std::collections::{HashMap, VecDeque};
use utils::{regex_strip, regex_matches, regex_match, SVal, KernelSection, MutStrMap};
use regex::{Regex, Captures};
use sassas_grammar::*;
pub fn test(fp: Box<BufRead>, reg: bool, all: bool) -> io:... |
#[macro_use]
extern crate lazy_static;
extern crate regex;
extern crate pathdiff;
use regex::Regex;
use fnv::{FnvHashMap, FnvHashSet};
use pathdiff::diff_paths;
use std::thread::{self, JoinHandle};
use std::fmt;
use std::ffi::{CStr, OsStr};
use std::os::raw::{c_char, c_void};
use std::sync::mpsc;
use std::boxed::Box;... |
// Copyright 2021 Twitter, Inc.
// Licensed under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
use crate::codec::*;
use crate::config_file::Tls;
use crate::metrics::*;
use crate::session::TcpStream;
use crate::*;
use boring::x509::X509;
use rand::seq::SliceRandom;
use rand::thread_rng;... |
use super::fx_build_hasher::FxBuildHasher;
use super::map_entry::{Entry, MapEntry};
use std::{
cmp::max,
hash::{BuildHasher, Hash, Hasher},
ptr, vec,
};
const INITIAL_SIZE: usize = 4;
/// Robinhood HashMap backed by the fx hashing algorithm (by default).
#[derive(Debug)]
pub struct RHMap<K: Hash + Eq, V, ... |
#[macro_use]
extern crate glium;
extern crate image;
extern crate nalgebra;
extern crate num;
extern crate getopts;
extern crate inotify;
mod steve_common;
mod steve;
mod steve17;
const VERT_PROG: &'static str = include_str!("vert.glsl");
const VERT_PROG_SIMPLE: &'static str = include_str!("vert_simple.glsl");
const... |
use aster::AstBuilder;
use build::transition::{self, Transition};
use mir::*;
use syntax::ast::{self, ExprKind, StmtKind};
use syntax::codemap::respan;
use syntax::ext::base::ExtCtxt;
use syntax::ext::tt::quoted;
use syntax::ext::tt::transcribe;
use syntax::fold::{self, Folder};
use syntax::parse::parser::Parser;
use s... |
#![allow(clippy::bool_assert_comparison)]
pub mod actions;
mod error;
pub mod inputs;
pub mod periodic;
#[cfg(not(target_family = "wasm"))]
pub mod queue_drain_runner;
pub mod scripting;
pub mod state_machine;
use actions::{Action, TaskAction};
use ergo_database::object_id::{InputId, PeriodicTriggerId, TaskId, TaskTr... |
// The code in this file is derived from the winit project ( https://github.com/rust-windowing/winit ),
// created by the winit contributors including <NAME> and <NAME>.
// It has been extensively modified to remove most functionality not needed by the present project.
// winit is licensed under Apache License 2.0... |
// MIT License
//
// Copyright (c) 2018 <NAME>
// Copyright (c) 2019 <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
... |
use super::child_buffer::ChildBuffer;
use crate::cow_bytes::{CowBytes, SlicedCowBytes};
use crate::size::{Size, SizeMut, StaticSize};
use crate::tree::MessageAction;
use parking_lot::RwLock;
use std::borrow::Borrow;
use std::cmp;
use std::collections::BTreeMap;
use std::mem::replace;
#[derive(Debug, Serialize, Deseria... |
use utils::compress;
use std::path::{Path, PathBuf};
use std::time::Instant;
use std::{fmt, env, fs};
use std::io::{BufRead, BufReader, Write, Error, ErrorKind};
use std::ffi::OsStr;
use std::str::FromStr;
use md5::{Md5, Digest};
use regex::Regex;
use lazy_static::lazy_static;
use crate::config::GemBS;
use crate::com... |
use super::r#ref::IlstRef;
use crate::error::{ErrorKind, FileEncodingError, LoftyError, Result};
use crate::file::FileType;
use crate::macros::try_vec;
use crate::mp4::atom_info::{AtomIdent, AtomInfo};
use crate::mp4::ilst::r#ref::{AtomIdentRef, AtomRef};
use crate::mp4::moov::Moov;
use crate::mp4::read::{atom_tree, me... |
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
#![recursion_limit = "256"]
use anyhow::Result;
use futures::FutureExt;
use futures::SinkExt;
use lazy_static::lazy_static;
use regex::{Regex, RegexSet};
use slab::Slab;
use std::fs::File;
use std::io::{stdout, BufRead, BufWriter, Stdout, Write};
use structopt::StructOpt;
use termion::screen::AlternateScreen;
use thise... |
use crate::layout;
use wgpu::util::DeviceExt;
use std::collections::BTreeMap;
use std::ops::BitOr;
/// The base structure used to get access to the GPU. In addition it handles things like
/// shader compilation and the actual dispatch of work to the GPU.
pub struct Device<'a> {
/// A handle to `wgpu`'s [Device](wg... |
use crate::A2;
pub(crate) const AD: A2 = &[b'A', b'D'];
pub(crate) const AE: A2 = &[b'A', b'E'];
pub(crate) const AF: A2 = &[b'A', b'F'];
pub(crate) const AG: A2 = &[b'A', b'G'];
pub(crate) const AI: A2 = &[b'A', b'I'];
pub(crate) const AL: A2 = &[b'A', b'L'];
pub(crate) const AM: A2 = &[b'A', b'M'];
pub(crate) const ... |
use std::{mem::size_of, num::NonZeroU64};
use arrayvec::ArrayVec;
use wgpu::{
util::{BufferInitDescriptor, DeviceExt},
BindGroupDescriptor, BindGroupEntry, BindGroupLayout, BindGroupLayoutDescriptor, BindGroupLayoutEntry,
BindingResource, BindingType, Buffer, BufferBindingType, BufferUsages, CommandEncoder... |
// 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 ... |
mod model_checking;
use std::collections::{HashSet, HashMap};
use model_checking::mdp2::*;
use model_checking::dfa::*;
use std::iter::FromIterator;
use model_checking::helper_methods::Rewards;
//use std::time::Instant;
use model_checking::product_automata::*;
use model_checking::stapu_framework::*;
use std::time::Insta... |
//! # Rust unsized enum implementation
//!
//! In stable Rust as of mid-2020, `?Sized` (aka unsized or trait
//! object or "dynamically sized type" or DST) support is missing in
//! various places:
//!
//! - Rust's built-in enums don't support `?Sized` variants
//!
//! - `Option` doesn't support `?Sized` (because it is... |
use std::error::Error;
use std::path::PathBuf;
use std::fs::{File, read_to_string, remove_file};
use std::io;
use ftp::{FtpStream, FtpError};
use md5::Context;
use rusqlite::{Connection, NO_PARAMS};
use crate::Node;
use crate::NCBI_FTP_HOST;
use crate::NCBI_FTP_PATH;
/// Open the taxonomy database in this directory.... |
use anyhow::anyhow;
use clap::Parser;
use itertools::{all, any, Itertools};
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
use std::collections::{BTreeMap, BTreeSet, HashSet};
use std::fs::File;
use std::io::{BufRead, BufReader};
mod counter;
use counter::Counter;
mod letter_dist;
use letter_dist::{Lett... |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
//! IMDSv2 Credentials Provider
//!
//! # Important
//! This credential provider will NOT fallback to IMDSv1. Ensure that IMDSv2 is enabled on your instances.
use crate::imds;
use crate::imds::client::... |
use ring::digest::{digest, SHA256};
use std::borrow::Borrow;
use serde::{Serialize, Deserialize};
use super::hash::{Hashable, H256};
/// A node in the Merkle tree
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MerkleNode{
key: H256,
left_child: Box<Option<MerkleNode>>,
right_child: Box<Option<... |
// Copyright © 2019 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
//
use crate::{PciCapability, PciCapabilityId};
use anyhow::anyhow;
use byteorder::{ByteOrder, LittleEndian};
use std::io;
use std::result;
use std::sync::Arc;
use vm_device::interrupt::{
InterruptIndex, InterruptSource... |
use crate::system::SystemId;
use crate::{
borrow::RefMut, command::CommandBuffer, resource::ResourceTypeId, storage::ComponentTypeId,
world::World,
};
use bit_set::BitSet;
#[cfg(feature = "par-schedule")]
use tracing::{span, trace, Level};
#[cfg(feature = "par-schedule")]
use std::{
collections::{HashMap,... |
use super::crypto::{decrypt_token, encrypt_token};
use bytes::Bytes;
use interledger_api::AccountDetails;
use interledger_btp::BtpAccount;
use interledger_ccp::{CcpRoutingAccount, RoutingRelation};
use interledger_http::HttpAccount;
use interledger_ildcp::IldcpAccount;
use interledger_packet::Address;
use interledger_s... |
//! Trait object serialization for rkyv.
//!
//! With `rkyv_dyn`, trait objects can be serialized with rkyv then the methods can be called
//! without deserializing. All it takes is some macro magic.
//!
//! See [`SerializeDyn`] for an example of how to use rkyv_dyn.
//!
//! ## Features
//!
//! - `nightly`: Enables som... |
use anyhow::*;
use std::f32::consts::PI;
use std::ops::{Mul, Range};
use std::path::Path;
use tobj::LoadOptions;
use uuid::Uuid;
use wgpu::util::DeviceExt;
use crate::texture;
pub trait Vertex {
fn desc<'a>() -> wgpu::VertexBufferLayout<'a>;
}
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zero... |
#[cfg(feature = "serde-serialize")]
use serde::{Deserialize, Serialize};
use num::One;
use simba::scalar::ComplexField;
use simba::simd::SimdComplexField;
use crate::allocator::Allocator;
use crate::base::{DefaultAllocator, Matrix, MatrixMN, MatrixN, SquareMatrix, Vector};
use crate::constraint::{SameNumberOfRows, Sh... |
use std::{collections::BTreeMap, convert::TryInto, ffi::CStr, ffi::CString, ptr};
use crate::{
datatypes::{
DataType, Extension, Field, IntegerType, IntervalUnit, Metadata, TimeUnit, UnionMode,
},
error::{ArrowError, Result},
};
#[allow(dead_code)]
struct SchemaPrivateData {
name: CString,
... |
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the THIRD-PARTY file.
use std::io;
use std:... |
use crate::{
config,
gd::GDIntegrationResult,
model::demonlist::demon::{FullDemon, MinimalDemon},
state::PointercrateState,
video,
view::{
demonlist::overview::{DemonlistOverview, OverviewQueryData},
Page,
},
ViewResult,
};
use actix_web::{web::Path, HttpResponse};
use ac... |
#![feature(proc_macro_hygiene, decl_macro)]
#![allow(clippy::too_many_arguments)]
#[macro_use]
extern crate rocket;
#[macro_use]
extern crate structopt_derive;
extern crate chrono;
extern crate flatbuffers;
extern crate handlebars;
extern crate nanoid;
extern crate num_cpus;
extern crate regex;
extern crate speculate;... |
use crate::error::*;
use crate::formatting::build_waveform;
use crate::wave::Wave;
use crate::config::Config;
use tui::widgets::*;
use tui::terminal::Frame;
use tui::backend::Backend;
use tui::layout::{Direction, Layout, Rect, Constraint};
use tui::style::{Style, Color, Modifier};
use tui::text::{Text, Spans, Span};
u... |
#[macro_use]
extern crate serde_derive;
use std::collections::BTreeMap;
use std::fs::File;
use std::io::Read;
use std::io::Write;
use std::path::Path;
use std::path::PathBuf;
use std::process::exit;
use argparse::ArgumentParser;
use argparse::Store;
use argparse::StoreTrue;
use git2;
use git2::build::CheckoutBuilder;... |
/*
* Blue Engine by <NAME>
*
* The license is same as the one on the root.
*/
/// Will contain all details about a vertex and will be sent to GPU
// Will be turned to C code and sent to GPU
#[repr(C)]
#[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)]
pub struct Vertex {
/// Contains po... |
use heapless_bytes::Bytes;
use trussed::{
block,
Client as TrussedClient,
syscall,
types::{ObjectHandle, PathBuf, Location},
};
use crate::constants::*;
pub type Result<T> = core::result::Result<T, ()>;
pub enum Key {
Ed255(ObjectHandle),
P256(ObjectHandle),
X255(ObjectHandle),
}
pub enum... |
// Copyright 2016 Mozilla
//
// 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 writing, software... |
//! Reset and Clock Control (RCC) raw register interface.
use arm_m::reg::Reg;
/// The RCC's hardware register layout.
#[repr(C, packed)]
pub struct Registers {
pub cr: Reg<u32>,
pub pllcfgr: Reg<u32>,
pub cfgr: Reg<u32>,
pub cir: Reg<u32>,
/// AHB peripheral re... |
use crate::app::{App, ShowEverything};
use crate::common::{CityPicker, CommonState};
use crate::edit::EditMode;
use crate::game::{State, Transition, WizardState};
use crate::helpers::{nice_map_name, ID};
use crate::sandbox::gameplay::{GameplayMode, GameplayState};
use crate::sandbox::SandboxControls;
use crate::sandbox... |
use std::sync::{Arc, Weak};
use std::time::Duration;
use parking_lot::Mutex;
use parking_lot::MutexGuard;
use parking_lot::RwLock;
use rand::Rng;
use beserial::Serialize;
use block_base::Block;
use blockchain_base::{AbstractBlockchain, PushError, PushResult};
use hash::Blake2bHash;
use macros::upgrade_weak;
use mempo... |
use crate::data_structures::RcSlab;
use crate::sensors_and_pools::{
AndSensorAndPool, NoopSensor, TestFailure, TestFailurePool, TestFailureSensor, UnitPool, TEST_FAILURE,
};
use crate::signals_handler::set_signal_handlers;
use crate::traits::{CorpusDelta, Mutator, SaveToStatsFolder, SensorAndPool, Serializer};
use ... |
use crate::acme::ACMEIdentifier;
use http::StatusCode;
use serde::{Deserialize, Serialize};
use thiserror::Error;
use self::db::LoadError;
/// Mostly JWS-related errors
pub mod acme;
/// DB/model-related errors
pub mod db;
/// HandlerError is for encapsulating errors in HTTP handlers.
#[derive(Clone, Debug, Error)]
... |
//! This module contains a dedicated thread pool for running "cpu
//! intensive" workloads such as DataFusion plans
#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)]
#![warn(
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
clippy::explicit_iter_lo... |
//! USB Client driver.
use core::ptr;
use kernel::common::cells::{OptionalCell, VolatileCell};
use kernel::common::registers::{
register_bitfields, register_structs, LocalRegisterCopy, ReadOnly, ReadWrite, WriteOnly,
};
use kernel::common::StaticRef;
use kernel::debug;
use kernel::hil;
use kernel::hil::usb::Transf... |
use serde::de::DeserializeOwned;
use serde_json::{self as json, error::Result as JSONResult};
use super::*;
use crate::params;
use crate::test_util::*;
const BANNER: &str = "path/to/banner.jpg";
const POSTER: &str = "path/to/poster.png";
const FANART: &str = "path/to/fanart.gif";
const THUMB: &str = "path/to/thumbnai... |
use crate::types::{CharacterCodes, SyntaxKind};
use num_traits::FromPrimitive;
use wasm_bindgen::prelude::*;
const ABSTRACT: &'static str = "abstract";
const ANY: &'static str = "any";
const AS: &'static str = "as";
const BIGINT: &'static str = "bigint";
const BOOLEAN: &'static str = "boolean";
const BREAK: &'static s... |
//! CBM DOS files
use std::io::{self, Read, Write};
use crate::disk::bam::BAMRef;
use crate::disk::block::BlockDeviceRef;
use crate::disk::block::Location;
use crate::disk::block::Position;
use crate::disk::block::BLOCK_SIZE;
use crate::disk::chain::{self, ChainIterator, ChainLink, ChainReader, ChainWriter};
use crat... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 23/09/2018
Last Modified: 18/10/2019
License: MIT
*/
use self::na::Vector3;
use whitebox_common::algorithms::{point_in_poly, triangulate};
use crate::na;
use whitebox_raster::*;
use whitebox_common::structures::Point2D;... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 19/06/2017
Last Modified: 24/03/2022
License: MIT
*/
use kd_tree::{KdPoint, KdTree};
use whitebox_common::structures::Point3D;
use whitebox_lidar::*;
use whitebox_raster::*;
use crate::tools::*;
use std::env;
use std::f... |
#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(unused_variables)]
use crate::{BtcAddress, BtcRelayPallet, PolkaBtcProvider};
use async_trait::async_trait;
use bitcoin::{
secp256k1::{rand::rngs::OsRng, PublicKey, Secp256k1, SecretKey},
serialize, BitcoinCoreApi, Block, BlockHash, BlockHeader, Error as ... |
extern crate wasm_bindgen_test;
#[macro_use]
mod utils;
use wasm_bindgen_test::wasm_bindgen_test;
use fe_parser::builders::{
many0,
many1,
pair,
terminated,
};
use fe_parser::errors::ParseError;
use fe_parser::parsers::*;
use fe_parser::{
get_parse_tokens,
Cursor,
ParseResult,
};
use util... |
//! Module that deals with requests to /api/v2/canister/.../read_state
use crate::{
common::{
cbor_response, into_cbor, make_plaintext_response, make_response_on_validation_error,
},
state_reader_executor::StateReaderExecutor,
types::{to_legacy_request_type, ApiReqType},
HttpError, HttpHand... |
use crate::vm::*;
use alloc::vec;
use alloc::boxed::Box;
use crate::common::*;
use crate::exception::UserContext;
use crate::fs::file::*;
use core::mem::MaybeUninit;
use alloc::collections::vec_deque::VecDeque;
use alloc::vec::Vec;
mod elf;
static mut PROCESS_LIST: [*mut Process; 20] = [core::ptr::null_mut(); 20];
st... |
use std::fs::create_dir_all;
use std::path::Path;
use std::path::PathBuf;
use std::process::exit;
use std::process::Command;
use std::str::FromStr;
use std::sync::Mutex;
use clap::App;
use clap::AppSettings;
use clap::Arg;
use dialoguer::console::style;
use dialoguer::theme::ColorfulTheme;
use dialoguer::Confirm;
use ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.