text stringlengths 3.09k 13.9k |
|---|
use std::{ffi::CString, rc::Rc};
use crate::vulkan::{ShaderModule, GentooRenderError, Device};
use super::PipelineCache;
pub struct Pipeline {
device: Rc<Device>,
pub graphics_pipeline: ash::vk::Pipeline,
vert_shader_module: Rc<ShaderModule>,
frag_shader_module: Rc<ShaderModule>,
}
impl Pipeline {
... |
use crate::{
layer::{self, Layer, LayerBuilder, Selection, ViewBuilder},
Gossip, Profile, Profiles, Topic,
};
use keynesis::key::ed25519;
use std::{net::SocketAddr, sync::Arc};
pub struct Topology {
view_layers: Vec<Box<dyn Layer>>,
gossip_layers: Vec<Box<dyn Layer>>,
profile: Profile,
profiles... |
//! Render commands for model files.
use errors::Result;
use util::cur::Cur;
pub struct SkinTerm {
pub weight: f32,
pub stack_pos: u8,
pub inv_bind_idx: u8,
}
/// A render command is analyzed into zero or more render ops (think micro-ops
/// to a CPU instruction).
pub enum Op {
/// cur_matrix = matri... |
use crate::db_connectors::{
conversations::*, memories::*, messages::*, state::*,
};
use crate::utils::*;
use crate::{data::*, delete_client_memories};
use csml_interpreter::{
data::{ast::ForgetMemory, csml_bot::CsmlBot, csml_flow::CsmlFlow, Event, Hold, MSG},
interpret,
};
use serde_json::{map::Map, Valu... |
use crate::{http, stack_labels, tcp, trace_labels, Config, Outbound};
use linkerd_app_core::{
config::{ProxyConfig, ServerConfig},
detect, errors, http_request_l5d_override_dst_name_addr, http_tracing, io, profiles,
proxy::api_resolve::Metadata,
svc::{self, stack::Param},
tls,
transport::{OrigDs... |
/*
Copyright 2021 Integritee AG and Supercomputing Systems AG
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... |
//! Utilities which make it easy to test with [`crate::plugin`].
mod mock;
mod service;
pub use mock::subgraph::MockSubgraph;
pub use service::{
MockExecutionService, MockQueryPlanningService, MockRouterService, MockSubgraphService,
};
use crate::introspection::Introspection;
use crate::layers::DEFAULT_BUFFER_SI... |
extern crate clap;
extern crate directories;
extern crate micro_http_server;
extern crate web_view;
use clap::{Arg, App};
use directories::ProjectDirs;
use micro_http_server::{MicroHTTP, Client};
use web_view::*;
use std::io;
use std::fs;
use std::path::Path;
use std::{thread, time};
struct ConfigView<'a> {
url: ... |
use std::collections::{HashMap, HashSet};
use std::convert::Infallible;
use std::str::FromStr;
struct Passport(HashMap<String, String>);
fn is_num_between<T: AsRef<str>>(val: T, min: u32, max: u32) -> bool {
val.as_ref()
.parse::<u32>()
.map(|num| min <= num && num <= max)
.unwrap_or(false... |
#![recursion_limit="1024"]
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::pin::Pin;
use std::sync::Arc;
use clap::{
crate_version, crate_authors,
App, Arg, ArgGroup,
};
use bytes::Bytes;
use futures::{
stream::{
StreamExt,
},
};
use pin_utils::pin_mut;
use rml_rtmp::{
ses... |
extern crate docopt;
extern crate image;
extern crate resvg;
extern crate usvg;
#[macro_use]
extern crate serde_derive;
extern crate terminal_size;
extern crate termpix;
use std::io::Write;
use docopt::Docopt;
use image::GenericImageView;
use image::*;
use terminal_size::{terminal_size, Height, Width};
use std::cmp:... |
use crate::config::*;
use crate::crypto::*;
use crate::dnscrypt::*;
use crate::globals::*;
use byteorder::{BigEndian, ByteOrder};
use clockpro_cache::ClockProCache;
use coarsetime::Clock;
use parking_lot::Mutex;
use std::mem;
use std::slice;
use std::sync::Arc;
pub const DNSCRYPT_CERTS_TTL: u32 = 86400;
pub const DNS... |
use ::distro::*;
use ::exec::session::Session;
use ::flota::config::cluster::host::Host as HostConfig;
use ::util::errors::*;
use ::virt::ResourceBlend;
use ::virt::domain::Domain;
pub mod x86_64;
#[derive(Debug, Clone)]
pub struct OpenSUSE13 {}
impl OpenSUSE13 {
pub fn new() -> Self {
OpenSUSE13 {}
}... |
use clap::{Parser, Subcommand};
use drgdfu::{FirmwareDevice, GattBoard};
use futures::lock::Mutex;
use futures::{pin_mut, StreamExt};
use serde_json::json;
use std::process::exit;
use std::sync::Arc;
use std::time::{Duration, Instant};
use tokio::time::sleep;
mod board;
mod firmware;
mod gateway;
use crate::board::{B... |
//! Format numbers for humans.
use std::cmp::max;
use std::fmt;
/// A number that is scaled in an easy to read way.
#[derive(Debug, Clone, Copy)]
pub struct Number(f64, Scale);
/// The scale to represent the number.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum Scale {
Nano,
Micro,
... |
/// Robust futexes provide a mechanism that is used in addition to normal futex,
/// for kernel assist of cleanup of held locks on thread exit.
///
/// Actual locking and unlocking is handled entirely by user level code with the
/// existing futex mechanism to wait or wakeup locks.
/// The kernels only essential involv... |
use wasm_bindgen::JsValue;
use moclib::qty::{Hpx, Time};
use moclib::elemset::range::MocRanges;
use moclib::moc::range::RangeMOC;
use moclib::hpxranges2d::TimeSpaceMoc;
use moclib::moc2d::{HasTwoMaxDepth, RangeMOC2IntoIterator};
use moclib::moc2d::range::RangeMOC2;
use super::store;
use super::common::{SMOC, TMOC, S... |
extern crate num;
use num::complex::Complex;
use std::f64::consts::PI;
use corundum::open_flags::*;
const I: Complex<f64> = Complex { re: 0.0, im: 1.0 };
pub fn read(filename: &str) -> std::io::Result<Vec<Complex<f64>>> {
use std::fs::File;
use std::io::prelude::*;
use std::io::BufReader;
let file = ... |
use crate::{
crypto::hash::HashFunction,
crypto::hmac::{self, HmacKey},
error::Error,
};
use serde::ser::Serialize;
const MLS_PREFIX: &[u8] = b"mls10 ";
// This struct is only used in `hkdf::expand_label`
#[derive(Serialize)]
struct HkdfLabel<'a> {
// uint16 length = Length;
length: u16,
// ... |
//! Helper functions for SQL queries
/// Query string for SELECT queries
#[derive(Deserialize)]
pub struct SelectQuery {
/// Left creation bounder timestamp
pub from: Option<i32>,
/// Right creation bounder timestamp
pub to: Option<i32>,
/// Query size limit
pub limit: Option<i64>,
/// Whet... |
use crate::error::*;
use crate::token::*;
use crate::token_type::*;
pub struct Scanner {
source: Vec<char>,
tokens: Vec<Token>,
start: usize,
current: usize,
line: usize,
}
impl Scanner {
pub fn new(source: String) -> Scanner {
Scanner {
source: source.chars().collect(),
... |
use std::fmt;
use crossterm::event;
use crossterm::event::KeyCode;
use serde::Deserialize;
#[cfg(test)]
use serde::Serialize;
/// Represents a key.
#[derive(PartialEq, Eq, Clone, Copy, Hash, Debug, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub enum Key {
/// Both Enter (or Return) and numpad Enter
En... |
use redis::{ErrorKind, IntoConnectionInfo, Pipeline};
/// Enables connecting to a redis sentinel and get a connection to the
/// advertised master node in a group.
///
/// see: https://redis.io/topics/sentinel
#[derive(Debug, Clone)]
pub struct SentinelClient {
sentinel_client: redis::Client,
}
pub struct Sentine... |
use lazy_static::lazy_static;
use regex::Regex;
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
pub enum Side {
Top,
Right,
Bottom,
Left,
}
impl Side {
pub fn calculate_rotation(&self, other_side: &Side) -> usize {
(4 + other_side.value() - self.value()) % 4
}
fn value(&self) -... |
use core::{
any::{Any, TypeId},
hash::BuildHasherDefault,
ops::Deref,
};
use std::collections::HashMap;
#[cfg(feature = "cloneable-any")]
use cloneable_any::CloneableAny;
pub mod extensions;
pub mod hasher;
#[cfg(feature = "cloneable-any")]
pub use extensions::{CloneableExtensions, CloneableExtensionsSyn... |
use block_modes::{block_padding::NoPadding, BlockMode, BlockModeError, Cbc};
use blowfish::Blowfish;
use reqwest::Client;
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
use std::error::Error;
use crate::{error::DeezerApiError, song::Song};
const PRIVATE_DEEZER_API_LINK: &str = "https://www.deezer... |
//! Code to convert the Rust-styled field/variant (e.g. `my_field`, `MyType`) to the
//! case of the source (e.g. `my-field`, `MY_FIELD`).
// See https://users.rust-lang.org/t/psa-dealing-with-warning-unused-import-std-ascii-asciiext-in-today-s-nightly/13726
#[allow(deprecated, unused_imports)]
use std::ascii::AsciiEx... |
use std::env;
use std::process;
use std::fs::File;
use std::fs;
use std::io::BufReader;
use std::io::{Write, Read};
use dirs;
extern crate rand;
mod encryptor;
use serde::{Serialize, Deserialize};
use getopts::Options;
//change this
const FIRST_OFFSET_LENGTH: i64 = 64;
//change this
const LAST_OFFSET_LENGTH: i64 = 6... |
use crate::{BinaryReader, Error, ErrorKind};
use async_std::io::Read;
use std::{marker::Unpin, sync::Arc};
impl<R: Read + Unpin> BinaryReader<R> {
#[inline]
pub(crate) async fn len_var_i32(&mut self, max: Option<usize>) -> Result<usize, Error> {
let count = self.var_i32().await?;
if count < 0 {... |
use crate::Source;
use anyhow::{Context, Result};
use num_rational::BigRational;
use num_traits::ToPrimitive;
use prometheus::{
Encoder, Gauge, GaugeVec, IntCounter, IntGauge, IntGaugeVec, Registry, TextEncoder,
};
use std::sync::{Arc, RwLock};
use warp::{http::StatusCode, Filter};
async fn handle_metrics(registry... |
use std::env;
use accounts::BalanceRequest;
use anyhow::{anyhow, Result};
use bat::{Input, PrettyPrinter};
use etrade::orders::{ListOrdersRequest, OrderStatus, TransactionType};
use etrade::KeychainStore;
use etrade::{self, SortOrder};
use etrade::{accounts, MarketSession, SecurityType};
use serde::Serialize;
use std:... |
use crate::core::cli::ProgramInfo;
use crate::core::git::git_current_branch;
use colored::*;
use serde::{Deserialize, Serialize};
use std::fs;
use std::io::prelude::*;
use std::path::Path;
use std::path::PathBuf;
use std::process::exit;
const CONFIG_INIT: &str = r#"
{
"projects": []
}
"#;
#[derive(Serialize, Dese... |
// Copyright ⓒ 2018 <NAME>
// Licensed under the MIT license
// (see LICENSE-MIT or <http://opensource.org/licenses/MIT>) All files in the project carrying such
// notice may not be copied, modified, or distributed except according to those terms.
//! 'stitcher' is a utility that stitches 4 images together
//!
//!
//!... |
// Copyright 2019, <NAME>
use cgmath::{
Matrix4,
Point3,
// SquareMatrix,
Vector2,
Vector3,
};
use vulkano::{
command_buffer::{
DynamicState,
},
device::{
Device,
DeviceExtensions,
Queue,
QueuesIter,
},
framebuffer::{
Framebuffer,... |
//! Hash functions by <NAME> (https://hbfs.wordpress.com/)
//!
//! From:
//!
//! * https://hbfs.wordpress.com/2015/09/29/hash-functions-part-i/
//! * https://hbfs.wordpress.com/2015/10/06/the-anatomy-of-hash-functions-hash-functions-part-ii/
//! * https://hbfs.wordpress.com/2015/10/13/testing-hash-functions-hash-functi... |
use crate::coil::Coil;
use crate::current_control::{CurrentDevice, PIDControl};
use crate::position_control::{PositionControl, PositionInput};
//use crate::pid::{Controller, PIDController};
const DWT_FREQ: i32 = 72_000_000;
const UPDATE_PERIOD: i32 = DWT_FREQ / 20_000;
pub trait PositionControlled {
fn set_angle(... |
// This file is part of mlnx-ofed. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/mlnx-ofed/master/COPYRIGHT. No part of mlnx-ofed, including this file, may be copied, modified, propagated, or distributed ... |
use std::{sync::Arc};
use std::collections::HashSet;
use tracing::debug;
use tracing::trace;
use tracing::warn;
use async_trait::async_trait;
use futures_util::io::AsyncRead;
use futures_util::io::AsyncWrite;
use futures_util::stream::StreamExt;
use tokio::select;
use fluvio_types::event::SimpleEvent;
use fluvio_sock... |
use downcast_rs::Downcast;
use std::sync::Arc;
use std::ops::Deref;
use na::{self, RealField};
use ncollide::query::TrackedContact;
use crate::object::{Body, BodyPart, Collider};
use crate::material::MaterialsCoefficientsTable;
use crate::math::Vector;
/// The context for determining the local material properties at... |
use crate::println;
use core::cell::UnsafeCell;
use core::mem;
use core::ptr;
const FREE: u32 = 0xA110F7EE;
const USED: u32 = 0xA10045ED;
const CHUNK_SIZE: u32 = mem::size_of::<Chunk>() as u32;
const MIN_ALIGNMENT: u32 = mem::size_of::<Chunk>() as u32;
// helper function to align size
#[inline(always)]
fn align_up(x:... |
use std::cmp::min;
use std::default::Default;
use std::ops::{Add, Sub};
const TERMINAL: usize = ::std::usize::MAX;
pub struct GraphSeparation<T>
where
T: Add<T, Output = T> + Sub<T, Output = T> + Default + Copy,
{
n: usize,
m: usize,
top: Vec<usize>,
dest: Vec<usize>,
next_edge: Vec<usize>,
... |
//! Some utils for pagination and patch
use crate::error::PointercrateError;
use actix_web::http::HeaderMap;
use log::warn;
use mime::Mime;
use serde::{de::Error, Deserialize, Deserializer};
use std::str::FromStr;
macro_rules! pagination_response {
($endpoint: expr, $objects:expr, $pagination:expr, $min_id:expr, ... |
use crate::model::repo::RepoSource;
use crate::pure_functions::files;
use crate::{Config, CoreError, Tx};
use lockbook_models::file_metadata::FileType::{Document, Folder};
use lockbook_models::file_metadata::{DecryptedFileMetadata, DecryptedFiles};
use lockbook_models::tree::{FileMetaMapExt, FileMetadata};
use uuid::Uu... |
#[macro_use]
extern crate log;
use std::env;
use std::sync::Arc;
use std::vec::Vec;
use async_std::net::{SocketAddr, TcpListener};
use async_std::prelude::*;
use async_std::task;
use tide::Request;
use stunnel::client::*;
use stunnel::cryptor::Cryptor;
use stunnel::logger;
use stunnel::proxy::{http, socks5, Proxy};... |
// Copyright 2021 <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 writ... |
// Increase recursion_limit for `futures::select` macro
#![recursion_limit = "1024"]
// Needed for pareen stuff
#![type_length_limit = "600000000"]
mod bot;
mod fake_bad_net;
mod game;
mod http;
mod run;
mod runner;
mod tiled;
mod webrtc;
use std::{path::PathBuf, time::Duration};
use clap::Arg;
use log::{info, warn}... |
use crate::types::systemdata::*;
use crate::types::*;
use specs::*;
use crate::SystemInfo;
use crate::component::event::PlayerRepel;
use crate::component::flag::{IsMissile, IsPlayer};
use crate::component::reference::PlayerRef;
use crate::systems::specials::config::*;
use crate::utils::{EventHandler, EventHandlerType... |
use std::cmp::{max, min};
use utils::*;
use vector::*;
fn gcd(a: usize, b: usize) -> usize {
match ((a, b), (a & 1, b & 1)) {
((x, y), _) if x == y => y,
((0, x), _) | ((x, 0), _) => x,
((x, y), (0, 1)) | ((y, x), (1, 0)) => gcd(x >> 1, y),
((x, y), (0, 0)) => gcd(x >> 1, y >> 1) <<... |
use super::{Drawable, StatefulPane};
use crate::{
models::QueueInfo,
widgets::{
confirmation::ConfirmationBox, files::FileNavigator, help::Help, notif::Notification,
},
DataContainer, Datatable, ManagementClient, Rowable,
};
use std::{
fs,
sync::{mpsc, Arc},
};
use clipboard::{Clipboar... |
use num_bigint::{BigInt, BigUint, ToBigInt};
use num_traits::{One, Zero};
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
mod collatz;
mod util;
const BASE: u32 = 10;
const MAX_ITERATIONS: usize = 10000;
/// Reverse the base 10 representation of the input number and return the sum.
/// E.g. reverse_and_add... |
use std::collections::HashMap;
use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::io;
use std::mem;
use std::net::{IpAddr, SocketAddr};
extern crate flate2;
use flate2::read::ZlibDecoder;
extern crate netflowv9;
use netflowv9::*;
fn main() {
let stdout = io::stdout();
let mut out = stdout.loc... |
use huffman::{annotate, build_tree, compress, decompress};
use huffman::{FrequencyTable, Mapping, Node};
#[test]
fn test_huffman_alnum() {
// Test alphanumeric messages
let messages: Vec<String> = vec![
"PT3IPpBdlYhrAxlO3eYN".to_string(),
"ezVRhK7Daqprm8RuYlQr".to_string(),
"7DY5boVpKee... |
//! IO wrapper which provides `safe` socket interface using Zephyr socket API.
//! Currently supports only TCP & UDP.
use bindings::zephyr;
use core::mem::size_of;
pub type RawFd = cty::c_int;
pub type Errno = cty::c_int;
/// Constants used in `socket()` to specify the domain to communicate;
/// i.e., address family... |
use crate::{
types::{Direction, GameMode, InboundMessage, Map, OutboundMessage},
utils::Coordinate,
};
use clap::crate_version;
use log::{debug, info};
use rustc_version::version;
use serde_json;
use std::mem;
use target_info::Target;
use ws;
use std::collections::HashSet;
const HEARTBEAT_TOKEN: ws::util::Token = ... |
//! Storage Pool configuration.
use crate::checksum::Checksum;
use crate::vdev::{self, Vdev as VdevTrait, VdevBoxed};
use itertools::Itertools;
use libc;
use ref_slice::ref_slice;
use std::fmt;
use std::fmt::Write;
use std::fs::OpenOptions;
use std::io;
use std::iter::FromIterator;
use std::os::unix::io::AsRawFd;
use s... |
// Copyright (C) 2017-2018 Baidu, Inc. All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of condit... |
use crate::app::Context;
use crate::handler::{HandlerResponse, HandlerResult};
use serde::{Deserialize, Serialize};
use sos21_domain::context::Login;
use sos21_use_case::export_projects;
use warp::http::StatusCode;
#[derive(Debug, Clone, Deserialize)]
pub struct Request {
#[serde(default)]
pub field_id: Optio... |
#![deny(warnings)]
use autoclap::autoclap;
use clap::App;
use clap::Arg;
use std::vec::Drain;
use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Method, Request, Response, Server, StatusCode};
use chrono::prelude::*;
use hyper::server::conn::AddrStream;
use std::net::SocketAddr;
use std::process::C... |
use rand::Rng;
use std::collections::HashMap;
use std::{thread, time};
use graphql_client::*;
use crate::UserRepoInteractions;
#[derive(GraphQLQuery)]
#[graphql(
schema_path = "graphql/schema.json",
query_path = "graphql/queries/user_stars.graphql",
response_derives = "Debug"
)]
struct UserStars;
#[derive(Gra... |
//! This module contains the mid-level intermediate representation of code.
//! Much of this code is heavily inspired by the Rust compiler.
mod definition;
mod expr;
mod impls;
pub mod mir;
mod pattern_match;
mod validate;
use std::{collections::BTreeMap, fmt::Display};
use mir::{
ArgumentIndex, ControlFlowGraph... |
//! The main `Query` interface.
mod attributes;
mod events;
mod helpers;
mod manipulation;
mod traversing;
use crate::error::Error;
use derive_more::{AsRef, Deref, DerefMut, From, Into};
use std::{
collections::VecDeque,
convert::{TryFrom, TryInto},
fmt,
iter::FromIterator,
};
use wasm_bindgen::JsCast... |
use nom::character::complete::digit1;
use nom::character::complete::space0;
use nom::combinator as c;
use nom::IResult;
use std::str;
/// Wrap a parser with space-consumers
pub fn ws<'a, F: 'a, O, E: nom::error::ParseError<&'a [u8]>>(
inner: F,
) -> impl FnMut(&'a [u8]) -> IResult<&'a [u8], O, E>
where
F: FnM... |
use bevy::prelude::*;
use rand::seq::SliceRandom;
use serde::{Deserialize, Serialize};
use super::net::{ConnectionInfo, CreateNotes};
// game stuff
#[derive(Properties, Default, PartialEq, Debug, Clone, Serialize, Deserialize)]
pub struct Note {
pub note: String,
pub from: String,
pub ordinal: u8,
}
imp... |
//! Unified Communication Protocol (UCP).
use futures::task::AtomicWaker;
use std::ffi::CString;
use std::mem::MaybeUninit;
use std::os::raw::c_void;
use std::ptr::{null, null_mut};
use std::rc::Rc;
use std::sync::Arc;
use ucx_sys::*;
mod endpoint;
mod listener;
mod worker;
use crate::Error;
pub use self::endpoint:... |
/*
* Copyright 2018 ProximaX Limited. All rights reserved.
* Use of this source code is governed by the Apache 2.0
* license that can be found in the LICENSE file.
*/
use std::fmt;
use {
::std::ops::Deref,
base32::Alphabet::RFC4648,
serde::ser::SerializeStruct,
serde::{Serialize, Serializer},
};
... |
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
// pub struct TreeNode {
// pub val: i32,
// pub left: Option<Rc<RefCell<TreeNode>>>,
// pub right: Option<Rc<RefCell<TreeNode>>>,
// }
//
// impl TreeNode {
// #[inline]
// pub fn new(val: i32) -> Self {
// TreeNode {
// val,
... |
use std::{fmt, mem};
use pelite::pe64::*;
use pelite::pattern as pat;
use pelite::{Pod, util::CStr};
pub fn print(bin: PeFile, _dll_name: &str) {
let tables = tables(bin);
tprint! {
"## RecvTables\n\n"
for table in (&tables) {
"<details>\n"
"<summary><code>class "{table.name}
if let Some(base) = (tabl... |
use crate::errors::*;
use crate::extractors::OptionalUser;
use actix_web::{HttpRequest, Result};
use db::models::User as DbUser;
use db::models::{scopes, Event, EventUser, Order, Organization, Roles, Scopes};
use db::prelude::errors::EnumParseError;
use db::prelude::Optional;
use diesel::PgConnection;
use log::Level::W... |
use log::info;
use log::{debug, warn};
use owo_colors::OwoColorize;
use snork::logging;
use structopt::StructOpt;
use snork::agents::*;
use snork::env::*;
use snork::game::*;
use rand::prelude::*;
use rand::seq::IteratorRandom;
use std::iter::repeat;
use std::time::Instant;
#[derive(structopt::StructOpt)]
#[structop... |
extern crate cc;
extern crate cmake;
extern crate heck;
extern crate regex;
use heck::CamelCase;
use regex::Regex;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;
#[derive(Clone, PartialEq, Debug)]
struct Pass {
id: String,
name: String,
description: String,
}
fn rea... |
//! The Credentials Provider to read from Environment Variables.
use async_trait::async_trait;
use chrono::{DateTime, FixedOffset, Utc};
use crate::credential::{
non_empty_env_var, AwsCredentials, CredentialsError, ProvideAwsCredentials,
};
/// Provides AWS credentials from environment variables.
///
/// # Availa... |
#![cfg_attr(not(feature = "std"), no_std)]
use frame_support::{
decl_module, decl_storage,
decl_event, decl_error,
dispatch, ensure,
Parameter,
traits::{Currency, Get, FindAuthor},
weights::Weight,
};
use frame_system::{ensure_signed, ensure_root};
use sp_runtime::{
// RuntimeDebug, DispatchResult, DispatchErr... |
use crate::abort_now;
use proc_macro2::Span;
use proc_macro2::TokenStream;
use quote::{quote_spanned, ToTokens};
/// Represents a diagnostic level
///
/// # Warnings
///
/// Warnings are ignored on stable/beta
#[derive(Debug, PartialEq)]
pub enum Level {
Error,
Warning,
#[doc(hidden)]
NonExhaustive,
}... |
#![feature(try_from)]
#![warn(
clippy::print_stdout,
clippy::unimplemented,
clippy::doc_markdown,
clippy::items_after_statements,
clippy::match_same_arms,
clippy::similar_names,
clippy::single_match_else,
clippy::use_self,
clippy::use_debug
)]
extern crate serde_json;
#[macro_use]
e... |
use once_cell::sync::{Lazy, OnceCell};
use serde::{Deserialize, Serialize};
static LOG_SCHEMA: OnceCell<LogSchema> = OnceCell::new();
static LOG_SCHEMA_DEFAULT: Lazy<LogSchema> = Lazy::new(LogSchema::default);
/// Loads Log Schema from configurations and sets global schema. Once this is
/// done, configurations can b... |
/*
* Copyright 2017 <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 writin... |
use byteorder::{BigEndian, WriteBytesExt};
use super::*;
use utils::shift_bytes_left;
#[derive(Debug, PartialEq)]
pub enum EncodeError {
MissingSizeConstraint,
MissingValueConstraint,
NotImplemented,
WriteError,
}
/// A wrapper for an aligned PER encoding.
///
/// An `Encoding` is just a vector of byt... |
use crate::api::locations::Storage;
use crate::api::{LocationWeather, WeatherAPI};
use crate::views::{View, WeatherBoard};
use anyhow::Error;
use wasm_bindgen::JsCast;
use web_sys::HtmlMediaElement;
use yew::format::Json;
use yew::services::console::ConsoleService;
use yew::services::fetch::Response;
use yew::services:... |
//! This module handles the initialization of the Sign protocol.
//! A [SignInitSanitized] struct is created out of the raw incoming [proto::SignInit] message and the session key is queried inside from KvStore.
//! If [proto::SignInit] fails to be parsed, or no Keygen has been executed for the current session ID, an [a... |
//! bfvm is the brainfuck virtual maschine.
use std::collections::HashMap;
use vm_state::VMState;
use prog_state::{ProgState, ProgOutput};
/// VM collects all the state for a BF program.
pub struct VM {
/// The virtual machine state
vms : VMState,
/// The program state
prg : ProgState,
/// The jum... |
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;
use yaserde_derive::{YaDeserialize, YaSerialize};
use crate::{Attribution, Lang};
/// A note that was contributed from genealogical research.
///
/// Notes are not intended to contain genealogical conclusions. Notes are only
/// associated wi... |
use std::env;
use clap::{crate_version, App, Arg};
use env_logger::Env;
use log::{debug, info, warn};
use auth::Client;
use crate::download::Downloader;
use crate::errors::ReddSaverError;
use crate::errors::ReddSaverError::DataDirNotFound;
use crate::user::{ListingType, User};
use crate::utils::*;
mod auth;
mod dow... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
use std::{borrow::Cow, convert::TryFrom, io, sync::PoisonError};
use crypto::hash::ContextHash;
use thiserror::Error;
use tezos_timing::{RepositoryMemoryUsage, SerializeStats};
#[cfg(test)]
use crate::serialize::... |
mod report;
use std::collections::HashSet;
use std::fs::File;
use std::io::{self, Read};
use std::path::Path;
use anyhow::Context;
use petgraph::graph::NodeIndex;
use petgraph::visit::Bfs;
use rustsec::advisory::Severity;
use rustsec::cargo_lock::dependency::Tree;
use rustsec::{Database, Vulnerability};
use rustsec::... |
#[macro_use] extern crate clap;
#[macro_use] extern crate log;
use futures::stream::Stream;
use futures::{Async, Future, Poll};
use hyper::header::CONTENT_TYPE;
use hyper::service::service_fn;
use hyper::StatusCode;
use hyper::{Body, Request, Response, Server};
use rand::distributions::Alphanumeric;
use rand::{thread_r... |
use retroshare_compat::{read_u32, read_u64};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use crate::{
parser::{
headers::{Header, ServiceHeader},
Packet,
},
serial_stuff,
services::{HandlePacketResult, Service},
utils::simple_stats::StatsCollection,
};
const RTT_SERVICE: u16... |
use std::collections::{HashMap, HashSet};
use std::path::Path;
use indextree::{Arena, NodeId};
use fs::{fs_to_tree, FileType, FsEntry};
use options::*;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum PrefixPiece {
BarIndent,
BlankIndent,
MidBranch,
EndBranch,
}
#[derive(Debug, Clone, PartialEq... |
use pnet::{
datalink::{interfaces, NetworkInterface},
util::MacAddr,
};
use std::ffi::OsString;
use std::str::FromStr;
use std::{fs, io, path};
#[derive(PartialEq, Clone, Debug)]
pub(crate) struct UnixNetworkDevice {
name: String,
mac: MacAddr,
interface: NetworkInterface,
statistics: UnixNetwo... |
use std::cell::Cell;
use std::collections::HashMap;
use std::rc::Rc;
use crate::error::LfscError;
use crate::expr::Expr;
impl From<ExprEnvEntry> for (Rc<Expr>, Rc<Expr>) {
fn from(e: ExprEnvEntry) -> Self {
(e.val, e.ty)
}
}
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct ExprEnvEntry {
pub val... |
use diesel::prelude::*;
use diesel::result::Error as DieselError;
use diesel::{ConnectionError, PgConnection};
use diesel_migrations as migrations;
use diesel_migrations::RunMigrationsError;
use std::convert::From;
use std::env;
use std::io::stdout;
use super::connection::DatabaseConnection;
#[derive(Debug, PartialEq... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved0: [u8; 0x40],
#[doc = "0x40 - HMAC start control register"]
pub set_start: crate::Reg<set_start::SET_START_SPEC>,
#[doc = "0x44 - HMAC parameter configuration register"]
pub set_para_purpose: crate::Reg<set_para_purpose::SET_... |
//! Utility constants, structs and functions global for both `views` and the main function.
use std::path::PathBuf;
use std::time::Instant;
use wgpu_glyph::{Section, Scale};
use std::sync::{mpsc, Arc, Mutex};
use zerocopy::{AsBytes, FromBytes};
lazy_static! {
pub static ref ABSOLUTE_PATH: PathBuf = std::env::current... |
//! Use the built-in widgets or create your own.
//!
//! # Built-in widgets
//! Every built-in drawable widget has its own module with a `Renderer` trait
//! that must be implemented by a [renderer] before being able to use it as
//! a [`Widget`].
//!
//! # Custom widgets
//! If you want to implement a custom widget, y... |
use cosmwasm_std::{from_binary, to_binary, Addr, Binary, Empty, Response, StdResult, Uint128};
use cw20::Cw20ReceiveMsg;
use cw20::{BalanceResponse, TokenInfoResponse};
use cw_storage_plus::Map;
use lazy_static::lazy_static;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::sync::RwLock;
use terra... |
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MI... |
use std::path::PathBuf;
use structopt::StructOpt;
use super::*;
#[derive(StructOpt, Debug, Clone)]
#[structopt(name = "blackwater", about = "Asynchronous Port Scanner written in rust https://github.com/lflxp/blackwater")]
pub struct Params {
/// Scanned IP Range address eg: 127.0.0.1-255
#[structopt(short =... |
//! Intermediate representation for the physical layout of some type.
use super::derive::{CanTriviallyDeriveCopy, CanTriviallyDeriveDebug,
CanTriviallyDeriveDefault, CanTriviallyDeriveHash,
CanTriviallyDerivePartialEqOrPartialOrd, CanDerive};
use super::ty::{RUST_DERIVE_IN_ARRAY... |
use std::convert::TryInto;
use std::fmt;
use std::io::{self, BufRead};
use unicode_normalization::UnicodeNormalization;
#[cfg(feature = "serialize")]
use serde::Serialize;
pub type Tranche = u8;
// 28 values: A-Z, Punctuation, Space
#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone)]
pub struct Char(u8);
impl Ch... |
use crate::prelude::*;
use algebra::{Field, PairingEngine};
use core::fmt::Debug;
use r1cs_core::{ConstraintSystem, SynthesisError};
pub mod bls12;
pub trait PairingGadget<PairingE: PairingEngine, ConstraintF: Field> {
type G1Gadget: GroupGadget<PairingE::G1Projective, ConstraintF>;
type G2Gadget: GroupGadget... |
use crate::mac::Poly1305;
use crate::mem::constant_time_eq;
mod chacha20;
use self::chacha20::Chacha20;
/// ChaCha20 and Poly1305 for OpenSSH Protocols (<EMAIL>)
///
/// <https://github.com/openbsd/src/blob/master/usr.bin/ssh/PROTOCOL.chacha20poly1305>
#[derive(Clone)]
pub struct Chacha20Poly1305 {
c1: Chacha20,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.