text stringlengths 7.05k 33.9k |
|---|
use parking_lot::Mutex;
use pyo3::buffer::PyBuffer;
use pyo3::exceptions::{PyBufferError, PyOverflowError, PyValueError};
use pyo3::prelude::*;
use pyo3::types::{PyAny, PyBytes, PyString};
// This is the same as HASHLIB_GIL_MINSIZE in CPython.
const GIL_MINSIZE: usize = 2048;
unsafe fn unsafe_slice_from_buffer<'a>(py... |
use ast::{Signedness, Size};
use plank_errors::Reporter;
use position::{Position, Span, Spanned};
use std::str::Chars;
use tokens::{Keyword, Number, Token};
pub fn lex(source: &str, reporter: Reporter) -> Vec<Spanned<Token>> {
let mut lexer = Lexer::new(source, reporter);
let mut tokens = Vec::new();
while... |
//! # TS3
//! A fully asynchronous library to interact with the TeamSpeak 3 Server query interface.
//! The commands are avaliable after connecting to a TS3 Server using a [`Client`]. Commands
//! can either be sent using the associated command or using [`Client.sent`] to send raw messages.
//!
//! # Examples
//!
//! C... |
use crate::os::unix::prelude::*;
use crate::collections::BTreeMap;
use crate::ffi::{CStr, CString, OsStr, OsString};
use crate::fmt;
use crate::io;
use crate::ptr;
use crate::sys::fd::FileDesc;
use crate::sys::fs::File;
use crate::sys::pipe::{self, AnonPipe};
use crate::sys_common::process::CommandEnv;
#[cfg(not(targ... |
use alloc::vec::Vec;
use core;
use serial;
use cpu;
use realmode;
use realmode::SegOff;
const STATIC_KERNEL_BUFFER_SIZE: usize = 1024 * 1024;
/// List of PXE opcodes we support using
enum PXEOpcode<'a> {
/// PXE opcode for getting cached packets (and thus IP addresses)
GetCachedInfo(&'a mut PXENV_CACHED_INFO... |
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use seccomp::{
allow_syscall, allow_syscall_if, Error, SeccompAction, SeccompCmpOp::*,
SeccompCondition as Cond, SeccompFilter, SeccompRule, SECCOMP_LEVEL_ADVANCED,
SECCOMP_LEVEL_BASIC, SECCOMP... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved0: [u8; 2048usize],
#[doc = "0x800 - Configuration for shared functions."]
pub cfg: CFG,
#[doc = "0x804 - Status register for Master, Slave, and Monitor functions."]
pub stat: STAT,
#[doc = "0x808 - Interrupt Enable Set an... |
use std::{cell::Cell, collections::LinkedList, rc::Rc};
use gtk::prelude::*;
use once_cell::sync::OnceCell;
use parking_lot::RwLock;
use relm4::{
factory::{FactoryPrototype, FactoryVec},
ComponentUpdate, Model, Sender, WidgetPlus, Widgets,
};
use crate::{
app::{AppMessage, AppModel},
bridge::{MessageK... |
#![feature(destructuring_assignment)]
use curve25519_dalek::constants::RISTRETTO_BASEPOINT_POINT;
use curve25519_dalek::scalar::Scalar;
use rand::rngs::OsRng;
use curve25519_dalek::ristretto::RistrettoPoint;
use fasthash::xx;
use bytevec::ByteEncodable;
use std::ops::Add;
use permutation_iterator::{Permutor};
use cu... |
#[macro_use]
extern crate gluon_codegen;
#[macro_use]
extern crate gluon_vm;
#[macro_use]
extern crate serde_derive;
use std::{collections::HashMap, sync::Arc};
use gluon::{
base::types::{AppVec, ArcType, Type},
import, new_vm,
vm::{
self,
api::{
self,
generic::{A,... |
//! An iterator over incoming signals.
//!
//! This provides a higher abstraction over the signals, providing a structure
//! ([`Signals`](struct.Signals.html)) able to iterate over the incoming signals.
//!
//! In case the `tokio-support` feature is turned on, the [`Async`](struct.Async.html) is also
//! available, ma... |
extern crate dirs;
use crate::character;
use crate::character::enemy;
use crate::character::Character;
use crate::item::chest::Chest;
use crate::item::key::Key;
use crate::item::ring::Ring;
use crate::item::Item;
use crate::location::Location;
use crate::log;
use crate::quest;
use crate::quest::QuestList;
use crate::r... |
use crate::ast::*;
use crate::code_gen::CodeGen;
use crate::error;
use crate::error::Error;
use crate::hir::class_dict::ClassDict;
use crate::hir::hir_maker_context::*;
use crate::hir::method_dict::MethodDict;
use crate::hir::*;
use crate::library::LibraryExports;
use crate::names;
use crate::type_checking;
use ctx_sta... |
use std::collections::HashMap;
use std::convert::TryFrom;
use std::env;
use std::fs;
use std::path::Path;
use std::path::PathBuf;
use std::process::Command;
mod parse_mak;
extern crate bindgen;
extern crate cc;
pub fn run_command(which: &str, cmd: &mut Command) {
let msg = format!("Failed to execute {:?}", cmd);... |
use std::collections::VecDeque;
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::time::Duration;
use futures::{future, Stream};
use fxhash::FxHashMap;
use ntex::channel::oneshot;
use ntex::codec::{AsyncRead, AsyncWrite, Framed};
use ntex::task::LocalWaker;
use ntex::util::time::LowR... |
#![feature(min_specialization)]
use glsp::prelude::*;
use macroquad::prelude::*;
// draw wrappers
fn clear_background_wrapper(color: [u8; 4]) -> GResult<()> {
let c = color_u8!(color[0], color[1], color[2], color[3]);
clear_background(c);
Ok(())
}
fn draw_circle_wrapper(x: f32, y: f32, r: f32, color: [u... |
use csv;
#[macro_use]
use serde_derive::{Serialize};
use chrono::Local;
use clap::{App, AppSettings, Arg, ArgMatches};
#[cfg(not(feature = "local"))]
use discv5::{
enr::{CombinedKey, Enr, EnrBuilder, EnrError, NodeId},
Discv5, Discv5Config, Discv5ConfigBuilder, Discv5Event,
};
#[cfg(feature = "local")]
use disc... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 14/07/2017
Last Modified: 30/01/2020
License: MIT
*/
use crate::raster::*;
use crate::tools::*;
use num_cpus;
use rand::prelude::*;
// use rand::{Rng, SeedableRng};
use rand::thread_rng;
use rand_distr::StandardNormal;
... |
// Copyright (C) 2021 <NAME> <<EMAIL>>
// This file is subject to the terms and conditions defined in
// file 'LICENSE', which is part of this source code package.
use anyhow::Result;
use std::collections::HashSet;
use std::fmt;
use std::ops;
#[derive(Default, Copy, PartialEq, Eq, Hash, Clone, PartialOrd, Ord)]
pub s... |
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
use std::cmp;
use std::collections::BTreeMap;
use std::error::Error;
use std::fs::{self, File, OpenOptions};
use std::io::{Read, Write};
use serde::Deserialize;
use syn::{
AngleBracketedGenericArguments, Expr, ExprLit, GenericArgument... |
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![cfg(windows)]
extern crate winapi;
extern crate kernel32;
extern crate field_offset;
extern crate libc;
extern crate widestring;
extern crate log;
#[allow(unused_imports)]
use log::*;
use super::winffi;
use super::winffi::... |
mod build;
use crate::completions;
use crate::config::Configuration;
use crate::gen;
use crate::metadata::PackageMetadata;
use crate::opts::{Command, CopyObject, EditObject, ListObject, NewObject, Opts};
use crate::table::{Cell, IntoCell, IntoTable};
use pkger_core::docker::DockerConnectionPool;
use pkger_core::gpg::G... |
mod shader;
use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer, BufferSlice};
use vulkano::command_buffer::{AutoCommandBufferBuilder, DynamicState};
use vulkano::descriptor::descriptor_set::PersistentDescriptorSet;
use vulkano::descriptor::PipelineLayoutAbstract;
use vulkano::device::{Device, Queue};
use vulkano::... |
// Copyright (c) 2019 - 2020 ESRLabs
//
// 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 ... |
use lazy_static::lazy_static;
use regex::Regex;
use std::collections::HashSet;
pub trait SqlString {
fn sql_identifier(&self) -> Self;
fn sql_value(&self) -> Self;
}
impl SqlString for String {
fn sql_value(&self) -> Self {
format!(r#"'{}'"#, self)
}
fn sql_identifier(&self) -> Self {
... |
// Copyright The pipewire-rs Contributors.
// SPDX-License-Identifier: MIT
//! Dictionary types and traits.
use bitflags::bitflags;
// re-exported as used in the static_dict! macro implementation
pub use spa_sys::spa_dict_item;
use std::{ffi::CStr, fmt, marker::PhantomData, ptr};
/// Trait providing API to read dict... |
//! Messages within the I2P network.
//!
//! The I2P Network Protocol (I2NP), which is sandwiched between I2CP and the
//! various I2P transport protocols, manages the routing and mixing of messages
//! between routers, as well as the selection of what transports to use when
//! communicating with a peer for which ther... |
use super::sanitiser::{SanitisedString, VecSanitisedString};
use crate::{create_manager::Blob, models::Document};
use chrono::{SecondsFormat, Utc};
use regex::Regex;
use search_client::models::{DocumentType, IndexEntry, TerritoryType};
use std::{collections::HashMap, str};
#[derive(Clone, Debug, PartialEq)]
pub struct... |
//! The storage pass, which computes the stack and register allocations for a function.
use std::collections::{HashMap, HashSet, hash_map::Entry};
use crate::{Idx, Symbol};
use super::{VecPatch, Replace, types::{IdxVec, entity, mir, global}};
use entity::{Entity, ConstTc};
#[allow(clippy::wildcard_imports)] use mir::... |
use super::broadcast_utils::{self, ReceiveResults};
use super::*;
use crate::broadcast_stage::broadcast_utils::UnfinishedSlotInfo;
use solana_ledger::entry::Entry;
use solana_ledger::shred::{Shred, Shredder, RECOMMENDED_FEC_RATE, SHRED_TICK_REFERENCE_MASK};
use solana_sdk::pubkey::Pubkey;
use solana_sdk::signature::Key... |
use std::collections::{HashMap, HashSet};
use super::types::*;
use crate::error::Result;
use crate::services::helpers::*;
use crate::ursa::cl::{
issuer::Issuer as CryptoIssuer, prover::Prover as CryptoProver,
verifier::Verifier as CryptoVerifier, CredentialPublicKey,
RevocationRegistry as CryptoRevocationR... |
//
// MIT License
//
// Copyright (c) 2018-2019 Stegos AG
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, m... |
use crate::gpu::lcdc::Lcdc;
use crate::gpu::stat::{Mode, Stat};
use crate::gpu::SCREEN_WIDTH;
use crate::gpu::{Screen, BUFFER_SIZE};
use crate::memory::interrupts::Interrupt;
use crate::memory::mmu::{OAM_ADDRESS, VRAM_ADDRESS};
use crate::util::binary::is_bit_set;
use std::sync::Arc;
const V_RAM_SIZE: usize = 8192;
co... |
//! A young, simple and naive file crypto lib based on AES.
//! The MAC implementation is not standard GCM, so it may be vulnerable.
//!
//! Some references:
//! * [Finite field arithmetic](https://en.wikipedia.org/wiki/Finite_field_arithmetic)
//! * [Galois/Counter Mode](https://en.wikipedia.org/wiki/Galois/Counter_Mo... |
use crate::common::types::Error;
use crate::util::{RwLock, StopState};
use chrono::prelude::{DateTime, NaiveDateTime, Utc};
use rand::{thread_rng, Rng};
use std::collections::HashMap;
use std::sync::Arc;
use std::thread;
use std::time::Duration;
use crate::api;
use crate::chain;
use crate::core::consensus::reward;
use... |
// region: lmake_readme include "readme.md" //! A
//! **mem4_server - html and WebSocket server for the mem4 game**
//!
//! version: 19.9.9
//! Look also at the workspace readme https://github.com/LucianoBestia/mem4_game
//!
//! ## mem4_server
//! Primarily made for learning to code Rust for a http + WebSocket se... |
// Copyright 2019 Zhizhesihai (Beijing) Technology Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by a... |
use std::num::Wrapping;
use std::u16;
pub use euclid::{point2, size2};
pub type Point = euclid::default::Point2D<i32>;
pub type Size = euclid::default::Size2D<i32>;
pub type Rectangle = euclid::default::Box2D<i32>;
/// ID referring to an allocated rectangle.
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Has... |
use crate::base::intermediate_tuple;
use crate::base::partition;
use crate::base::EncodingPacket;
use crate::base::ObjectTransmissionInformation;
use crate::constraint_matrix::enc_indices;
use crate::constraint_matrix::generate_constraint_matrix;
use crate::encoder::SPARSE_MATRIX_THRESHOLD;
use crate::matrix::{BinaryMa... |
#![doc = include_str!("../doc/vt100.md")]
use crate::*;
use std::fmt::Display;
// Simple Cursor Positioning
// https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#simple-cursor-positioning
/// Reverse index - like `\n`, but goes up one line instead of down
pub fn reverse_index() -> ... |
use futures::sync::oneshot;
use futures::Future;
use hyper;
use hyper::{Body, Request, Response, Server};
use hyper::header::{ContentLength, ContentType};
use hyper::server::{Http, NewService, const_service, service_fn};
use serde::Serialize;
use serde_json;
use std::io;
use std::net::{ToSocketAddrs, TcpStream};
use st... |
use nes_ui_base::{
nes_controller::{StandardNESControllerState, StandardNESKey},
nes_display::{Color as NESColor, TV_HEIGHT, TV_WIDTH},
BackendEvent, UiEvent, UiProvider,
};
use std::cell::Cell;
use std::sync::{
atomic::AtomicBool,
atomic::Ordering,
mpsc::{Receiver, Sender},
Arc, Mutex,
};
... |
#[allow(unused_macros)]
macro_rules! warn {
($fmt:literal $(,$arg:expr)*) => {
println!(concat!("cargo-warning=", $fmt) $(,$arg)*)
};
}
pub fn main() {
let mut cc_builder = cc::Build::new();
cc_builder.cpp(false).define("MINIAUDIO_IMPLEMENTATION", "");
// This removes an annoying unused fu... |
//! A library for parsing variable font designspace files
#![warn(missing_docs, missing_crate_level_docs)]
use std::collections::HashMap;
use std::fs::File;
use std::path::Path;
use fonttools::otvar::{Location as OTVarLocation, NormalizedLocation, VariationModel};
use fonttools::tag;
use fonttools::types::Tag;
use s... |
use std::fmt;
use std::cmp;
use std::str::FromStr;
use std::convert::TryFrom;
const UNDEFINED: &[char] = &['u', 'n', 'd', 'e', 'f', 'i', 'n', 'e', 'd'];
const NULL: &[char] = &['n', 'u', 'l', 'l'];
const TRUE: &[char] = &['t', 'r', 'u', 'e'];
const FALSE: &[char] = &['f', 'a', 'l', 's', 'e'];
const NAN:... |
//! Datatype specification.
use strum::IntoEnumIterator;
use strum_macros::EnumIter;
/// Sum type for all possible data types ever defined across all versions of the
/// FIX protocol.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, EnumIter)]
#[non_exhaustive]
pub enum DataType {
/// Single character value, can... |
use crate::fs::FileSystem;
use std::{
io::{self, BufRead, Cursor},
path::Path,
process::{Command, Stdio},
};
/// Executes a given file system's dump command to obtain the minimum shrink
/// size
pub fn sectors_used<P: AsRef<Path>>(part: P, fs: FileSystem) -> io::Result<u64> {
use self::FileSystem::*;
... |
use crate::errors::CreateEncoderError;
use crate::errors::CreateEncoderErrorKind;
use crate::internal::graphics::depth_image::DepthImage;
use arrayvec::ArrayVec;
use colored::*;
use failure::Error;
use gfx_hal::command::ClearColor;
use gfx_hal::command::ClearDepthStencil;
use gfx_hal::command::ClearValue;
use gfx_hal::... |
#[macro_use]
extern crate diesel;
mod db;
mod game_room;
mod schema;
mod server;
use std::collections::HashMap;
use std::time::{Duration, Instant};
use actix::prelude::*;
use actix_web::{middleware, web, App, Error, HttpRequest, HttpResponse, HttpServer};
use actix_web_actors::ws;
use crate::server::GameServer;
use... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Controls the operating mode of the CAN Controller."]
pub mod_: MOD,
#[doc = "0x04 - Command bits that affect the state of the CAN Controller"]
pub cmr: CMR,
#[doc = "0x08 - Global Controller Status and Error Counters. T... |
#![allow(dead_code)]
use super::constant;
use super::lookup::missing_method;
use super::objects::{TCObjects, TypeKey};
use super::typ;
use super::typ::{fmt_type, BasicType, Type};
use super::universe::{Builtin, Universe};
use goscript_parser::ast;
use goscript_parser::ast::*;
use goscript_parser::objects::{FuncTypeKey,... |
use std::collections::{HashMap, VecDeque};
use std::future::Future;
use std::ops::Range;
use std::pin::Pin;
use std::task::{Context, Poll};
use ethers::prelude::Middleware;
use ethers::types::{
Block, BlockNumber, Filter, Log, Trace, Transaction, TransactionReceipt, TxHash, U256,
};
use futures::{
stream::{sel... |
mod group_files_list_widget;
mod group_list_widget;
mod popup;
mod selectable_state;
mod track_table_widget;
use crate::command::Command;
use crate::file::File;
use crate::group::{groupby, key_audlang_audname, key_sublang_subname};
use crate::ui::popup::{CommandRunnerPopup, MessagePopup, PopupRender};
use self::popup:... |
use std::fmt;
use std::vec::Vec;
use std::boxed::Box;
use rand::Rng;
#[derive(Copy, Clone)]
struct Vec3 {
x: f64,
y: f64,
z: f64
}
impl Vec3 {
fn length_squared(self) -> f64 {
self.x*self.x + self.y*self.y + self.z*self.z
}
fn length(self) -> f64 { self.length_squared().sqrt() }
fn... |
use anyhow::Result;
use bumpalo::Bump;
use fnv::{FnvHashMap, FnvHashSet};
use goblin::elf64::{
section_header::{SHF_ALLOC, SHF_EXECINSTR, SHT_PROGBITS},
sym::STB_LOCAL,
};
use petgraph::{
graph::{DiGraph, NodeIndex},
visit::{Dfs, Visitable},
};
use serde::{Deserialize, Serialize};
use crate::{
linker::{
... |
// 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
//! Widget styling
//!
//! Widget size and appearance can b... |
//! Files, and methods and fields to access their metadata.
use std::fs;
use std::io::Error as IOError;
use std::io::Result as IOResult;
use std::os::unix::fs::{MetadataExt, PermissionsExt, FileTypeExt};
use std::path::{Path, PathBuf};
use fs::dir::Dir;
use fs::fields as f;
/// A **File** is a wrapper around one of... |
//! Implements an in-memory `Terminal` interface
//!
//! The main purpose of the in-memory terminal is for internal testing
use std::cmp::min;
use std::iter::repeat;
use std::io;
use std::sync::{Arc, Mutex, MutexGuard};
use std::time::Duration;
use crate::terminal::{
CursorMode, RawRead, SignalSet, Size,
Term... |
//! WebAssembly trap handling, which is built on top of the lower-level
//! signalhandling mechanisms.
use crate::VMInterrupts;
use backtrace::Backtrace;
use std::any::Any;
use std::cell::Cell;
use std::error::Error;
use std::ptr;
use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
use std::sync::Once;
use wasmtim... |
use crate::*;
#[doc(hidden)]
pub use egui;
///
/// Integration of [egui](https://crates.io/crates/egui), an immediate mode GUI.
///
pub struct GUI {
context: Context,
egui_context: egui::CtxRef,
width: usize,
height: usize,
program: Program,
texture_version: u64,
texture: Option<Texture2D>,... |
// Copyright (c) 2019-2020, 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 with this source code in the LICENSE file, you can
// obtain it at ... |
//! The `OctreeSet` type is a memory-efficient set of points.
//!
//! The typical workflow for using an `Octree` is to construct it from an `Array3`, then insert it
//! into an `OctreeDBVT` in order to perform spatial queries like raycasting.
//!
//! `OctreeSet` supports two modes of traversal. One is using the vi... |
// 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... |
//! Low-level, unsafe Rust bindings for the [`Capstone`][capstone] disassembly library.
//!
//!
//! We recommend against using this crate directly.
//! Instead, consider using [capstone-rs], which provides a high-level, safe, "Rusty" interface.
//!
//! [capstone]: https://github.com/aquynh/capstone
//! [capstone-rs]: h... |
#![cfg(test)]
#![deny(rust_2018_idioms, warnings)]
#![deny(clippy::all, clippy::pedantic)]
#![allow(
clippy::default_trait_access,
clippy::indexing_slicing,
clippy::must_use_candidate,
clippy::unseparated_literal_suffix,
)]
use k8s_openapi::{http, serde_json};
#[derive(Debug)]
enum Client {
Recording {
inner:... |
use crate::bcf::report::table_report::fasta_reader::{get_fasta_lengths, read_fasta};
use crate::bcf::report::table_report::static_reader::{get_static_reads, Variant};
use crate::common::Region;
use anyhow::anyhow;
use anyhow::Context as AnyhowContext;
use anyhow::Result;
use chrono::{DateTime, Local};
use itertools::It... |
// 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... |
//! x86_64 syscall ids
//! Reference: https://git.musl-libc.org/cgit/musl/tree/arch/x86_64/bits/syscall.h.in
pub const SYS_READ: usize = 0;
pub const SYS_WRITE: usize = 1;
pub const SYS_OPEN: usize = 2;
pub const SYS_CLOSE: usize = 3;
pub const SYS_STAT: usize = 4;
pub const SYS_FSTAT: usize = 5;
pub const SYS_LSTAT: ... |
use crate::{
format::{self, Format},
keypair::{KeyTag, Keypair, PublicKey},
mnemonic::{mnemonic_to_entropy, SeedType},
pwhash::PwHash,
result::{anyhow, bail, Result},
traits::ReadWrite,
};
use aes_gcm::{
aead::{generic_array::GenericArray, NewAead},
AeadInPlace, Aes256Gcm,
};
use byteord... |
use std::mem;
use std::ops::Range;
use std::cmp::Ordering;
use std::marker::PhantomData;
use std::collections::BTreeMap;
use crate::idx::Idx;
use crate::qty::MocQty;
use crate::elemset::range::MocRanges;
use crate::moc::{
range::RangeMOC,
};
use crate::moc2d::{
RangeMOC2Elem, RangeMOC2,
};
// While cell_2 list i... |
// 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... |
// Copyright 2020-2021 <NAME>
// SPDX-License-Identifier: Apache-2.0
use crate::{
config::TangleConfig,
metadata::{IndexId, MessageMetadata},
solid_entry_point::SolidEntryPoint,
storage::StorageBackend,
urts::UrtsTipPool,
vertex::Vertex,
vertices::Vertices,
MessageRef,
};
use bee_messa... |
use three_d::camera::CameraControl;
use three_d::frame::FrameInput;
use three_d::frame::{Event, MouseButton, State};
use three_d::gui::GUI;
use three_d::egui::{Window, Button, CollapsingHeader};
use three_d::math::{Vec2, InnerSpace};
use log::info;
use crate::viewport_geometry::{ViewportGeometry, PixelCoords, WorldCo... |
pub mod watch_client;
use self::watch_client::{ClientConfig, PodEvent, RuntimeError, Version, WatchClient};
use super::Transform;
use crate::{
event::{self, Event, Value},
sources::kubernetes::POD_UID,
topology::config::{DataType, TransformConfig, TransformContext, TransformDescription},
};
use bytes::Byte... |
/// Basic graph data structure
/// - source: http://smallcultfollowing.com/babysteps/blog/2015/04/06/modeling-graphs-in-rust-using-vector-indices/
use std::collections::HashSet;
type NodeIndex = usize;
#[derive(Debug, PartialEq)]
struct NodeData {
first_outgoing_edge: Option<EdgeIndex>,
first_incoming_edge: ... |
// Copyright 2018 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... |
//! # The Virtual Machine
//!
//! Abstractions for the EVM runtime.
//!
//! This module contains types that abstract away implementation details from the `evm` crate,
//! specially those involving node and stack configurations, and runtime execution.
//!
//! ## Handler <- EVM Context Handler
//! ## StackState<'config>
... |
use core::fmt;
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::fmt::Debug;
use std::process::exit;
use std::time::{Duration, Instant};
use async_std::{task, task::JoinHandle};
use core_bluetooth::{central::{*,
characteristic::{Characteristic, WriteKind},
... |
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate tablestream;
use std::fs::File;
use std::io::{Read, Write};
use std::path::Path;
use std::str::FromStr;
use std::sync::Arc;
use clap::{App, Arg, ArgMatches, SubCommand};
use tokio::runtime::Runtime;
use tracing::dispatcher::set_global_default;
use tra... |
use nihav_core::codecs::*;
pub const VP_YUVA420_FORMAT: NAPixelFormaton = NAPixelFormaton{
model: ColorModel::YUV(YUVSubmodel::YUVJ),
components: 4,
comp_info: [
Some(NAPixelChromaton{ h_ss: 0, v_ss: 0, packed: false, depth: 8, shift: 0, comp_offs: 0, next_elem: 1}),
... |
//! A version of NSView that draws using Metal
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
use objc::class;
use objc::sel;
use objc::sel_impl;
use objc::msg_send;
use std::os::raw::c_double;
use objc::{Encode, Encoding};
use crate::renderer::Renderer;
use cocoa::base::{id, nil};
use objc::declare... |
use std::result;
use std::cmp;
use ecs::*;
use game::*;
use game::data::*;
use game::frontends::ansi::resolve_tile;
use frontends::ansi::{self, ComplexTile, SimpleTile, AnsiColour, Style};
use coord::Coord;
use colour::Rgb24;
const TEAR_COLOUR: ansi::AnsiColour = ansi::colours::MAGENTA;
const AIM_LINE_COLOUR: ansi::A... |
use crate::error::Error;
use byteorder::{WriteBytesExt, LE};
use failure::Backtrace;
use std::cell::RefCell;
use std::fs::{self, File};
use std::io::{self, Cursor, Write};
use std::mem;
use std::path::{Path, PathBuf};
use std::rc::{Rc, Weak};
#[derive(Debug)]
struct RomFsDirEntCtx {
// Only used in `RomFs::from_di... |
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PinyinToken {
Alph(AlphabetWithDiacritics),
LightToneMarker,
Punctuation(String),
Apostrophe,
Space(String),
Others(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Diacritic {
Umlaut, /* ü */
Macron, /* fist t... |
#![allow(unused)]
#[cfg(no_std)]
use core::mem;
#[cfg(not(no_std))]
use std::mem;
#[cfg(no_std)]
use alloc::format;
#[cfg(not(no_std))]
use std::format;
use std::borrow::Cow;
use quote::{quote, quote_spanned};
use syn::{parse::Parse, parse::ParseStream, parse::Parser, spanned::Spanned};
use crate::attrs::{ExportIn... |
/** References: https://www.masswerk.at/6502/6502_instruction_set.html
*/
use take_mut;
use yaxpeax_arch::{AddressDiff, Arch, Decoder, LengthedInstruction};
mod display;
#[derive(Debug)]
pub struct N6502;
impl Arch for N6502 {
type Address = u16;
type Instruction = Instruction;
type DecodeError = DecodeE... |
use crate::character::AttackType;
use crate::character::{Character, StatusEffect};
use crate::game::Game;
use crate::item::key::Key;
use crate::location::Location;
use colored::*;
use once_cell::sync::OnceCell;
use std::collections::HashMap;
// This are initialized based on input args and then act as constants
// this... |
//use super::traits::Verify;
use crate::structs::{Kong, Cors, BabylonAuthHeader, Authentication};
use crate::region::{KongConfig};
use crate::{Region};
use std::collections::BTreeMap;
use serde::ser::{Serialize, Serializer, SerializeMap};
/// Kongfig structs
/// https://github.com/mybuilder/kongfig
#[derive(Serialize,... |
//! SSD1306 OLED display driver.
//!
//! This crate provides a driver interface to the popular SSD1306 monochrome OLED display driver. It
//! supports I2C and SPI via the [`display_interface`](https://docs.rs/display_interface) crate.
//!
//! The main driver is created using [`Ssd1306::new`] which accepts an interface ... |
use crate::util::*;
use aliu::{AllocExt, Allocator};
use core::include_bytes;
use core::{fmt, mem, str};
/// The column index at the given byte index in the source file.
/// This is the number of characters to the given byte index.
///
/// If the byte index is smaller than the start of the line, then `0` is returned.
... |
// Copyright 2021 - <NAME> <<EMAIL>>
// SPDX-License-Identifier: Apache-2.0
use crate::network_monitor::monitor::gateway_clients_cache::{
ActiveGatewayClients, GatewayClientHandle,
};
use crate::network_monitor::monitor::gateways_pinger::GatewayPinger;
use crate::network_monitor::monitor::receiver::{GatewayClientU... |
#![allow(dead_code)] // XXX
use crate::windows::*;
use crate::windows::monitor::MonitorInfo;
use wchar::wch_c;
use winapi::shared::minwindef::*;
use winapi::shared::windef::*;
use winapi::um::processthreadsapi::*;
use winapi::um::winuser::*;
use std::any::{Any, TypeId};
use std::cell::*;
use std::cmp::Ordering;
use... |
#![warn(missing_docs)]
//! Generate JWTs signed using NKEYs for use with [NATS](https://nats.io)
//!
//! Supports generating account and user JWTs, operator JWTs are not typically generated on the fly
//! and so aren't supported, although a PR adding support would be accepted.
//!
//! ## Example
//!
//! ```
//! use na... |
use crate::ConversionOptions;
use crate::Krate;
use regex::Regex;
use std::borrow::Cow;
use std::path::{Component, Path};
pub fn link_parts<'a>(
path: &'a Path,
opts: &ConversionOptions,
) -> Result<LinkParts<'a>, &'a std::ffi::OsStr> {
favored_parts(path, opts)
.or_else(|| start_middle_end(path, ... |
use crate::bus::Bus;
use crate::ram::Ram;
use rand::Rng;
use std::fmt;
pub struct Cpu {
pub ram: Ram,
pub pc: usize,
pub v: [u8; 16],
pub i: usize,
stack: Vec<usize>,
delay_timer: u8,
sound_timer: u8,
draw_flag: bool,
// paused: bool,
}
impl Cpu {
pub fn new(rom_buffer: &[u8]) -... |
#![forbid(unsafe_code)]
use std::io::{Cursor, Result, Write};
use std::ops::Range;
use bzip2::Compression;
use bzip2::write::BzEncoder;
use rayon::prelude::*;
pub use suffix_array::MAX_LENGTH;
use suffix_array::SuffixArray;
use super::utils::*;
/// Default threshold to determine small exact match.
pub const SMALL_M... |
//! Code for loading wordnets from disk
use omwn::load_omwn;
use std::collections::HashMap;
use std::fs::{File};
use std::io::{BufRead,BufReader};
use std::path::Path;
use xml::reader::{EventReader, XmlEvent};
use links::{load_links};
use wordnet::{WordNetLoadError,WordNetBuilder,WNKey, WordNet};
use wordnet_model::{Se... |
use primitive_types::U256;
use arrayref::{array_ref, array_mut_ref, mut_array_refs};
use std::mem::size_of;
use solana_program::program_error::ProgramError;
/*
#[derive(Debug)]
enum ProgramError {
InvalidAccountData,
AccountDataTooSmall,
}*/
/*
#[repr(C)]
#[derive(Serialize,Deserialize,Debug)]
struct HamtHead... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#![feature(drain_filter)]
use anyhow::{bail, format_err, Context, Error, Result};
use catnip::{
libos::LibOS,
logging,
operations::OperationResult,
protocols::ipv4,
protocols::{ethernet2::MacAddress, ip::Port, ipv4::Endpoin... |
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
// #![deny(warnings)]
#![allow(dead_code)]
extern crate dissimilar;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
extern crate futures;
#[macro_use]
extern crate serde_json;
extern crate clap;
extern crate deno_core;
ext... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.