text
stringlengths
3.09k
13.9k
use crate::heap_iter::*; use crate::machine::*; use crate::indexmap::IndexSet; use std::cmp::Ordering; use std::vec::IntoIter; pub static VERIFY_ATTRS: &str = include_str!("attributed_variables.pl"); pub static PROJECT_ATTRS: &str = include_str!("project_attributes.pl"); pub(super) type Bindings = Vec<(usize, Addr)...
use holochain::conductor::{ compat::load_conductor_from_legacy_config, config::ConductorConfig, error::ConductorError, interactive, paths::ConfigFilePath, Conductor, ConductorHandle, }; use holochain_types::observability::{self, Output}; use std::error::Error; use std::fs; use std::path::{Path, PathBuf}; use st...
// Copyright (c) 2021 Parity Technologies (UK) Ltd. // // 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. All files in the project carrying such notice may not b...
#[cfg(not(target_os = "linux"))] compile_error!("pam_bacchus is a Linux-PAM module, hence not compatible with non-Linux targets"); #[macro_use] extern crate log; use std::ffi::CStr; use std::io::prelude::*; use std::os::raw::{c_char, c_int}; mod pam; mod params; #[derive(Debug, serde::Serialize)] struct AuthPayload...
// INTENSIVE TASKS // 1. split into rows (seeking, parsing) // 2. parse set of rows into RecordBatch // * use multiple readers that scan different file parts // * because bytes -> values is harder than line interpretation // parsing can be run on separate thread! use std::{ sync::{ mpsc::{channel, Receiver...
//! Shadowsocks Server Context use std::{ net::IpAddr, sync::{ atomic::{AtomicBool, Ordering}, Arc, }, }; use bloomfilter::Bloom; use spin::Mutex; use tokio::runtime::Handle; #[cfg(feature = "trust-dns")] use trust_dns_resolver::TokioAsyncResolver; use crate::config::{Config, ConfigType, ...
use std::sync::Arc; use tokio::prelude::*; use crate::{ errors::{DriverError, Error}, io::{BoxFuture, BoxStream, ClickhouseTransport}, types::{ block::BlockRef, query_result::stream_blocks::BlockStream, Block, Cmd, Packet, Query, Row, Rows, }, ClientHandle, try_opt, }; use sel...
// Copyright 2021 Parallel Finance Developer. // This file is part of Parallel Finance. // 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 // Unl...
//! Module containing useful doc / unit test utilities. /// enables logging statically for any test module this module it is imported into pub mod logging { use lazy_static::lazy_static; lazy_static! { static ref _LOGGER_INIT: bool = { env_logger::init(); true }; }...
// Copyright 2015 <NAME>. See the COPYRIGHT // file at the top-level directory of this distribution. use std::boxed::Box; use std::env; use std::ops::Deref; use std::panic; use std::path::Path; use std::path::PathBuf; use minidump::*; use minidump_processor::{ http_symbol_supplier, simple_symbol_supplier, DwarfSy...
#[doc = "Reader of register IF"] pub type R = crate::R<u32, super::IF>; #[doc = "Reader of field `START`"] pub type START_R = crate::R<bool, bool>; #[doc = "Reader of field `RSTART`"] pub type RSTART_R = crate::R<bool, bool>; #[doc = "Reader of field `ADDR`"] pub type ADDR_R = crate::R<bool, bool>; #[doc = "Reader of f...
// Zinc, the bare metal stack for rust. // Copyright 2014 Vladimir "farcaller" Pouzanov <<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/...
#![doc = "generated by AutoRust 0.1.0"] #[cfg(feature = "package-2021-01")] mod package_2021_01; #[cfg(feature = "package-2021-01")] pub use package_2021_01::{models, operations, API_VERSION}; #[cfg(feature = "package-2020-09-18")] mod package_2020_09_18; #[cfg(feature = "package-2020-09-18")] pub use package_2020_09_1...
#![allow(clippy::upper_case_acronyms)] use crate::macos::keycodes::code_from_key; use crate::rdev::{EventType, Key, KeyboardState}; use core_foundation::base::{CFRelease, OSStatus}; use core_foundation::string::UniChar; use core_foundation_sys::data::CFDataGetBytePtr; use core_graphics::event::CGEventFlags; use std::co...
use static_assertions::assert_impl_all; use std::{convert::Infallible, error, fmt, io, sync::Arc}; use zbus_names::{Error as NamesError, OwnedErrorName}; use zvariant::Error as VariantError; use crate::{fdo, Message, MessageType}; /// The error type for `zbus`. /// /// The various errors that can be reported by this ...
use std::fs::File; use std::io::{self, Read}; use std::path::Path; use hgt::HgtResolution; pub struct HgtFile { /// Identifies the southmost latitude pub latitude: f64, /// Identifies the westmost longitude pub longitude: f64, /// Identifies the resolution of the file pub resolution: HgtResolu...
//! An interface that may be implemented by a wl_surface, for implementations that //! provide a desktop-style user interface. it provides a base set of functionality //! required to construct user interface elements requiring management by the //! compositor, such as toplevel windows, menus, etc. the types of function...
//! The implementation itself use crate::constants::EARTH_R; use crate::data::{Data, DataSample}; use crate::maths::*; use crate::structs::*; // use std::f64::consts::{FRAC_PI_2, PI}; /// Contains all necessary information to solve the problem #[derive(Clone)] pub struct Solver { data: Data, params: Params, }...
#![doc = "generated by AutoRust 0.1.0"] #[cfg(feature = "package-2021-07-preview")] mod package_2021_07_preview; #[cfg(feature = "package-2021-07-preview")] pub use package_2021_07_preview::{models, operations, API_VERSION}; #[cfg(feature = "package-2021-05")] mod package_2021_05; #[cfg(feature = "package-2021-05")] pu...
//! FUSE kernel driver communication //! //! Raw communication channel to the FUSE kernel driver. // use libc::{c_void, size_t}; use log::{debug, error}; use nix::sys::uio::{self, IoVec}; use nix::unistd; use std::ffi::{CString, OsStr}; use std::io; use std::os::raw::{c_char, c_int}; use std::os::unix::ffi::OsStrExt; ...
#![cfg_attr( all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows" )] use clap::{crate_authors, crate_description, crate_version}; use rand::Rng; use reqwest::StatusCode; use serde::{Deserialize, Serialize}; use std::{ fs::OpenOptions, io::Write, path::{Path, PathBuf}, ...
use math::{Mat4, Vec3f}; use num::Zero; use std::cell::Cell; /// A Camera object abstracts a projection-modelview transform, by providing concepts like /// position and orientation. pub struct Camera { // View parameters. position: Vec3f, // Camera location. (equiv to negative translation) yaw: f32, ...
#[cfg(debug_assertions)] use std::collections::HashSet; use std::mem; use std::ops::{Deref, DerefMut}; use std::ptr; use std::slice; #[cfg(debug_assertions)] use std::sync::Mutex; use crate::{bindgen_prelude::*, check_status, sys, Result, ValueType}; #[cfg(debug_assertions)] thread_local! { pub (crate) static BUFFE...
//! init command use crate::{ cmd::{forge::install::install, Cmd}, opts::forge::Dependency, utils::{p_println, CommandUtils}, }; use clap::{Parser, ValueHint}; use foundry_config::Config; use crate::cmd::forge::{install::DependencyInstallOpts, remappings}; use yansi::Paint; use std::{ path::{Path, Pa...
// Copyright 2018 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 { failure::{self, format_err, ResultExt}, fidl_fuchsia_fonts as fonts, lazy_static::lazy_static, regex::Regex, serde::de::{self, De...
use cosmwasm_std::{ log, to_binary, Api, Binary, Coin, CosmosMsg, Decimal, Env, Extern, HandleResponse, HandleResult, InitResponse, MigrateResponse, MigrateResult, Querier, StdError, StdResult, Storage, WasmMsg, }; use crate::state::{read_config, store_config, Config}; use anchor_token::collector::{Config...
/* * 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 ...
// Copyright 2021 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 { anyhow::{anyhow, Context, Result}, log::warn, pathdiff::diff_paths, std::{ collections::HashSet, fs, path::{P...
#![feature(proc_macro_hygiene, decl_macro)] extern crate oxide_auth; extern crate oxide_auth_rocket; #[macro_use] extern crate rocket; #[rustfmt::skip] #[path = "../../examples/support/rocket.rs"] mod support; use std::io; use std::sync::Mutex; use oxide_auth::endpoint::{OwnerConsent, Solicitation}; use oxide_auth:...
mod dqn_atari_model; use anyhow::{Context, Result}; use border::try_from; use border_core::{record::TensorboardRecorder, shape, Agent, TrainerBuilder}; use border_py_gym_env::{ newtype_act_d, newtype_obs, AtariWrapper, FrameStackFilter, PyGymEnvDiscreteAct, PyGymEnvObs, PyVecGymEnv, PyVecGymEnvBuilder, }; use b...
use crate::runtime::Trap; use byteorder::{ByteOrder, LittleEndian}; use std::convert::TryFrom; #[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum ValType { I32, I64, F32, F64, } // TODO: Val should have a handwritten PartialEq // to compare the content of the same variant #[derive(Debug, Clone, Co...
use std::fmt::{Debug, Error, Formatter}; /// Node represents a node in abstract syntax tree pub struct Node<T> { /// line info: (begin_line, end_line) lineinfo: (u32, u32), inner: T, } impl<T> Node<T> { pub fn new(inner: T, lineinfo: (u32, u32)) -> Node<T> { Node { lineinfo, ...
use std::error::Error; use walkdir::WalkDir; use std::{fmt,fs}; use std::path::{Path,PathBuf}; use std::io::Read; use crate::checksums::*; use crate::command_async::CommandAsync; use crate::message::Message; use indicatif::{MultiProgress,ProgressBar,ProgressStyle}; use std::sync::mpsc::channel; use std::sync::mpsc::{R...
use core::convert::TryFrom; use primitive_types::U256; use crate::MathError::{ZeroInReserve, Overflow, InsufficientOutReserve}; type Balance = u128; const FIXED_ROUND_UP: Balance = 1; macro_rules! ensure { ($e:expr, $f:expr) => { match $e { true => (), false => { r...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - SCU Module ID Register"] pub id: crate::Reg<id::ID_SPEC>, #[doc = "0x04 - Chip ID Register"] pub idchip: crate::Reg<idchip::IDCHIP_SPEC>, #[doc = "0x08 - Manufactory ID Register"] pub idmanuf: crate::Reg<idmanuf::ID...
use std::fmt; use std::sync::{Mutex, atomic::{AtomicIsize, Ordering}}; use std::time::{Duration, Instant}; use tokio_timer::clock; pub struct Budget { bucket: Bucket, deposit_amount: isize, withdraw_amount: isize, } #[derive(Debug)] pub struct Overdrawn { _inner: (), } #[derive(Debug)] struct Bucket...
#![no_std] #![no_main] #![feature(type_alias_impl_trait)] #![feature(alloc_error_handler)] #![allow(incomplete_features)] #[path = "../example_common.rs"] mod example_common; use core::mem; use cortex_m_rt::entry; use defmt::*; use embassy::executor::Executor; use embassy::traits::gpio::WaitForLow; use embassy::util:...
pub mod query_server; use clap::ArgMatches; use discv5::{enr, enr::k256, enr::CombinedKey, Discv5, Discv5ConfigBuilder}; use log::{info, warn}; use std::net::{IpAddr, SocketAddr}; // handle a query server pub async fn run(server_matches: &ArgMatches<'_>) { let listen_address = server_matches .value_of("li...
use advent_lib::cases::{GenericPuzzleCase, Puzzle, PuzzleCase, PuzzleRunner}; use std::{ collections::{HashMap, HashSet}, convert::TryFrom, }; pub fn get_puzzles() -> Vec<Box<dyn Puzzle>> { vec![Box::new(Part1), Box::new(Part2)] } #[derive(Debug)] pub struct Part1; impl PuzzleRunner for Part1 { type ...
// Copyright 2017-2018 the authors. See the 'Copyright and license' section of the // README.md file at the top-level directory of this repository. // // Licensed under the Apache License, Version 2.0 (the LICENSE-APACHE file) or // the MIT license (the LICENSE-MIT file) at your option. This file may not be // copied, ...
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use std::fs; use std::io::{copy, BufWriter, Write}; use std::net::SocketAddr; use std::path::PathBuf; use std::process::{Command, S...
use bitcoin::{util::psbt::serialize::Serialize, Address, Network, PrivateKey}; use example_common::{build_transaction, get_p2pkh_address, sign_transaction}; use ic_btc_types::{ GetBalanceError, GetBalanceRequest, GetUtxosError, GetUtxosRequest, GetUtxosResponse, OutPoint, SendTransactionRequest, Utxo, }; use ic...
//! Operations on cgroups in a v1 hierarchy. //! //! Operations for each subsystem are implemented in each module. See [`cpu::Subsystem`] for //! example. Currently this crate supports [CPU], [cpuset], [cpuacct], [memory], [hugetlb], //! [devices], [blkio], [RDMA], [net_prio], [net_cls], [pids], [freezer], and [perf_ev...
///Graph module, contains a simple graph structure which is when typechecking to find ///functions which are mutually recursive use std::iter::repeat; use std::cmp::min; #[derive(PartialEq, Copy, Clone, Debug)] pub struct VertexIndex(usize); #[derive(PartialEq, Copy, Clone, Debug)] pub struct EdgeIndex(usize); impl ...
use arci::{BaseVelocity, MoveBase, Navigation}; use k::nalgebra as na; use na::Isometry2; use serde::{Deserialize, Serialize}; use crate::Error; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct LocalMoveConfig { pub reach_distance_threshold: f64, pub reach_angle_threshold: f64, pub control_frequ...
#![deny(clippy::all)] #![allow(clippy::unreadable_literal)] #![allow(clippy::single_match)] use self::kit::shape2d; use self::kit::shape2d::*; use self::kit::ZDepth; use rgx::core; use rgx::core::*; use rgx::kit; use rgx::math::*; use image::png::PNGEncoder; use image::ColorType; use std::fs::File; use winit::{even...
use super::Collector; use collector::top_collector::TopCollector; use DocAddress; use DocId; use Result; use Score; use SegmentLocalId; use SegmentReader; /// The Top Score Collector keeps track of the K documents /// sorted by their score. /// /// The implementation is based on a `BinaryHeap`. /// The theorical compl...
//! # `#[sealed]` //! //! [<img alt="" src="https://img.shields.io/badge/docs.rs-sealed-success?style=flat-square">](https://docs.rs/sealed) //! [<img alt="" src="https://img.shields.io/crates/v/sealed?style=flat-square">](https://crates.io/crates/sealed) //! //! This crate provides a convenient and simple way to imple...
use std::future::Future; use std::path::PathBuf; use std::pin::Pin; use std::time::Duration; use anyhow::Context; use crate::common::manager::info::ManagerType; use crate::common::manager::pbs::{format_pbs_duration, parse_pbs_datetime}; use crate::common::timeutils::local_to_system_time; use crate::server::autoalloc:...
use super::dll::helpers::PCapErrBuf; use super::dll::{PCapDll, PCapHandle, PCapPacketHeader}; use super::structs::PCapStat; use crate::utils::cstr_to_string; use crate::{traits, BorrowedPacket, DataLink, Error, Stats}; use libc::c_int; use std::ffi::{CStr, CString}; use std::mem::{transmute, MaybeUninit}; use std::sync...
use device::device::Device; use config::Config; use driver::driver::{Driver, DriverData}; use driver::driver_manager::DriverManager; use failure::Error; use rand::{thread_rng, Rng}; use std::collections::HashMap; pub struct DeviceData(Driver, Config); pub struct DeviceManager { driver_manager: DriverManager, ...
use crate::rttui::channel::ChannelConfig; use anyhow::bail; use figment::{ providers::{Format, Json, Toml, Yaml}, Figment, }; use probe_rs::WireProtocol; use serde::{Deserialize, Serialize}; use std::path::PathBuf; /// A struct which holds all configs. #[derive(Debug, Clone)] pub struct Configs { figment: ...
// Copyright (c) 2021 Quark Container Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law...
/* Copyright 2020 <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, distribute, sublicense, ...
use std::fmt::{Display as DisplayTrait, Formatter, Result as FmtResult}; #[cfg(feature = "termion")] use std::io::{stdout, Result as IoResult, Write}; #[cfg(feature = "termion")] use std::os::unix::io::AsRawFd; use ansi_term::Style; #[cfg(feature = "termion")] use termion::{get_tty, is_tty, terminal_size}; use {Doc, ...
use std::{path::PathBuf, process}; use sabi_filesystem::{library, Library}; use sabi_platform::{FileEvent, FileWatcher}; use sabi_profiler::debug_log; use crate::{ App, PfnCreatePlugin, PfnDestroyPlugin, PfnPreparePlugin, PfnUnpreparePlugin, PluginHolder, PluginId, CREATE_PLUGIN_FUNCTION_NAME, DESTROY_PLUGIN_...
use rapier3d::geometry::InteractionGroups; use rapier3d::dynamics::RigidBodyType; use vulkano::command_buffer::{AutoCommandBufferBuilder, PrimaryAutoCommandBuffer}; use crate::application::{Hand, Application}; use crate::math::{Ray, Similarity3, Color, Rot3, Isometry3, Vec3, cast_ray_on_plane, Point3}; use crate...
// // ref) // https://github.com/matklad/cargo-xtask // mod shape_benchmark_results; fn main() -> anyhow::Result<()> { let mut env_args: Vec<String> = std::env::args().collect(); let program = env_args.remove(0); if env_args.is_empty() { print_help_and_exit(&program); } let cmd = env_args...
use crate::{protocols::ReturnableConnection, Pea2Pea}; use async_trait::async_trait; use parking_lot::RwLock; use tokio::{ io::{AsyncWrite, AsyncWriteExt}, sync::mpsc, }; use tracing::*; use std::{any::Any, collections::HashMap, io, net::SocketAddr}; /// Can be used to specify and enable writing, i.e. sendin...
// Copyright 2022, The Tremor Team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
use std::io::Read; use super::transformations; use super::transformations::{Transform, Transformation}; use crate::error::*; use crate::numbers::chances::UpdateTable; use crate::numbers::rac::RacRead; use crate::numbers::symbol::UniformSymbolCoder; use crate::numbers::FlifReadExt; use crate::pixels::ColorSpace; use cr...
use deep::*; use deep_backend_tools::*; use ndarray::{ArcArray, IxDyn}; use rand_core::RngCore; use std::collections::HashMap; use std::iter::{Extend, FromIterator}; pub type Tsor = ArcArray<f32, IxDyn>; pub fn tsor0(n: f32) -> Tsor { ndarray::arr0(n).into_shared().into_dyn() } pub fn tsor1(n: &[f32]) -> Tsor { ...
use nom::*; use super::*; pub const MIN_MESSAGE_LENGTH: i32 = 0; pub const MAX_MESSAGE_LENGTH: i32 = 65536; #[cfg_attr(rustfmt, rustfmt_skip)] named!(ref_params<RefParams>, do_parse!( vieworg: xyz >> viewangles: xyz >> forward: xyz >> right: ...
#![no_std] use megadrive_sys::ports; use core::ptr::read_volatile; // HACK: This isn't really a NOP but it'll take at least as long as a NOP. fn nop() { unsafe { read_volatile(0 as _) } } #[repr(u8)] #[derive(Copy, Clone, Debug)] pub enum Button { Up = 0, Down = 1, Left = 2, Right = 3, B = 4,...
use std::sync::Arc; use futures::{ future::FutureExt, stream::{ FuturesOrdered, StreamExt, }, }; use reed_solomon_erasure::{ galois_8, ReedSolomon, }; use tokio::{ io::{ AsyncRead, AsyncReadExt, }, select, sync::{ mpsc, oneshot, ...
use crate::{ configcreation::{Crossfeed, DevicesFile}, scraping::filter_link_list, }; use anyhow::{anyhow, Result}; use console::{style, Style}; use dialoguer::{theme::ColorfulTheme, Confirm, FuzzySelect, Input, Select}; use std::{collections::HashMap, env, fs::File, thread, time::Duration}; pub trait CliThem...
use std::{borrow::Cow, collections::HashMap}; use crate::{ filter::decode_stream, lex::{LexBase, LexObject}, objects::{Object, ObjectType}, trailer::Trailer, xref::{ stream::{XrefStream, XrefStreamDict}, Xref, }, ParseError, PdfResult, Reference, Resolve, }; use super::{str...
use std::sync::Arc; use std::sync::Mutex; use std::time::Duration; use failure::ResultExt; use humthreads::Builder; use humthreads::Thread; use humthreads::ThreadScope; use slog::debug; use slog::info; use slog::Logger; use zookeeper::ZkError; use replicante_util_failure::capture_fail; use replicante_util_failure::fa...
// Most of the code here is lifted from `rustc/src/libstd/panicking.rs`. It has // been adapted to run on the PSP. use crate::sys; use core::{mem::{self, ManuallyDrop}, any::Any, panic::{PanicInfo, BoxMeUp, Location}}; use core::fmt; use alloc::{boxed::Box, string::{String, ToString}}; #[link(name = "unwind", kind = ...
//! ATA PIO driver //! It's dumb and slow, but it's enough to load stuff from disk use lazy_static::lazy_static; use spin::Mutex; use crate::drivers::{BlockErr,BlockRead}; use crate::cpu::{disable_int, enable_int, Port, io_wait}; const COMMAND_READ: u8 = 0x20; const COMMAND_IDENTIFY: u8 = 0xEC; const STATUS_ERR: u...
//! //! The Zinc compiler binary. //! use std::cell::RefCell; use std::collections::HashMap; use std::convert::TryFrom; use std::ffi::OsString; use std::fs::File; use std::io::Write; use std::path::PathBuf; use std::process; use std::rc::Rc; use failure::Fail; use structopt::StructOpt; use zinc_compiler::Bytecode; u...
pub use crate::aabb::AABB; pub use crate::material::Material; pub use crate::oneweekend::degree_to_radian; pub use crate::oneweekend::INF; pub use crate::ray::Ray; pub use crate::vec3::Vec3; pub use std::sync::Arc; #[derive(Clone)] pub struct HitRecord { pub p: Vec3, pub normal: Vec3, pub mat_ptr: Arc<dyn ...
use self::{ buffer::{BufferDescriptor, BufferId, BufferInitDescriptor}, sampler::{SamplerDescriptor, SamplerId}, texture::TextureId, }; use std::{collections::HashMap, sync::Arc}; use tokio::sync::RwLock; use wgpu::util::DeviceExt; use winit::{ dpi::PhysicalSize, window::{Window, WindowId}, }; pub ...
//! //! Handle for tasks which don't need to unwind panics inside //! the given futures. use crate::proc_data::ProcData; use crate::proc_stack::ProcStack; use crate::state::*; use std::fmt::{self, Debug, Formatter}; use std::future::Future; use std::marker::{PhantomData, Unpin}; use std::pin::Pin; use std::ptr::NonNull...
#[cfg(test)] pub mod test; use std::{ io::{self, Write}, str, }; use bitflags::bitflags; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use failure::Fail; use num_integer::Integer; use crate::{impl_from_error, try_read_optional, PduParsing}; const CHANNELS_MAX: usize = 31; const CLIENT_CHANNEL...
use std::result; use std::str; use base64::display::Base64Display; use bytes::{Buf, BytesMut}; use httparse::{self, Header, Response}; use sha1::{self, Sha1}; use tokio_util::codec::{Decoder, Encoder}; use crate::{Error, Result}; type Sha1Digest = [u8; sha1::DIGEST_LENGTH]; fn build_ws_accept(key: &str) -> Sha1Dige...
/// file that tries to mimic the behaviour of the file optfields.rs /// optfields.rs find, parse and store all the different types of /// optional fields associated to each kind of lines. /// with the format GFA2 the optional field tag is been replaced by a /// simple tag element with 0 or N occurencies. /// So, I don'...
//! Build a Sightglass engine using Wasmtime. Usage: //! //! ``` //! rustc build.rs //! [REPOSITORY=<repo url>] [REVISION=<hash|branch|tag>] ./build [<destination dir>] //! ``` #![deny(missing_docs)] #![deny(clippy::all)] #![warn(clippy::pedantic)] #![allow(clippy::or_fun_call)] use std::env; use std::fs; use std::fs...
//! Exposed structures based on the reduction stage. //! //! This module offers the `Reducer` trait, which allows a developer //! to easily create a reduction stage due to the sane defaults. Also //! offered is the `ReducerLifecycle` binding for use as an IO stage. use crate::context::{Context, Delimiters}; use crate::...
use std::collections::{BTreeMap, HashMap}; use std::fs; use std::fs::{File, OpenOptions}; use std::io::{BufRead, BufReader, Write}; use std::path::Path; use std::process::Command; use futures::executor::block_on; use npm_package_json::Package; use serde_json::{from_str, Value}; use crate::utility::{ copy_file_conte...
#![cfg_attr(not(feature = "std"), no_std)] use frame_support::{ decl_module, decl_storage, decl_event, decl_error, dispatch, ensure, traits::{Get}, traits::{Currency}, }; use frame_system::{self as system, ensure_signed}; use sp_std::prelude::*; use codec::{Encode, Decode}; use primitives::{Vpp, Balance}; #[cfg(te...
// Copyright 2020-2021 <NAME> under the terms of the MIT License as detailed // in the accompanying file README.md or <https://opensource.org/licenses/MIT>. //! Headless image (and someday video) generation. use std::array::IntoIter; use std::borrow::Cow; use std::error::Error; use std::ffi::OsString; use std::fs::Fi...
use std::collections::HashMap; #[derive(Clone, Debug, PartialEq)] pub struct HtmlElement { pub get: bool, pub remove: bool, pub disabled: Option<bool>, pub class: String, pub name: String, pub inner: Option<String>, pub text: Option<String>, pub value: Option<String>, pub checked: O...
#![feature(format_args_capture)] use proc_macro::TokenStream; use quote::quote; use std::collections::HashMap; use syn::{parse_macro_input, DeriveInput, Lit, Meta, MetaList, MetaNameValue}; use cache_macro::cache; use lru::LruCache; use ron::de::from_str; use serde::Deserialize; use std::env; use std::fs::File; use st...
//! # Functions //! //! LLVM function definitions consist of the “define” //! keyword, and an optional fields. //! //! LLVM function declarations consist of the “declare” //! keyword, an optional fields. //! //! A function definition contains a list of basic blocks, forming the //! CFG (Control Flow Graph) for the func...
static DAYS_IN_MONTH: [u32; 12] = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; static DAYS_IN_MONTH_LEAP_YEAR: [u32; 12] = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; fn days_in_month(is_leap_year: bool) -> &'static [u32; 12] { if is_leap_year { &DAYS_IN_MONTH_LEAP_YEAR } else { &DAYS...
use crate::testspec::TestSpec; use mktemp::Temp; use xlsxwriter::{FormatAlignment, FormatBorder, FormatColor, Workbook, Worksheet, XlsxError}; use super::GenerateOption; pub fn generate_excel(spec: &TestSpec, option: &GenerateOption) -> anyhow::Result<Vec<u8>> { let temp_file = Temp::new_file()?; let filenam...
use futures::{Future, Poll}; use tokio_io::{AsyncRead, AsyncWrite, IoFuture}; use tokio::net::TcpStream; use std::net::Shutdown; use tokio_dns::TcpStream as ResolvedTcpStream; use std::sync::Arc; use std::io::{Error as IoError, ErrorKind as IoErrorKind, Read, Result as IoResult, Write}; use config::{Proxy, Tunnel}; use...
#![allow(unused_variables)] #![allow(dead_code)] #![allow(non_camel_case_types)] #[path = "../uart/mod.rs"] mod uart; // Function pointer types used pub type espconn_connect_callback = unsafe extern "C" fn(arg: *mut u32); pub type espconn_reconnect_callback = unsafe extern "C" fn(arg: *mut u32, err: i32); pub type es...
#![cfg_attr(not(feature = "std"), no_std)] use frame_support::traits::{Currency, OnUnbalanced, ReservableCurrency}; pub use pallet::*; use sp_runtime::traits::Zero; use sp_std::prelude::*; pub use gafi_primitives::{ constant::ID, name::Name }; type AccountIdOf<T> = <T as frame_system::Config>::AccountId; type Bala...
use std::borrow::Cow; use chrono::{DateTime, SecondsFormat, Utc}; use colored::Colorize; use regex::Regex; use serde::Deserialize; pub const LEVELS: [&str; 6] = ["TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"]; #[derive(Deserialize, Debug)] pub struct LogRecord<'a> { pub time: DateTime<Utc>, pub level: &...
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
use crate::{Value, Ast}; use std::fmt::{self, Debug, Formatter}; #[derive(Clone, Copy)] pub struct Function { arity: usize, func: fn(&[Ast]) -> Value } impl Debug for Function { fn fmt(&self, f: &mut Formatter) -> fmt::Result { f.debug_tuple("Function") .field(&self.arity) .field(&(self.func as *const ()))...
use ethereum_types::{H256, U256}; use crate::{parameters::VERKLE_NODE_WIDTH, Address32, Hasher}; #[must_use] pub(crate) fn swap_last_byte(mut hash: H256, byte: U256) -> H256 { let byte: u8 = byte .as_u32() .try_into() .expect("number cannot be represented as a byte"); let bytes = hash...
pub use cipher; use cipher::{ consts::{U1, U10, U24, U32, U4, U6, U64, U8}, generic_array::{typenum::Unsigned, GenericArray}, Block, BlockSizeUser, IvSizeUser, KeyIvInit, KeySizeUser, ParBlocksSizeUser, StreamBackend, StreamCipherCore, StreamCipherCoreWrapper, StreamCipherSeekCore, StreamClosure, }; us...
//! Implementation of USDT functionality on platforms without runtime linker support. // Copyright 2021 Oxide Computer Company // // 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 // // h...
use crate::internal::{Serializable, Visitor}; use crate::{AnimatorBase, Enum, Vector3, ZEROS_VECTOR_3}; use anyhow::Result; use num_enum::{IntoPrimitive, TryFromPrimitive}; use serde::{Deserialize, Serialize}; #[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Serialize, Deserialize)] pub struct Animated { pub ba...
/* This is part of mktcb - which is under the MIT License ********************/ use std::path::PathBuf; use snafu::{ResultExt, ensure}; use clap::ArgMatches; use serde_derive::Deserialize; use serde::de; use log::*; use crate::error::Result; use crate::error; #[derive(Debug)] pub struct Config { pub build_dir: P...
use azure_functions_shared::codegen; use proc_macro::{Diagnostic, Span, TokenStream}; use proc_macro2::Delimiter; use quote::ToTokens; use std::convert::TryFrom; use syn::buffer::TokenBuffer; use syn::parse::{Parse, ParseStream}; use syn::punctuated::Punctuated; use syn::spanned::Spanned; use syn::{parse, parse2, Attri...
//! The SSH executor is essentially a wrapped version of the local executor. //! It dispatches tasks to remote hosts extern crate serde_json; use super::{local_executor, ExecutorMessage, Result, RunnerMessage}; use crate::structs::{HashMap, TaskResources, TaskDetails}; use futures::stream::futures_unordered::FuturesU...