text
stringlengths
7.05k
33.9k
// wengwengweng use std::rc::Rc; use std::collections::HashMap; use std::collections::HashSet; use glow::HasRenderLoop; use wasm_bindgen::JsCast; use wasm_bindgen::closure::Closure; use crate::*; use math::*; use input::*; use window::*; // TODO: gamepad input /// The Window Context pub struct Window { gl: Rc<glo...
/* Copyright (c) 2020 <NAME> LICENSE: BSD3 (see LICENSE file) */ use p_hal::stm32 as pac; use stm32f4xx_hal as p_hal; use pac::{DCMI, RCC}; use embedded_hal::blocking::delay::{DelayMs, DelayUs}; use embedded_hal::digital::v2::{OutputPin, ToggleableOutputPin}; use embedded_hal::timer::CountDown; use embedded_hal::Pwm...
//! CLI tool to use the functions provided by the [wasmtime](../wasmtime/index.html) //! crate. //! //! Reads Wasm binary files (one Wasm module per file), translates the functions' code to Cranelift //! IL. Can also execute the `start` function of the module by laying out the memories, globals //! and tables, then emi...
mod error; mod passphrase; mod util; use std::collections::hash_map::Entry; use std::collections::HashMap; use std::ffi::OsStr; use std::fmt; use std::fs; use std::path::{Path, PathBuf}; use std::time::{Duration, Instant}; use super::bip32::{ChainCode, ChildNumber, DerivationPath, ExtendedPrivKey, ExtendedPubKey}; us...
//! A builder for a Fletcher-like algorithm. //! //! The basic functionality of this algorithm is: //! * there is a sum which is just the bytes summed modulo some number //! * there is also a second sum which the sum of all of the normal sums (modulo the same number) //! //! Note that text word sizes are currently only...
mod access; mod asgi; use std::net::SocketAddr; use std::net::ToSocketAddrs; #[cfg(unix)] use std::os::unix::prelude::FromRawFd; #[cfg(windows)] use std::os::windows::prelude::FromRawSocket; use std::path::PathBuf; use std::pin::Pin; use std::str::FromStr; use hyper::header::HeaderName; use hyper::header::HeaderValue...
use crate::cdsl::ast::{Def, DefIndex, DefPool, Var, VarIndex, VarPool}; use crate::cdsl::typevar::{DerivedFunc, TypeSet, TypeVar}; use std::collections::{HashMap, HashSet}; use std::iter::FromIterator; #[derive(Debug, Hash, PartialEq, Eq)] pub(crate) enum Constraint { /// Constraint specifying that a type var tv1...
mod add_sub_loop; mod associative_ops; mod canonicalize; mod const_folding; mod copy_cell; mod dataflow; mod dce; mod eliminate_const_gamma; mod equality; mod expr_dedup; mod fold_arithmetic; mod fuse_io; mod licm; mod mem2reg; mod move_cell; mod scan_loops; mod square_cell; mod symbolic_eval; mod unobserved_store; mod...
//! Set and unset common attributes on LLVM values. use rustc_codegen_ssa::traits::*; use rustc_data_structures::small_str::SmallStr; use rustc_hir::def_id::DefId; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc_middle::ty::{self, TyCtxt}; use rustc_session::config::OptLevel; use rustc_target...
//! Reset and Clock Control (RCC) support. //! //! This module provides a higher-level driver with some useful algorithms. For //! more direct access to the hardware, see the `raw` submodule. use arm_m; use arm_m::reg::AtomicReg; use super::flash::FLASH; pub mod raw; pub use self::raw::{AhbPrescaler, ApbPrescaler, C...
extern crate proc_macro; use proc_macro::TokenStream; use proc_macro2::{Span, TokenStream as TokenStream2}; use quote::quote; use std::collections::BTreeMap; use std::error::Error; use syn::{parse_macro_input, DeriveInput, Ident, LitStr, Type}; #[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)] enum Query ...
use std::collections::hash_map::Entry as HEntry; use std::collections::HashMap; use std::error::Error as StdError; use std::ffi::OsStr; use std::fs::{self, File}; use std::hash::{Hash, Hasher}; use std::path::{Path, PathBuf}; use std::{collections::hash_map::DefaultHasher, io::Write}; use image::error::ImageResult; us...
//! # `derive_more` //! //! [![Build Status](https://github.com/JelteF/derive_more/workflows/CI/badge.svg)](https://github.com/JelteF/derive_more/actions) //! [![Latest Version](https://img.shields.io/crates/v/derive_more.svg)](https://crates.io/crates/derive_more) //! [![Rust Documentation](https://img.shields.io/badg...
use crate::program::typing::registry::TypeRegistry; use crate::program::typing::templates::TypeTemplateId; use crate::program::{Field, Function, Program, SymbolId, TraitId, TraitRef, TypeTemplate}; use crate::scope::{ AddError, FieldEntity, LookupError, MethodEntity, Scope, TypeMemberEntity, TypeScope, }; use crate...
use { super::{amf0_markers, errors::Amf0ReadErrorValue, Amf0ReadError, Amf0ValueType}, byteorder::BigEndian, // bytes::BytesMut, bytesio::bytes_reader::BytesReader, std::collections::HashMap, }; pub struct Amf0Reader { reader: BytesReader, } impl Amf0Reader { pub fn new(reader: BytesReader...
use std::{sync::{Arc, atomic::{AtomicU8, AtomicI16, AtomicBool, Ordering as AtomicOrdering, AtomicU32}}, cmp::Ordering, iter::Rev, thread, time::Duration}; use crossbeam::{channel::{Sender, Receiver, unbounded}, atomic::AtomicCell}; use crate::{engine::{evaluation::Evaluator, scores::{best_score, is_better}}, util::{...
#[naked] #[no_mangle] #[link_section = ".text.startup"] unsafe extern "C" fn _start() { const TCR_T0SZ: usize = (64 - 48) << 0; const TCR_T1SZ: usize = (64 - 48) << 16; const TCR_TG0_4K: usize = 0 << 14; const TCR_TG1_4K: usize = 2 << 30; const TCR_A1: usize = 0 << 22; // Use TTBR0_EL1.ASID as ASID ...
// 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 ...
//! Artifact related types. //! //! Notably it includes the following definitions and their sub-types: //! //! - [`Artifact`] //! - [`ArtifactTag`] //! - [`ArtifactId`] //! - [`ArtifactAttribute`] //! - [`ArtifactFilter`] //! //! An [`ArtifactKind`] trait is provided for convenience to carry multiple type //! definitio...
#![allow(non_snake_case)] #![allow(clippy::too_many_arguments)] use std::fs; use std::path::Path; use std::cell::RefCell; use std::sync::{Arc, Mutex}; use neon::prelude::*; use rayon::prelude::*; use crc::{crc32, Hasher32}; use skia_safe::{Rect, Matrix, Path as SkPath, Picture, PictureRecorder, Size, Cl...
pub mod discord; pub mod http_proxy; pub mod voice_chat; use anyhow::Context; use futures::stream::FuturesUnordered; use futures::StreamExt; use tokio::fs::{File, self, OpenOptions}; use std::collections::HashMap; use std::collections::hash_map::Entry; use std::error::Error; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr,...
//! Transaction builder //! //! The process to build a transaction: //! //! 1. Gather the Payload (Extra) to use, or NoExtra for a plain transaction //! 2. Add inputs and outputs whilst looking at the fees //! 3. Seal the transaction //! 4. Add witnesses for each inputs //! 5. Finalize //! use crate::certificate::Cert...
// Copyright © 2018 <NAME>. // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software // and associated documentation files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, copy, modify, merge, publish, // distrib...
// Copyright 2019-2021 Parity Technologies (UK) 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 rights to use, copy, mod...
// Copyright (c) 2018 <NAME> // [This program is licensed under the "MIT License"] // Please see the file LICENSE in the source // distribution of this software for license terms. use gfx_device_gl; use image::*; use piston_window; use piston_window::PistonWindow as Window; use piston_window::Texture; use piston_windo...
mod kdi; use env_logger::{Builder, Target}; use gtfs_structures::Gtfs; use kdi::enums::KdiFareEnum; use log::{debug, info, LevelFilter}; use serde_json::json; use serde_xml_rs::{self}; use std::collections::{HashMap, HashSet}; use std::error::Error; use std::fs::{self, File}; use strum::VariantNames; use zip::ZipArchi...
//! //! //! This module contains specific libc Linux system calls to be performed when //! calling into [crate::platforms] on a Linux OS. use cfg_if::cfg_if; use cstr::cstr; use nix::{ errno::Errno, fcntl::{open, OFlag}, ioctl_read, libc::{STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO}, sys::{ ...
use serde_json; use tera::Context; use fall_tree::{Text, AstNode}; use lang_fall::syntax::{FallFile, SynRule, LexRule, Expr, BlockExpr, MethodDef, Parameter}; use lang_fall::{RefKind, CallKind, MethodKind, Analysis, PratVariant, PrattOp, Arity, ChildKind}; use fall_parse as dst; use crate::ut...
// License and Copyright Notice: // // Some of the code and doc comments in this module were copied from // `std::collections::LinkedList` in the Rust standard library. // https://github.com/rust-lang/rust/blob/master/src/liballoc/collections/linked_list.rs // // The original code/comments from LinkedList are dual-lice...
// 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 (c) 2017 <NAME>, RWTH Aachen University // 2018 <NAME>, RWTH Aachen University // // MIT License // // 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 restr...
// Copyright (c) 2019-2021 Dropbox, Inc. //! Helpers for requesting OAuth2 tokens. //! //! OAuth2 has a few possible ways to authenticate, and the right choice depends on how your app //! operates and is deployed. //! //! For an overview, see the [Dropbox OAuth Guide]. //! //! For quick recommendations based on the ty...
use super::scope::*; use serde::{Deserialize, Serialize}; /// Solana blockchain limit amount of data that transaction can have. /// To get around this limitation, we use design that is similar to LoaderInstruction in sdk. #[derive(Debug, PartialEq, Eq, Ord, PartialOrd, Serialize, Deserialize)] pub enum EvmBigTransact...
use std::io; use std::sync::PoisonError; use libnx_rs::LibnxError; use scsi::ScsiError; use mbr_nostd::MbrError; pub const SUCCESS : u32 = 0; pub const NX_FATDRIVE_ERR_MODULE : u32 = 0xFA; pub const NX_FATDRIVE_ERR_NOT_IMPLEMENTED : u32 = 0x1FA; pub const NX_FATDRIVE_ERR_NOT_INITIALIZED : u32 = 0x2FA; pub const NX_...
//! **rootrenderingmod - Root Rendering Component is the base struct for Dodrio Virtual Dom** //! rrc contains all the data needed for UI and reacts to all the events of the UI. //! Other subcomponents can be more or less smart, with or without their own data, //! but that data are only copied values from the rrc c...
use crate::cache::{CacheEntry, CacheKey}; use crate::config::ServerType; use crate::context::Context; use crate::error::Result; use crate::forwarder::Forwarder; use crate::recursor::Recursor; use crate::sandbox::Sandbox; use crate::tracing; use crate::varz; use bytes::{Bytes, BytesMut, BufMut}; use domain_core::bits::*...
use std::cell::UnsafeCell; use std::fmt; use std::marker::PhantomData; use std::mem::{self, ManuallyDrop, MaybeUninit}; use std::ops::{Deref, DerefMut}; use std::ptr; use std::sync::{ atomic::{self, AtomicUsize, AtomicBool, Ordering::*}, Arc, Condvar, // Mutex, }; // use crossbeam::epoch::{self, Atomic...
// // Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved. // // 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 // // Module for...
//! Representation and parsing for osu! binary formats: beatmap listing, collections, replays and //! scores. //! //! # A note on strings //! //! The osu `.db` file format allows for strings to be absent. //! This notably happens with the unicode versions of titles and authors. //! For this reason all of the parsed str...
use std::fmt::{Display, Formatter}; // SPDX-License-Identifier: BSD-2-Clause /* * request.rs - Types wrapping messages into requests and responses. * Copyright (c) 2022 The NAMIB Project Developers, all rights reserved. * See the README as well as the LICENSE file for more information. */ use std::str::FromStr; us...
use num_bigint::traits::ModInverse; use num_bigint::Sign::Plus; use num_bigint::{BigInt, BigUint, RandBigInt}; use num_traits::{FromPrimitive, One, Signed, Zero}; use rand::{Rng, ThreadRng}; use algorithms::generate_multi_prime_key; use errors::{Error, Result}; use hash::Hash; use padding::PaddingScheme; use pkcs1v15;...
use crate::{ shipyard::{ *, }, consts::{ *, }, tetra::{ math::{ Vec3, Vec2, }, graphics::{ Color, }, }, }; use vermarine_lib::{ rendering::{ draw_buffer::{ DrawBuffer, DrawCom...
#![allow(non_snake_case)] #![allow(clippy::identity_op)] use crate::aarch64::{ mair, tcr_size, MT_DEVICE_nGnRE, MT_DEVICE_nGnRnE, MT_DEVICE_GRE, MT_NORMAL, MT_NORMAL_NC, PSR, TCR_FLAGS, TCR_TG1_4K, VA_BITS, }; use crate::consts::*; use crate::vm::HypervisorResult; use crate::vm::SysExit; use crate::vm::VcpuStopReaso...
/* * Nim * Originally from the wonderful book: _Basic Computer Games_ * Port to Rust By <NAME> */ use nanorand::{tls::TlsWyRand, Rng}; use std::io::{self, Write}; use text_io::{read, try_read}; /// Play Nim // line numbers from the orginal Basic program are in the end of line comments. // If you see two number com...
// 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. //! This module defines a `PairingDispatcher`, a struct for delegating pairing requests from //! multiple downstream hosts to a single upstream `PairingDel...
extern crate llvm_sys as llvm; use self::llvm::core::*; use self::llvm::prelude::*; use crate::node; use crate::types; /* use self::llvm::execution_engine; use self::llvm::target::*; use llvm::execution_engine::LLVMCreateExecutionEngineForModule; use llvm::execution_engine::LLVMDisposeExecutionEngine; use llvm::executi...
#![cfg(feature = "vector-tests")] #[macro_use] extern crate serde_derive; #[macro_use] extern crate failure; extern crate hex; extern crate snow; extern crate serde; extern crate serde_json; extern crate rand; use serde::de::{self, Deserialize, Deserializer, Visitor, Unexpected}; use serde::ser::{Serialize, Serialize...
use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_and_then}; use clippy_utils::source::snippet_opt; use clippy_utils::ty::{implements_trait, is_type_diagnostic_item}; use clippy_utils::{eq_expr_value, get_trait_def_id, paths}; use if_chain::if_chain; use rustc_ast::ast::LitKind; use rustc_errors::Applicabil...
//! A library to connect the local MQTT bus, publish messages and subscribe topics. //! //! ```no_run //! use mqtt_client::{Config,Message,Topic}; //! //! #[tokio::main] //! async fn main (){ //! let mqtt = Config::default().connect("temperature").await.unwrap(); //! let c8y_msg = Topic::new("c8y/s/us").unwrap(...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Start UART receiver"] pub tasks_startrx: crate::Reg<tasks_startrx::TASKS_STARTRX_SPEC>, #[doc = "0x04 - Stop UART receiver"] pub tasks_stoprx: crate::Reg<tasks_stoprx::TASKS_STOPRX_SPEC>, #[doc = "0x08 - Start UART tran...
// The MIT License (MIT) // Copyright (c) 2015 <NAME> <<EMAIL>> // 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, co...
//! The "ssh-rsa" and "ssh-ed25519" recipient types, which allow reusing existing SSH keys //! for encryption with age-encryption.org/v1. //! //! These recipient types should only be used for compatibility with existing keys, and //! native X25519 keys should be preferred otherwise. //! //! Note that these recipient ty...
// Ideally this would be scoped to WidgetId, but I can't seem to find the // right place for it to take effect #![allow(clippy::new_without_default)] use crate::color::ColorAttribute; use crate::input::InputEvent; use crate::surface::{Change, CursorShape, Position, SequenceNo, Surface}; use anyhow::Error; use fnv::FnvH...
#![cfg_attr(feature = "clippy", feature(plugin))] #![cfg_attr(feature = "clippy", plugin(clippy))] #![cfg_attr(feature = "clippy", warn(enum_glob_use))] #![cfg_attr(feature = "clippy", warn(if_not_else))] #![cfg_attr(feature = "clippy", warn(string_add))] #![cfg_attr(feature = "clippy", warn(string_add_assign))] #![war...
/*! Types for modeling the layout of a datatype */ use std::{ cmp::{PartialEq,Eq}, cell::RefCell, collections::HashSet, fmt::{self, Debug, Display, Formatter}, mem::{self,ManuallyDrop}, }; use core_extensions::{matches,StringExt}; use crate::{ abi_stability::{ extra_checks::{StoredExt...
use { crate::{ accounts_index::{AccountsIndexConfig, IndexValue}, bucket_map_holder_stats::BucketMapHolderStats, in_mem_accounts_index::{InMemAccountsIndex, SlotT}, waitable_condvar::WaitableCondvar, }, solana_bucket_map::bucket_map::{BucketMap, BucketMapConfig}, solana_m...
use std::{ collections::{HashMap, HashSet}, sync::Arc, time::{Duration, SystemTime, UNIX_EPOCH}, }; use bitflags::bitflags; use libp2p::{ core::multiaddr::Protocol, identity::{Keypair, PublicKey}, Multiaddr, PeerId, }; use parking_lot::RwLock; use beserial::{Deserialize, Serialize}; use nimiq...
// Copyright Materialize, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by ...
use std::collections::BTreeSet; use cargo_metadata::{DependencyKind, Package, PackageId}; use crate::{ git, traverse::dependency::{ManifestAdjustment, VersionAdjustment}, utils::{ is_pre_release_version, package_by_id, package_by_name, package_eq_dependency_ignore_dev_without_version, work...
use quote::ToTokens; use std::collections::HashMap; use std::collections::HashSet; use std::fs::{self, File}; use std::io::{ErrorKind, Read}; use std::path::{Path, PathBuf}; use std::rc::Rc; use syn::visit::Visit; use syn::visit_mut::VisitMut; use syn::{ parse_quote, punctuated::Punctuated, token::Comma, AngleBrack...
#![doc( html_root_url = "https://docs.rs/signal-hook/0.1.6/signal-hook/", test(attr(deny(warnings))) )] #![deny(missing_docs)] //! Library for easier and safe Unix signal handling //! //! Unix signals are inherently hard to handle correctly, for several reasons: //! //! * They are a global resource. If a libra...
// 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...
//! A simple HTTP server, for learning and local development. #[macro_use] extern crate derive_more; use bytes::BytesMut; use env_logger::{Builder, Env}; use futures::future; use futures::stream::StreamExt; use futures::FutureExt; use handlebars::Handlebars; use http::header::{HeaderMap, HeaderValue}; use http::statu...
use libc::{c_ulonglong, user_regs_struct}; #[derive(PartialEq, Debug, Clone, Eq, Hash)] #[allow(non_camel_case_types)] pub enum Syscall { Read, Write, Open, Close, Stat, Fstat, Lstat, Poll, Lseek, Mmap, Mprotect, Munmap, Brk, Rt_sigaction, Rt_sigprocmask, ...
// Copyright Materialize, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by ...
//! Parser from regex patterns to IR use crate::api; use crate::charclasses; use crate::codepointset::{CodePointSet, Interval}; use crate::folds; use crate::ir; use crate::types::{ BracketContents, CaptureGroupID, CharacterClassType, MAX_CAPTURE_GROUPS, MAX_LOOPS, }; use std::{error::Error as StdError, fmt, iter::...
//! A network implementation which does work with the Kubernetes Container Network Interface (CNI). use crate::{ cni::{ config::{Config, ConfigBuilder, ConfigFile, ConfigListFile}, exec::{DefaultExec, Exec}, namespace::Namespace, netlink::{DefaultNetlink, Netlink}, plugin::{...
#![forbid(unsafe_code)] //! Streams gap-less data from Pico Technology oscilloscope drivers. //! //! This is a sub crate that you probably don't want to use directly. Try the top level //! [`pico-sdk`](https://crates.io/crates/pico-sdk) crate which exposes everything from here. //! //! Once streaming is started, a `Pi...
/* * Copyright 2015-2016 <NAME> <<EMAIL>> * * 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 ...
use error_chain::error_chain; use lettre; use log::warn; use mailparse::{self, MailHeaderMap}; use rfc2047_decoder; use serde::{ ser::{self, SerializeStruct, Serializer}, Serialize, }; use std::{borrow::Cow, fmt, fs, path::PathBuf, result}; use tree_magic; use unicode_width::UnicodeWidthStr; use uuid::Uuid; us...
#![allow(clippy::module_inception)] use std::cmp::min; use std::collections::VecDeque; use std::fmt::{self, Debug}; use std::io::{Read, Result as IoResult, Seek, SeekFrom, Write}; use std::path::{Path, PathBuf}; use std::sync::Arc; use std::time::SystemTime; use super::{Handle, Options}; use base::lru::{CountMeter, L...
#[macro_use] extern crate error_chain; use std::collections::HashMap; use std::fmt::Write; use std::path::PathBuf; use std::sync::Arc; use std::time::Duration; use structopt::StructOpt; use xcb::Connection; mod action; mod cmdline; mod combination; mod config; mod error; mod keysym; mod leechbar; mod window; use cra...
use crate::util::conversions::*; use crate::util::side_metadata::try_map_metadata_space; use crate::util::Address; use crate::util::ObjectReference; use crate::util::heap::layout::vm_layout_constants::{AVAILABLE_BYTES, LOG_BYTES_IN_CHUNK}; use crate::util::heap::layout::vm_layout_constants::{AVAILABLE_END, AVAILABLE_S...
use std::collections::{HashMap, HashSet}; use std::io; use std::io::Read; use std::ffi::OsStr; use std::fmt; use std::fs::{File, create_dir_all}; use std::path::{PathBuf, Path}; use std::sync::{Arc, RwLock}; use std::time::{Duration, Instant}; use bytes::Bytes; use ipnetwork::IpNetwork; use rpki::cert::{Cert, Resour...
// 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...
extern crate chrono; extern crate multimap; extern crate mysql; extern crate serde; extern crate serde_json; extern crate stopwatch; extern crate time; use cache_2q::Cache; use cadence::prelude::*; use cadence::StatsdClient; use crate::dao::stopwatch::Stopwatch; use crate::encryptor::Encryptor; use failure::Error; use...
// // // This file is a part of Aleph // // https://github.com/nathanvoglsam/aleph // // MIT License // // Copyright (c) 2020 Aleph Engine // // 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 Softwar...
use super::{RedisResult, RedisError, RedisErrorKind, RespInternalValue}; use std::io::Cursor; use std::error::Error; use byteorder::ReadBytesExt; pub struct ParseResult<T> { pub value: T, pub value_src_len: usize, } pub type OptParseResult<T> = Option<ParseResult<T>>; pub fn parse_resp_value(data: &[u8]) -> ...
use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; use std::future::Future; use std::sync::mpsc::Receiver; use std::task::Poll; use std::task::Context; use std::pin::Pin; use std::collections::HashMap; use std::cell::Cell; use std::io::{Write, Read, Error, ErrorKind}; use std::net::{TcpListener, TcpStr...
use bevy::prelude::*; use ultraviolet::DVec3; /// The scaling for transforms. /// /// This scales all the [`Transform`]s related to bodies so that reasonable /// clipping planes and continue to be used. It just scales the universe down. pub struct TransformScale(pub f64); impl Default for TransformScale { fn defa...
// https://pdfs.semanticscholar.org/0d33/65f9ff573ee03776f042f938f0d447945ccd.pdf // https://www.isprs.org/proceedings/XXXVII/congress/5_pdf/04.pdf // https://www.researchgate.net/publication/228345254_Automatic_calibration_of_digital_cameras_using_planar_chess-board_patterns/link/0fcfd5134c9811b4b7000000/download ...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 28/06/2017 Last Modified: 12/10/2018 License: MIT Notes: Algorithm based on Lindsay JB. 2016. Efficient hybrid breaching-filling sink removal methods for flow path enforcement in digital elevation models. Hydrological P...
//! A generic TCP handler for implementing custom protocols. extern crate bytes; extern crate mio; extern crate workers; use std::net::SocketAddr; use std::collections::{HashMap, HashSet}; use std::io::{Error, ErrorKind, Read, Write}; use std::sync::{mpsc, Arc, Mutex}; use mio::{Events, Poll, PollOpt, Ready, Token}; ...
use crate::ast::expr::*; use crate::ast::TokenStart; use crate::parser::{Parse, ParseCursor}; use crate::rcc::RccError; impl Parse for Expr { fn parse(cursor: &mut ParseCursor) -> Result<Self, RccError> { if !Self::is_token_start(cursor.next_token()?) { return Err("expected start token of Expr"...
use crate::{ config::Config, error::PublishError, handler::EpisubHandler, rpc, topic::TopicMesh, view::AddressablePeer, }; use futures::FutureExt; use libp2p_core::{ connection::{ConnectionId, ListenerId}, ConnectedPoint, Multiaddr, PeerId, }; use libp2p_swarm::{ CloseConnection, DialError, NetworkBehaviour, ...
use cgmath::{Point2, Vector4}; use crate::entity::ECS; use crate::graphics::{FontGlyph, FontMap, NinePatch, TextureAtlas, TextureRegion2D, UiBatch}; use crate::item::{self, GameItem}; use generational_arena::Arena; use std::any::Any; use std::collections::HashMap; use std::rc::Rc; use winit::event; mod in_game; mod l...
/* const MEMORY_SIZE: usize = 1024 * 1024 * 512; const REGISTERS_COUNT: usize = 32 + 1; const CODE_RANGE_BEGIN: usize = 0; const CODE_RANGE_END: usize = CODE_RANGE_BEGIN + (1024 * 1024 * 128) - 1; static mut MEMORY: [u8; MEMORY_SIZE] = [0; MEMORY_SIZE]; static mut REGISTERS: [u32; REGISTERS_COUNT] = [0; REGISTERS_COU...
use crate::parser::ParseContext; use crate::ast::{Pos, CompErr}; #[cfg(all(target_arch = "x86_64", target_feature = "avx2"))] use crate::util::lsb_number; #[cfg(all(target_arch = "x86_64", target_feature = "avx2"))] use std::arch::x86_64::*; #[derive(Debug, PartialEq)] pub enum Token { Id(String), Label(Strin...
use parking_lot::{Mutex, RwLock}; use std::collections::{HashMap, HashSet, VecDeque}; use std::sync::{Arc, Weak}; use std::time::{Duration, Instant}; use weak_table::PtrWeakHashSet; use crate::consensus::base::block::{Block, BlockHeader}; use crate::consensus::base::blockchain::{Blockchain, PushResult, Direction}; use ...
use std::collections::HashSet; use std::fmt::Write; use std::str::FromStr; use darling::FromMeta; use proc_macro2::Span; use quote::quote; use syn::ext::IdentExt; pub fn model(ast: &mut syn::ItemStruct) -> proc_macro2::TokenStream { let fields = match &mut ast.fields { syn::Fields::Named(fields) => fields...
mod utils; use rand::rngs::SmallRng; use rand::seq::SliceRandom; use rand::{Rng, SeedableRng}; use wasm_bindgen::prelude::*; use wasm_bindgen::{Clamped, JsCast, JsValue}; use web_sys::{CanvasRenderingContext2d, HtmlCanvasElement, HtmlImageElement, ImageData}; static mut DEBUG: bool = false; const DPI: u32 = 72; // A...
use crate::utils::h160_hexadecimal; use crate::utils::u256_decimal; use anyhow::Result; use derivative::Derivative; use primitive_types::{H160, U256}; use reqwest::{Client, RequestBuilder, Url}; use serde::{de::Error, Deserialize, Deserializer, Serialize}; use serde_json::Value; use thiserror::Error; use web3::types::B...
use core::mem::size_of; use crate::ntapi_base::CLIENT_ID; use crate::ntpsapi::{GDI_HANDLE_BUFFER, PPEB_LDR_DATA}; use crate::ntrtl::PRTL_USER_PROCESS_PARAMETERS; use winapi::shared::basetsd::{SIZE_T, ULONG_PTR}; use winapi::shared::guiddef::GUID; use winapi::shared::ntdef::{ BOOLEAN, CHAR, HANDLE, LCID, LIST_ENTRY,...
//! Module for performing the raycasting calculations and rendering use rsfml::{ graphics::{ Color, PrimitiveType, RenderStates, RenderTarget, RenderWindow, Vertex, VertexArray, }, system::{Vector2f, Vector2i}, window::Key, }; use crate::{event_handler::EventHandler, map::Map, texture_loader::...
// 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...
/* * Copyright (C) 2015 <NAME> <<EMAIL>> * * 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 a...
use crate::config::CodeGeneratorConfig; use crate::emit::{CodeGenerator, Registry}; use serde::{Deserialize, Serialize}; use serde_json::Value; use serde_reflection::{ContainerFormat, Format, Named, VariantFormat}; use std::collections::BTreeMap; use std::fs::File; use std::io::BufReader; use std::io::Write; use std::p...
//! Interface to the DMA peripheral //! //! See STM32L0x2 Reference Manual, chapter 11. // Currently the only module using DMA is STM32L082-only, which leads to unused // warnings when compiling for STM32L0x2. Rather than making the whole DMA // module STM32L082-only, which wouldn't reflect the reality, I've added thi...
//! Collects OpenTelemetry spans and reports them to a given Jaeger //! `agent` or `collector` endpoint. See the [Jaeger Docs] for details //! about Jaeger and deployment information. //! //! *Compiler support: [requires `rustc` 1.42+][msrv]* //! //! [Jaeger Docs]: https://www.jaegertracing.io/docs/ //! [msrv]: #suppor...
// Copyright 2020 <NAME> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writi...