text
stringlengths
9.08k
47.9k
//! # Diesel //! //! Diesel is an ORM and query builder designed to reduce the boilerplate for database interactions. //! If this is your first time reading this documentation, //! we recommend you start with the [getting started guide]. //! We also have [many other long form guides]. //! //! [getting started guide]: h...
//! A pooled writer and compressor. //! //! # Overview //! //! A [`Pool`] is created, started, and writers exchanged for [`PooledWriter`]s all at once in [`Pool::new`]. //! When creating a pool via [`Pool::new`] two types must be specified: the `W` Writer type and the `C` compressor type. //! The `W` may be elided sinc...
// Copyright © 2019 Intel Corporation // // SPDX-License-Identifier: Apache-2.0 // use crate::cpu::CpuManager; use crate::device_manager::DeviceManager; use crate::memory_manager::MemoryManager; use crate::pci_segment::PciSegment; use crate::{GuestMemoryMmap, GuestRegionMmap}; use acpi_tables::sdt::GenericAddress; use ...
// Copyright (c) The Diem Core Contributors // Copyright (c) The Move Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{ compilation::package_layout::CompiledPackageLayout, resolution::resolution_graph::{Renaming, ResolvedGraph, ResolvedPackage, ResolvedTable}, source_package::{ layou...
use crate::errors::{BulletproofError, R1CSError}; use crate::r1cs::linear_combination::AllocatedQuantity; use crate::r1cs::{ConstraintSystem, LinearCombination, Variable}; use amcl_wrapper::field_elem::FieldElement; use super::{constrain_lc_with_scalar, get_bit_count}; use crate::r1cs::gadgets::helper_constraints::{ge...
// Copyright 2018 The Grin Developers // // 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 agree...
//! Resolve dependencies and other data for CrateDerivation. use anyhow::format_err; use anyhow::Error; use cargo_metadata::Node; use cargo_metadata::Package; use cargo_metadata::PackageId; use cargo_metadata::{Dependency, Source}; use cargo_metadata::{DependencyKind, Target}; use pathdiff::diff_paths; use semver::Ver...
use std::fmt::{Display, Formatter, Error}; use crate::{NEAR_ZERO, Mat4, Vec3, Mat3, look_at, Vec4}; /** # Quat - Quaternion <f32> Quaternions are four component vectors that represent rotations or orientations. Quat will at all times try stay a unit quaternion, unless you multiply or divide a quaternion by a ...
// TODO: Handle Runtime Errors extern crate calc; extern crate permutate; mod braces; mod ranges; mod words; use self::braces::BraceToken; use self::ranges::parse_range; pub(crate) use self::words::{Index, Range, Select, WordIterator, WordToken}; use glob::glob; use std::ptr; use std::str; use types::*; use unicode_s...
//! Math functions. use inkwell::types::VectorType; use inkwell::values::{BasicValueEnum, IntMathValue}; use inkwell::IntPredicate; use itertools::Itertools; use std::convert::TryInto; pub use super::enums::{MinMaxMode, NegOrAbsMode}; use super::{FuncConstructor, FuncResult}; use crate::ast::{ErrorPointRef, FuncCall...
//! Mapping source ranges to/from the HIR and MIR. use std::rc::Rc; use either::Either; use log::trace; use rustc_hir::{ self as hir, intravisit::{self, Visitor as HirVisitor}, itemlikevisit::ItemLikeVisitor, BodyId, Expr, ExprKind, ForeignItem, ImplItem, Item, MatchSource, Node, Param, Stmt, TraitItem, }; ...
// // <NAME> <<EMAIL>> // // vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: // use seed::{*, prelude::*}; use web_sys; use core::{ srvcli::{ClientMsg, ServerMsg, PlayerId, LobbyInfo}, }; use crate::{ Msg, Model, to_elem::{iter_to_elem, tpos_char, ToElem, }, ws::WsEvent, }; /// Game state ...
// Load OS-specific modules use crate::common::{convert, db}; use libc::{c_char, c_int}; use std::{collections::BTreeMap, env, ffi::CStr, ffi::CString, ffi::OsStr, ffi::OsString, io::prelude::*, os::unix::ffi::OsStrExt, ...
// // matrix_types.rs // // Original objc code Copyright (c) 2015 <NAME> // from https://github.com/metal-by-example/sample-code // Licensed under MIT. // // Translated to Rust by TR Solutions on 18/7/20. // Copyright © 2020 TR Solutions Pte. Ltd. // Licensed under Apache 2.0 and MIT // // See appropriate LICEN...
//! Utilities for loading and using glsl shaders. //! //! [`ShaderPrototype`](struct.ShaderPrototype.html) is used to load and //! modify the source of a shader. It can then be converted to an actual //! [`Shader`](struct.Shader.html) which can be used for rendering. use std::{mem, ptr, str, fmt, error, io}; use std:...
use crate::mod_definition::{MappedModDefinition, ModDefinition}; use crate::mod_line_scanner::ASSUMED_FIRST_MONSTER_ID; use crate::{replace_use, LazyString}; use lazy_static::lazy_static; use maplit::btreeset; use regex::Captures; use std::cell::RefCell; use std::collections::{BTreeSet, HashMap}; use std::fs::File; use...
//! //! The peer-to-peer address manager. //! #![warn(missing_docs)] use std::net; use bitcoin::network::address::Address; use bitcoin::network::constants::ServiceFlags; use nakamoto_common::block::time::{LocalDuration, LocalTime}; use nakamoto_common::block::BlockTime; use nakamoto_common::collections::{HashMap, Has...
//! State for a single view/document use libc::c_char; use std::borrow::Cow; use std::ops::Range; use xi_core_lib::edit_types::{BufferEvent, EventDomain, SpecialEvent, ViewEvent}; use xi_core_lib::rpc::{GestureType, Rect}; use xi_core_lib::selection::{InsertDrift, SelRegion, Selection}; use xi_core_lib::view::ViewMov...
#![allow(dead_code)] #![allow(unused_imports)] use byteorder::{ByteOrder, NativeEndian, WriteBytesExt}; use glam::{Mat4, Quat, Vec3, Vec4}; use gltf::texture::TextureTransform; use kajiya_backend::bytes::into_byte_vec; /*use render_core::{ constants::MAX_VERTEX_STREAMS, device::RenderDevice, state::{build,...
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 use crate::{ connection::{ connection_id_mapper::ConnectionIdMapperState, local_id_registry::LocalIdStatus::*, InternalConnectionId, }, contexts::WriteContext, transmission, }; u...
use librespot_core::authentication::Credentials; use librespot_core::cache::Cache; use librespot_core::config::SessionConfig; use librespot_core::session::Session; use librespot_core::session::SessionError; use librespot_playback::config::PlayerConfig; use librespot_playback::player::NormalisationData; use log::{debug,...
// 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. mod library_loader; use { crate::{ constants::PKG_PATH, model::{Runner, RunnerError}, startup::{Arguments, BuiltinRootServices...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. /// A CompactNetwork is a tightly packed neighbor-optimized datastructure that defines a /// *undirected* Network's edges. /// /// The structure is optimized for: /// - Fast lookups of all the neighbors (and the edges' weights) for a given Nod...
use crate::{ Result, bitreader::BitReaderLsb, bitwriter::{ BitWriterLsb, BitWriterMsbRevBytes, }, uastc, }; pub fn convert_block_from_uastc(bytes: &[u8], output: &mut [u8]) { match convert_block_from_uastc_result(bytes, output) { Ok(_) => (), _ => output.copy_fro...
use crate::data::Value; use crate::state::Runtime; use crate::state::NotifierList; use crate::util; use crate::util::{Cell,spawn_noerr}; use futures_channel::mpsc::{self,UnboundedSender}; use futures_util::StreamExt; use log::{info,warn,error}; use once_cell::unsync::OnceCell; use std::cell::RefCell; use std::collectio...
//! The apiclient binary provides some high-level, synchronous methods of interacting with the //! API, for example an `update` subcommand that wraps the individual API calls needed to update //! the host. There's also a low-level `raw` subcommand for direct interaction. // This file contains the arg parsing and high...
/* 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 not use this f...
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { crate::model::{ actions::{Action, ActionSet, Notification}, error::ModelError, exposed_dir::ExposedDir, hooks::{E...
// Copyright (c) 2018 <NAME> (<EMAIL>) // // Licensed under the Apache License, Version 2.0 (located at /LICENSE-APACHE // or http://www.apache.org/licenses/LICENSE-2.0), or the MIT license // (located at /LICENSE-MIT or http://opensource.org/licenses/MIT), at your // option. The file may not be copied, modified, or di...
use std::borrow::ToOwned; use std::old_io as io; use std::old_io::ByRefReader; use std::old_io::Reader as IoReader; use std::old_io::Writer as IoWriter; use { Reader, Writer, ByteString, CsvResult, IntoVector, RecordTerminator, QuoteStyle, }; fn assert_svec_eq<S: Str, T: Str>(got: Vec<Vec<S>>, expected: Vec<Ve...
use log::{debug, error}; use nix::errno::{self, Errno}; use nix::fcntl::{self, OFlag}; use nix::sys::stat::{self, FileStat, Mode}; use std::collections::HashMap; use std::ffi::CString; use std::fs; use std::os::unix::io::RawFd; use std::path::Path; #[cfg(target_os = "macos")] use param::{ copy_slice, parse_mount_f...
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #[macro_use] extern crate log; extern crate once_cell; extern crate regex; extern crate tempfile; extern crate wal...
#![recursion_limit="256"] // crates for parsing extern crate proc_macro; extern crate syn; #[macro_use] extern crate quote; // used for containing macro input use proc_macro::{TokenStream, Span}; // used for parsing macro input use syn::parse::{Parse, ParseStream}; use syn::parse_macro_input; // used for traversing...
#![doc(test(attr(deny(warnings))))] #![forbid(unsafe_code)] #![warn(missing_docs)] #![cfg_attr(docsrs, feature(doc_cfg))] //! This helps with configuring the [`reqwest`] [`Client`]. //! //! This is part of the [`spirit`] system. //! //! There are two levels of support. The first one is just letting the [`Spirit`] to l...
#[cfg(not(feature = "disable_validation"))] use std::collections::{HashSet, HashMap}; #[cfg(not(feature = "disable_validation"))] use std::time::Instant; use bincode; use serde::{Serialize, Deserialize}; #[cfg(not(feature = "disable_validation"))] use tokio::task; #[cfg(not(feature = "disable_validation"))] use tokio:...
// Copyright 2020 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) any la...
use libc::{c_char, c_void}; use libc::funcs::c95::stdlib::free; use std::ffi::CString; use std::mem::transmute; use std::ptr; use consts::*; use types::*; //#[repr(C)] //struct JNINativeMethod { // name: *mut c_char, // signature: *mut c_char, // fn_ptr: *mut u8 //} #[repr(C)] #[allow(dead_code)] struct JNINative...
use std::ops::Range; use std::rc::Rc; use failure; use bio_types::annot::loc::Loc; //use bio_types::annot::pos::Pos; use bio_types::annot::spliced::Spliced; use bio_types::strand::*; use rust_htslib::bam; use bam_utils::*; //use codon_assign::*; use transcript::*; pub fn record_framing( trxome: &Transcriptome<R...
pub struct Locale<'a> { pub name: &'a str, // currency name pub fraction_length: usize, // default decimal length pub thousands_seperator: &'a str, // thousands seperator pub decimal_seperator: &'a str, // decimal seperator pub space_seperator: &'a str, // space seperator pub utf_symbol: &'a str, // UTF symbol ...
// Rust Bitcoin Library // Written in 2014 by // <NAME> <<EMAIL>> // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to // the public domain worldwide. This software is distributed without // any warranty. // // You should have r...
use super::matrix::*; use super::resource_ids::*; use super::render_entity::*; use super::renderer_core::*; use flo_canvas as canvas; use flo_render as render; use ::desync::*; use futures::prelude::*; use futures::task::{Context, Poll}; use futures::future::{BoxFuture}; use std::mem; use std::pin::*; use std::sync...
/* ********************************************************************** ** ** This file is part of rsp2. ** ** ** ** rsp2 is free software: you can redistribute it and/or modify it under ** ** the term...
/* * Copyright 2018 <NAME> * * This is free software, distributed under the MIT license. A copy of the * license can be found in the LICENSE file in the project root, or at * https://opensource.org/licenses/MIT. */ //! The Chip-8 interpreter. //! //! The main focus of this module is the `Interpreter` struct, wh...
use std::io; use std::net::{IpAddr, SocketAddr}; use bytes::{BigEndian, BufMut, ByteOrder, Bytes, BytesMut}; use futures::{Async, Poll, Stream}; use rand::{self, RngCore}; use tokio::io::AsyncWrite; use error::DemoError; use ice::Ice; use udp::UdpStream; #[derive(Debug)] pub enum StunEvent {} enum StunState { I...
//!Code in this module processes the provider trait decorated with the `tracers` attribute, and //!replaces it with an implementation using libstapsdt. use crate::build_rs::BuildInfo; use crate::gen::common::{ProbeGeneratorBase, ProviderTraitGeneratorBase}; use crate::spec::ProbeSpecification; use crate::spec::Provider...
use { crate::{ cluster::{Cluster, ClusterValidatorInfo, ValidatorInfo}, cluster_tests, validator_configs::*, }, itertools::izip, log::*, solana_client::thin_client::{create_client, ThinClient}, solana_core::validator::{Validator, ValidatorConfig, ValidatorStartProgress}, ...
// Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). #![deny(warnings)] // Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to...
//! Type safe native types for safe egl initialisation use std::collections::HashSet; use std::ffi::CStr; use std::mem::MaybeUninit; use std::ops::Deref; use std::sync::Arc; #[cfg(all(feature = "wayland_frontend", feature = "use_system_lib"))] use std::sync::{Mutex, Weak}; use libc::c_void; use nix::libc::c_int; #[cf...
//! Tokenizing Helios source files. //! //! The showrunner of this module is the [`Lexer`] type. It essentially takes //! a given input, representing a Helios source, and provides an [`Iterator`] of //! [`Token`]s. //! //! The lexer aims to be as error-tolerant and UTF-8 friendly as possible (the //! latter of which is...
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
use crate::map::{Map, Position, Tile}; use crate::map_generation::MapGenerationSettings; use crate::person::{Person, PersonAction, PersonId, PersonUpdate}; use crate::world::{Location, World}; use rand::prelude::*; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::collections::HashSet; use st...
use crate::{ artifacts::Settings, cache::SOLIDITY_FILES_CACHE_FILENAME, error::{Result, SolcError, SolcIoError}, remappings::Remapping, resolver::Graph, utils, Source, Sources, }; use crate::artifacts::output_selection::ContractOutputSelection; use serde::{Deserialize, Serialize}; use std::{ ...
// This file is part of Substrate. // Copyright (C) 2018-2021 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // ht...
//! Client and broker statistics. //! //! These statistics are collected automatically by librdkafka when the client //! is configured with a non-zero `statistics.interval.ms`. They are made //! available via the [`ClientContext::stats`] callback. //! //! Refer to the [librdkafka statistics documentation][librdkafka-st...
use std::{ f64::consts::PI, fmt::Debug, fs, iter::Sum, ops::{Add, Div, Mul, Neg, Sub}, sync::Arc, }; use rand::{prelude::SmallRng, SeedableRng, Rng}; use rayon::iter::{IntoParallelIterator, ParallelIterator}; /* Basics */ #[derive(Debug)] struct RGB(u8, u8, u8); /// /// **8-bit color /// #[d...
use std::{error::Error as _, pin::Pin, sync::Arc, time::Duration}; use chrono::{DateTime, NaiveDateTime, Utc}; use codecs::decoding::{DeserializerConfig, FramingConfig}; use derivative::Derivative; use futures::{stream, Stream, StreamExt, TryFutureExt}; use http::uri::{InvalidUri, Scheme, Uri}; use once_cell::sync::La...
//! Tests auto-converted from "sass-spec/spec/libsass/units/conversion" #[allow(unused)] use super::rsass; // From "sass-spec/spec/libsass/units/conversion/angle.hrx" #[test] #[ignore] // wrong result fn angle() { assert_eq!( rsass( ".result {\ \n output: (0deg + 1deg);\ ...
use crate::config::{ServiceConfig, SpecialBaseConfig}; use crate::utils; use chrono::{Local, Timelike}; use json; use random; use std::borrow::Cow; use std::collections::HashMap; use std::ffi::OsStr; use std::fs; use std::io; use std::io::prelude::*; use std::os::unix::net::{UnixListener, UnixStream}; use std::path::{P...
//! A raw and safe binding to the Coin CBC C API. //! //! The method are as raw as possible to the original API. //! Differences are: //! - snake case naming //! - slices as inputs //! - rust naming convension (in particular, getter do not begin with `get`) //! - assert are used to validate data //! - use rust typ...
// Validate instruction sequence for // - function body // - subsequence in control instructions like block, loop, if // - initilization sequences for globals and table elems // // Algorithm for validating instructions: // https://webassembly.github.io/spec/core/appendix/algorithm.html#algo-valid use crate::error::{...
use std::collections::HashSet; use std::iter::once; use crate::bsdf::*; // use crate::camera::*; use crate::film::*; use crate::integrator::*; use crate::light::*; use crate::nn_v2::*; use crate::sampler::*; use crate::scene::*; use crate::shape::*; use crate::texture::ShadingPoint; use crate::*; use nalgebra as na; ...
use crate::constants::*; use crate::error::Error; use crate::issue::{process_issue_requests, IssueRequests}; use backoff::{future::FutureOperation as _, ExponentialBackoff}; use bitcoin::{BitcoinCoreApi, Transaction, TransactionExt, TransactionMetadata}; use futures::stream::StreamExt; use log::*; use runtime::{ pa...
//! Provides an implementation of the chase by collapsing references to elements //! of the model to avoid equational reasoning computation. //! //! [`collapse`] is an implementation of the [chase] that uses references to [`E`] //! wrapped in [`Element`] as the [`Model`] elements. Using object references allows for a /...
// Copyright 2021 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
use json::JsonValue; use crate::{ Id, ContextMut, Indexed, object, Object, Node, Lenient, Error, ErrorCode, context::{ Loader, Inversible }, syntax::{ Keyword, Container, ContainerType, Term } }; use super::{ Compact, CompactIndexed, Options, compact_iri, compact_iri_with, compact_collect...
// Copyright (c) 2016-2021 <NAME> //! A hardware description language compiler. #[macro_use] extern crate log; use clap::{App, Arg, ArgMatches}; use llhd; use moore_circt::{self as circt, mlir, prelude::*, sys::*}; // use llhd::opt::{Pass, PassContext}; use moore::common::score::NodeRef; use moore::errors::*; use mo...
//! A basic implementation of vectors, matrices and minimal math operations implemented as a //! learning exercise. You are strongly advised to use an established linear algebra library such //! as `nalgebra` or `cgmath` in preference to this amateur attempt. use std::f64::consts::PI; /// A 3 row and 3 column matrix...
#![cfg_attr(not(debug_assertions), deny(warnings))] use std::fs::{create_dir_all, File}; use std::io; use std::io::{BufRead, BufReader, BufWriter, Write, ErrorKind}; use std::path::Path; use std::process::Command; use std::sync::Arc; use arrow::array::{ArrayRef, Float32Array, Int32Array, PrimitiveArray}; use arrow::d...
//! Handling of everything related to the calling convention. Also fills `fx.local_map`. #[cfg(debug_assertions)] mod comments; mod pass_mode; mod returning; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc_target::spec::abi::Abi; use cranelift_codegen::ir::{AbiParam, ArgumentPurpose}; use ...
use super::Borrow; use tokio_executor::Enter; use tokio_executor::park::Unpark; use futures::{Future, Async}; use futures::executor::{self, Spawn, UnsafeNotify, NotifyHandle}; use std::cell::UnsafeCell; use std::fmt::{self, Debug}; use std::mem; use std::ptr; use std::sync::atomic::Ordering::{Relaxed, SeqCst, Acquire...
// 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. use { crate::{ component_lifecycle, diagnostics, error::Error, events::{ router::{ConsumerConfig, EventConsumer, Ev...
#![doc(html_root_url = "https://docs.rs/wasm-bindgen-cli-support/0.2")] use anyhow::{bail, Context, Error}; use std::collections::{BTreeMap, HashMap, HashSet}; use std::env; use std::fs; use std::mem; use std::path::{Path, PathBuf}; use std::str; use walrus::Module; pub(crate) const PLACEHOLDER_MODULE: &str = "__wbin...
use std::{f64::consts::PI, fmt::Debug, ops::Range}; use kv::{Bucket, Integer, Json}; use serde::{Deserialize, Serialize}; use nalgebra::{Point2, Rotation}; use itertools::{Itertools, izip}; use log::trace; use measure_time::*; use opencv::{core::{CV_32FC2, Point2f, Point2i, Scalar, Size2i, TermCriteria, TermCriteria_T...
use std::char; use std::usize; use std::io::{self, Write}; use std::fmt; use std::collections::BTreeSet; use std::sync::atomic::{AtomicUsize, Ordering}; use gif; use base64; use unicode_normalization::UnicodeNormalization; use md5; use rayon::prelude::*; use indicatif::ProgressBar; use external_data::{UNICODE_DATA, UDH...
use crate::cipher::Cipher; use crate::error::*; use crate::format::ossh_privkey::*; use crate::format::ossh_pubkey::*; use crate::format::parse_keystr; use crate::format::pem::*; use crate::format::pkcs8::*; use digest::Digest; use md5::Md5; use openssl::pkey::{Id, PKey, PKeyRef, Private, Public}; use sha2::{Sha256, Sh...
//! EVM module. pub mod evm_backend; pub mod precompile; pub mod types; use std::collections::BTreeMap; use evm::{ executor::{MemoryStackState, StackExecutor, StackSubstateMetadata}, Config as EVMConfig, }; use once_cell::sync::Lazy; use thiserror::Error; use tiny_keccak::{Hasher, Keccak}; use oasis_runtime_...
//! Ported to Rust from <https://www.shadertoy.com/view/4sXBRn> //! //! Original comment: //! ```glsl //! // Luminescence by <NAME> aka BigWings - 2017 //! // Email:<EMAIL> Twitter:@The_ArtOfCode //! // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. //! //! // My entry for the month...
use near_sdk::{ AccountId, Balance, PanicOnDefault, Promise, PublicKey, borsh::{self, BorshDeserialize, BorshSerialize}, collections::{LookupMap, TreeMap}, env, json_types::{ValidAccountId, Base58PublicKey, Base64VecU8, U128}, log, near_bindgen, serde::{Deserialize, Seria...
//! Language files management. //! //! This module contains structs that hold handles to language files //! and language metadata. //! use std::{ collections::{HashMap, HashSet}, fmt::Display, fs::{File, OpenOptions}, path::{Path, PathBuf}, str::FromStr, }; use log::{debug, warn}; use serde::{Deser...
use byteorder::{ReadBytesExt, WriteBytesExt, BE}; use std::cmp::Ordering; use std::fmt::Write as _; use std::io::{Cursor, Read, Write}; use crate::raw::{RawActor, RawDataDef, RawEvent, RawHeader, RawStep1, RawStep2}; use serde::{Deserialize, Serialize}; const MAGIC: u16 = 0x775A; // "wZ" const EV: u16 = 0x4576; // "E...
use core::marker::PhantomData; use managed::ManagedSlice; use crate::arch::Arch; use crate::common::{Signal, Tid}; use crate::connection::{Connection, ConnectionExt}; use crate::protocol::commands::Command; use crate::protocol::{Packet, ResponseWriter, SpecificIdKind}; use crate::target::ext::base::multithread::Threa...
use std::time::{Duration, Instant}; use tetra::graphics::{self, Color, Texture}; use tetra::input::{self, Key}; use tetra::{Context, ContextBuilder, State}; use tetra::math::Vec2; use array2d::Array2D; use fastrand; const WINDOW_WIDTH: f32 = 480.0; const WINDOW_HEIGHT: f32 = 480.0; const MAP_WIDTH: usize = 9; const ...
pub use egui_sdl2_gl::{egui, gl, sdl2}; use rand::SeedableRng; use rand_chacha::ChaCha8Rng; use sdl2::image::{self, LoadSurface}; use sdl2::pixels::{Color, PixelFormatEnum}; use sdl2::render::{Canvas, TextureCreator}; use sdl2::surface::Surface; use sdl2::ttf; use sdl2::video::{GLProfile, Window, WindowContext}; use...
use crossbeam_channel::{Receiver, Sender}; use crate::colour::*; use crate::palette::*; use crate::loader::LoadedPalette; use crate::text::*; use crate::graph::*; use crate::cache::*; use crate::widget::*; use crate::metadata; use std::f32::consts::PI; use std::sync::{Arc, RwLock}; use std::rc::Rc; pub fn analyse_mu...
use crate::backup; use ic_artifact_pool::{ certification_pool::CertificationPoolImpl, consensus_pool::{ConsensusPoolImpl, UncachedConsensusPoolImpl}, }; use ic_config::{ artifact_pool::ArtifactPoolConfig, registry_client::DataProviderConfig, subnet_config::SubnetConfigs, Config, }; use ic_consensus::con...
use super::afd::{self, Afd, AfdPollInfo}; use super::io_status_block::IoStatusBlock; use super::Event; use crate::sys::Events; use crate::Interest; use miow::iocp::{CompletionPort, CompletionStatus}; use miow::Overlapped; use std::collections::VecDeque; use std::marker::PhantomPinned; use std::os::windows::io::RawSock...
//! `eth_sender` module is capable of synchronizing the operations //! occurring in `ZKSync` with the Ethereum blockchain by creating //! transactions from the operations, sending them and ensuring that //! every transaction is executed successfully and confirmed. // Built-in deps use std::collections::VecDeque; use s...
#[cfg(test)] #[macro_use] extern crate lazy_static; use std::collections::HashMap; use std::env; use std::fmt; use std::io::{self, stdin, stdout, Error as IoError, Read, Write}; use std::path::{Path, PathBuf}; use std::str::FromStr; use anyhow::{format_err, Result}; use structopt::StructOpt; use thiserror::Error; us...
#[macro_use] extern crate serde_derive; #[macro_use] extern crate failure; #[macro_use] extern crate lazy_static; extern crate clap; extern crate glob; extern crate human_size; extern crate permutate; extern crate prettytable; extern crate serde; extern crate serde_json; extern crate toml; use std::collections::HashMa...
// 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 http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. /*! * An implement...
use ggez::{graphics, Context, GameResult}; use ggez::event::EventHandler; use rand::Rng; use std::fs::File; use std::io::{Read}; #[derive(Clone)] struct Vector2D { x: f32, y: f32 } impl Vector2D { pub fn new(x: f32, y: f32) -> Self { Self { x, y } } } impl Into...
mod checkpoint; pub mod int_map; mod page_allocator; use checkpoint::Checkpoint; pub use checkpoint::{CheckpointSerialization, MappingSerialization}; use ic_sys::PageBytes; pub use ic_sys::{PageIndex, PAGE_SIZE}; pub use page_allocator::{ allocated_pages_count, PageAllocatorDelta, PageAllocatorSerialization, PageD...
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0. use std::collections::hash_map::Entry; use std::fmt; use std::sync::atomic::{AtomicUsize, Ordering}; use collections::HashMap; use futures::future::{self, TryFutureExt}; use futures::sink::{Sink, SinkExt}; use futures::stream::TryStreamExt; use future...
use std::convert::{From, TryFrom}; use std::fmt; use std::fmt::{Display, Formatter}; use async_trait::async_trait; use crate::errors::{ProtocolError, ProtocolErrorKind}; use crate::transport::{TAsyncReadTransport, TAsyncWriteTransport}; pub mod async_binary; // Default maximum depth to which `TInputProtocol::skip` ...
use std::collections::HashMap; use std::path::{Path, PathBuf}; use std::sync::atomic::AtomicUsize; use std::sync::{Arc, mpsc}; use std::cell::RefCell; use std::rc::Rc; use std::{fs, thread, time}; use custom_error::custom_error; use regex::Regex; use lazy_static::lazy_static; use crate::config::GemBS; use crate::comm...
//! Library use std::convert::TryInto; use std::{thread, time}; //use ledger_apdu::{APDUAnswer, APDUCommand}; use ledger_transport::{errors::TransportError, Exchange}; pub mod ledger_apdu { pub use ledger_apdu::{APDUAnswer, APDUCommand}; } use ledger::TransportNativeHID; use ledger_tcp::TransportTCP; use crate...
//! Structure for representing algebraic normal form (xor of ands). //! //! Algebraic normal form is essentially a boolean polynomial. //! Each term is a product of non-negated inputs. To normalize, //! We assume the inputs are sorted by number, and then we factor //! out common prefixes. //! //! Thus: //! ```text //! ...
//! basic_lexer is a basic lexical scanner designed for the //! first stage of compiler construction, and produces tokens required by //! a parser. It was originally intended to support the parallel project *[rustlr](https://docs.rs/rustlr/latest/rustlr/)*, //! which is a LR-style parser generator, although each proje...
// Copyright 2018-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...
//! Primality testing for odd natural (unsigned) numbers. //! //! Prior calling the public entrypoint `is_odd_prime_factor` of this module, //! the number should have been cheched with the trial division primality test //! with few of the smallest prime numbers, e.g. 7. Calling the primality test //! here would fail fo...