text stringlengths 3.09k 13.9k |
|---|
/// Commands related to viewing notes/todos/reminders live here.
use crate::config::Config;
use crate::constants::*;
use crate::jot::{stream_jots, Jot, MessageType};
use anyhow::Result;
use colorful::Colorful;
use regex::Regex;
use std::collections::HashSet;
fn search_string_to_regex(search: &str) -> String {
// F... |
use crate::constants::{CHAN_TIMEOUT_S, INDEX_HEAP_SIZE, INIT_THREADS};
use crate::haslen::HasLen;
use crate::indexer;
use crate::resource::Resource;
use crate::scheduler;
use anyhow::{anyhow, Context, Result};
use crossbeam::channel::select;
use log::{debug, info, trace};
use crate::resource::Response;
use crossbeam:... |
//! This module provides the interface to different solvers.
//!
//! Both [`coin_cbc`](https://docs.rs/coin_cbc/latest/coin_cbc/) and
//! [`minilp`](https://docs.rs/minilp/0.2.2/minilp/) are available as cargo
//! [features](https://doc.rust-lang.org/cargo/reference/features.html). To use
//! them, specify your depende... |
use super::mat::Mat44;
use super::{vec::Vec3, Quaternion};
use serde::{Serialize, Deserialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct Transform {
mat: Mat44,
}
impl Transform {
const EPS: f32 = 0.0001;
pub fn new() -> Self {
Self {
mat: Mat44::new_identity(),
}
... |
// TODO: this file needs refactoring
use core::{fmt, mem};
use cortex_a::registers::*;
use tock_registers::interfaces::{Readable, Writeable};
use crate::{
addr::PGSIZE,
arch::interface::{MemLayout, TrapManager},
arch::{
asm::{intr_get, intr_off, intr_on, r_fpsr, w_fpsr},
intr::INTERRUPT_C... |
use std;
use std::io::{Read,Write,Stdout,Stdin,BufReader,BufWriter};
use std::result::Result;
use std::fmt::Display;
use codec::{self,Encode,Decode};
use estimation;
use consistency;
use simulation;
use experiment_stats;
use budgetary;
#[derive(Debug)]
pub enum ActionRequest {
BudgetaryConsistency(budgetary::cons... |
use std::collections::HashMap;
use std::convert::TryFrom;
use std::io::Read;
use byteorder::{BigEndian, ReadBytesExt};
use bytes::{Buf, BufMut, BytesMut};
use tokio_util::codec::{Decoder, Encoder};
mod header;
pub mod request;
pub mod response;
use crate::Error;
use header::{Header, HeaderCodec, LanguageCode, HEADER... |
extern crate chrono;
extern crate clap;
extern crate log;
extern crate simplelog;
use chrono::{DateTime, Duration, Local};
use clap::{value_t, values_t, App, Arg, ArgMatches};
use log::{debug, error, info, warn};
use simplelog::{
ColorChoice, CombinedLogger, ConfigBuilder, LevelFilter, SharedLogger, TermLogger,
... |
use krates::Utf8PathBuf as PathBuf;
use serde::{de, ser, Deserialize, Serialize};
use spdx::Expression;
use std::{collections::BTreeMap, fmt};
mod spdx_expr {
use super::*;
#[inline]
pub(crate) fn serialize<S>(expr: &Expression, serializer: S) -> Result<S::Ok, S::Error>
where
S: ser::Serialize... |
/*
/// Module handling user authentication and cookies
///
/// auth.rs
/// ├── UserCredentials: Struct
/// ├── UserToken: Struct
/// |
/// └── pub fn:
/// └── generate_http_cookie
/// └── add_user_cookie_to_context
/// └── get_username_from_cookie
/// └── str_to_hashed_string
*/
use blake2::{Blake2b, ... |
use super::Diagnostic;
use std::collections::HashMap;
use syn::{Attribute, Ident, Lit, Meta, NestedMeta, Path};
pub(crate) fn path_eq(path: &Path, s: &str) -> bool {
path.get_ident().map_or(false, |id| id == s)
}
pub(crate) fn def_to_name(
attr_name: &'static str,
ident: &Ident,
attrs: &[NestedMeta],
... |
use std::{
collections::HashSet,
net::{Ipv4Addr, SocketAddr, SocketAddrV4},
time::Duration,
};
use async_std::net::UdpSocket;
use crate::{device_information::DeviceInformation, error::Result};
/// Allows discovery of VBus-over-TCP devices in a local network.
///
/// All VBus-over-TCP devices listen for U... |
mod ffi;
mod error;
mod keyboard;
mod mouse;
mod screen;
use error::PlatformError;
type Error = crate::GenericError<PlatformError>;
const SHIFT_BIT: u32 = 0;
const OPTION_BIT: u32 = 1;
#[derive(Copy, Clone)]
struct KeyInfo {
key_code: u8,
modifiers: u8,
}
/// The main context used for generating events (mac... |
use crate::{constants::*, Credentials};
use anyhow::Result;
use std::convert::{TryFrom, TryInto};
use std::net::{IpAddr, SocketAddr};
use tokio::io::{AsyncRead, AsyncReadExt};
use url::Url;
#[derive(Clone, Debug)]
pub struct ProxyAddress {
pub socks_version: u8,
pub host: String,
pub port: u16,
pub cre... |
use std::{collections::HashMap, io::Cursor, sync::Arc};
use futures::{
channel::{mpsc, oneshot},
io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, WriteHalf},
lock::Mutex as AsyncMutex,
task::{Context, Poll},
FutureExt, SinkExt, Stream, StreamExt,
};
use parking_lot::Mutex;
use beserial::Se... |
use crate::action::basket::{add_to_basket, decrement_product_count};
use crate::{action::user::create_anon_with_basket, traits::service::Finder};
use actix_web::{http, web, HttpRequest, HttpResponse, Responder};
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, Debug)]
pub struct Body {
pub listi... |
use std::io::Read;
use nom::bits::complete::tag;
use nom::bits::complete::take;
use nom::branch::alt;
use nom::combinator::map;
use nom::multi::count;
use nom::sequence::preceded;
use nom::sequence::tuple;
use nom::IResult;
type Input<'a> = (&'a [u8], usize);
#[derive(Debug, Eq, PartialEq)]
enum Contents {
Liter... |
use crate::{hit::Hittable, Color, Hit, Ray};
/// A [`Hittable`] torus.
#[derive(Copy, Clone, Debug)]
pub(crate) struct Torus {
pub(crate) radius_major: f64,
pub(crate) radius_minor: f64,
}
impl Hittable for Torus {
fn hit(&self, incidence: Ray) -> Option<Hit> {
let Ray { origin, direction } = inci... |
use crate::crypto::hash_all;
use crate::encoding::{
decode_hex_to_bytes, decode_skylink_base64, encode_prefixed_bytes, encode_skylink_base64,
};
use crate::util::{str_to_bytes, trim_prefix, URI_SKYNET_PREFIX};
use bytes::{BufMut, BytesMut};
use sp_std::vec::Vec;
/// The string length of the Skylink after it has b... |
pub fn traits() {
println!("***Traits***");
basics();
derive();
operator_overloading();
dropping();
iterators();
cloning();
println!("");
}
fn basics() {
struct Sheep {
naked: bool,
name: &'static str,
}
trait Animal {
// static method signature
... |
// Copyright 2020-2021 <NAME>
// SPDX-License-Identifier: Apache-2.0
use crate::{
parent::Parents,
payload::{OptionalPayload, Payload},
Error, MessageId,
};
use bee_pow::providers::{miner::Miner, NonceProvider, NonceProviderBuilder};
use crypto::hashes::{blake2b::Blake2b256, Digest};
use packable::{
... |
use block::Block;
use transaction::Transaction;
use nonce::Nonce;
use unixtime;
use serializer;
use consensus;
use identification;
use hash;
pub struct BlockChain {
identifier: String,
blocks: Vec<Block>,
current_transactions: Vec<Transaction>,
}
impl BlockChain {
pub fn new() -> BlockChain {
let mut inst... |
use anyhow::{Context, Result};
use log::{debug, error, info, trace};
use pest::{iterators::Pairs, Parser};
use pest_derive::Parser;
use std::{collections::HashMap, convert::TryInto};
use twitchchat::{
messages::Commands, messages::Privmsg, runner::NotifyHandle, AsyncRunner, Status, UserConfig,
};
const GLOBAL_PREF... |
use crate::fields::Field256;
use crate::proofs::binary::BinaryProof;
use crate::proofs::compute_challenge;
use crate::secp256k1::{pedersen_commitment, point_mul, point_mul_add, Point};
use crate::serialization::{Deserialize, Serialize};
use num_bigint::BigUint;
#[derive(Debug, PartialEq)]
pub struct AssetProof {
g... |
//! Rust wrappers for Node-API simple asynchronous operations
//!
//! Unlike `napi_async_work` which threads a single mutable pointer to a data
//! struct to both the `execute` and `complete` callbacks, the wrapper follows
//! a more idiomatic Rust ownership pattern by passing the output of `execute`
//! into the input... |
use crate::{
error::Error,
event::{event_data::EventData, sections::seal::SourceSeal, Event},
prefix::{AttachedSignaturePrefix, IdentifierPrefix, SelfAddressingPrefix},
state::{EventSemantics, IdentifierState},
};
use super::{
dummy_event::{dummy_prefix, DummyEventMessage, DummyInceptionEvent},
... |
// Import hacspec and all needed definitions.
use hacspec_lib::*;
array!(State, 16, U32, type_for_indexes: StateIdx);
bytes!(StateBytes, 64);
bytes!(IV, 12);
bytes!(Key, 32);
pub fn state_to_bytes(x: State) -> StateBytes {
let mut r = StateBytes::new();
for i in 0..x.len() {
let bytes = U32_to_be_byte... |
use std::fmt;
use std::pin::Pin;
use std::ptr::NonNull;
#[cfg(test)]
mod test;
/// Loads a mailmap from the string passed in.
///
/// The format is the same as used by `git`; specifically:
///
/// * `Canonical Name <canonical email> Current Name <current email>`
/// * This changes authors matching both name and ema... |
use std::{
cell::RefCell,
collections::HashMap,
fmt::Debug,
hash::BuildHasherDefault,
num::NonZeroU64,
sync::atomic::{AtomicU64, Ordering},
};
use super::{
hash::U64Hasher,
storage::{archetype::ArchetypeIndex, ComponentIndex},
};
/// An opaque identifier for an entity.
#[derive(Debug, ... |
// Copyright 2018-2020 Cargill Incorporated
//
// 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... |
// Generated from definition io.k8s.api.core.v1.NodeSpec
/// NodeSpec describes the attributes that a node is created with.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct NodeSpec {
/// If specified, the source to get node configuration from The DynamicKubeletConfig feature gate must be enabled for the Kub... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use super::validation_message::ValidationMessage;
use super::{
build_fragment_metadata_as_directive, build_fragment_spread,
... |
//! Component forRadio syscall interface on imix board.
//!
//! This provides one Component, RadioComponent, which implements a
//! userspace syscall interface to a full 802.15.4 stack with a
//! always-on MAC implementation.
//!
//! Usage
//! -----
//! ```rust
//! let (radio_driver, mux_mac) = RadioComponent::new(rf23... |
// Copyright 2018 Parity Technologies (UK) Ltd.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, mer... |
use crate::mac::parse_as_mac;
use crate::netlink::parse_as_u16;
use crate::netlink::parse_as_u32;
use crate::Iface;
use crate::IfaceType;
use crate::NisporError;
use netlink_packet_route::rtnl::link::nlas;
use netlink_packet_route::rtnl::nlas::NlasIterator;
use serde_derive::{Deserialize, Serialize};
use std::collectio... |
// Copyright 2020 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or di... |
/// This module contains the config object (including serialisation, deserialisation, and parsing command line arguments)
use std::fs::File;
use std::io::{Error, ErrorKind};
use std::path::{Path, PathBuf};
use chrono::NaiveDateTime;
use clap::{ArgMatches, Values};
use path_absolutize::Absolutize;
use serde::{D... |
use super::{types, util, Context};
use ethers_core::{
abi::{Function, FunctionExt, Param, StateMutability},
types::Selector,
};
use anyhow::{anyhow, Context as _, Result};
use inflector::Inflector;
use proc_macro2::{Literal, TokenStream};
use quote::quote;
use syn::Ident;
/// Expands a context into a method s... |
// Copyright 2019 <NAME> <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
// Copyright (c) 2017 Chef Software Inc. and/or applicable contributors
//
// 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 r... |
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::result::Result as StdResult;
use tera::{Tera, Context as TeraContext};
use serde::ser::{SerializeStruct, self};
use config::Config;
use front_matter::{SectionFrontMatter, split_section_content};
use errors::{Result, ResultExt};
use utils::fs::rea... |
use math::{log2, Field, One, PairingEngine, Zero};
use crate::{BTreeMap, String, Vec};
use crate::r1cs::{
ConstraintSynthesizer, ConstraintSystem, Index, LinearCombination, SynthesisError, Variable,
};
#[derive(Clone, Serialize, Deserialize)]
pub struct R1CSInstance<E: PairingEngine> {
pub num_inputs: usize,... |
// 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::gn::add_version_suffix,
crate::types::*,
camino::{Utf8Path, Utf8PathBuf},
cargo_metadata::{Package, PackageId, Version},
s... |
use crate::na;
use crate::data;
use crate::buffer::Buffer;
use crate::buffer::VertexArray;
#[derive(VertexAttribPointers, Copy, Clone, Debug)]
#[repr(C, packed)]
pub struct FlatlanderVertex {
#[location = "0"]
pub pos: data::f16_f16,
#[location = "1"]
pub normal: data::f16_f16,
}
#[deriv... |
// Copyright (c) Microsoft. All rights reserved.
use http_common::MaybeProxyConnector;
pub(crate) async fn create_cert(
csr: &[u8],
url: &url::Url,
basic_auth: Option<(&str, &str)>,
client_cert: Option<(&[u8], &openssl::pkey::PKeyRef<openssl::pkey::Private>)>,
trusted_certs: Vec<openssl::x509::X50... |
//
// Copyright 2016 <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 agr... |
///
/// Copyright 2020 New Relic Corporation. All rights reserved.
/// SPDX-License-Identifier: Apache-2.0
///
use flate2::read::GzDecoder;
use hyper::service::{make_service_fn, service_fn};
use hyper::{Body, Request, Server};
use rand::seq::SliceRandom;
use rand::thread_rng;
use std::collections::HashMap;
use std::io:... |
use tract_core::internal::*;
use crate::model::ParsingContext;
use crate::tfpb::node_def::NodeDef;
#[derive(Debug, Clone, new)]
pub struct Max {
t: DatumType,
t_idx: DatumType,
keep_dims: bool,
}
pub fn max(_ctx: &ParsingContext, pb: &NodeDef) -> TractResult<Box<dyn InferenceOp>> {
let t = pb.get_att... |
// This file is part of libfringe, a low-level green threading library.
// Copyright (c) edef <<EMAIL>>,
// whitequark <<EMAIL>>
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/lice... |
//! Serial Peripheral Interface (SPI) bus
use crate::gpio::gpioa::*;
use crate::gpio::gpiob::*;
use crate::gpio::{Alternate, Floating, Input, Output, PushPull};
use crate::pac::{SPI0, SPI1, SPI2};
use crate::rcu::{Clocks, APB1, APB2};
use crate::unit::Hertz;
use embedded_hal::spi::nb::FullDuplex;
use embedded_hal::spi:... |
extern crate hlua;
use hlua::Lua;
extern crate rustyline;
use rustyline::error::ReadlineError;
use std::rc::Rc;
use std::io;
use std::io::BufRead;
mod snail;
use snail::*;
use std::io::prelude::*;
use std::error::Error;
use std::fs;
use std::fs::File;
use std::fs::metadata;
use std::env;
use std::path::Path;
use... |
use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::visitors::LocalUsedVisitor;
use clippy_utils::{is_lang_ctor, path_to_local, peel_ref_operators, SpanlessEq};
use if_chain::if_chain;
use rustc_hir::LangItem::OptionNone;
use rustc_hir::{Arm, Expr, ExprKind, Guard, HirId, Pat, PatKind, StmtKind};
use r... |
use crate::context::Context;
use crate::interpreter::Rule;
use crate::result::Result;
use crate::runtime::Runtime;
use crate::ast::Node;
use std::collections::HashMap;
use std::sync::Arc;
#[path = "functions.rs"]
mod functions;
#[path = "system.rs"]
mod system;
#[path = "block.rs"]
mod block;
#[path = "literal.rs"]
mo... |
// 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 fidl::encoding::Decodable;
use fidl_fuchsia_media::FormatDetails;
use stream_processor_test::*;
/// Represents an H265 elementary stream.
pub struct H... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use std::path::{Path, PathBuf};
use std::process::Stdio;
use anyhow::Result;
use downcast_rs::Downcast;
use onefuzz::az_copy;
use onefuzz::process::Output;
use tokio::fs;
use tokio::process::Command;
use crate::work::*;
const SETUP_PATH_ENV:... |
#![doc = include_str!("readme.md")]
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
#![deny(missing_docs)]
mod cfg;
mod controller;
mod desktop_context;
mod escape;
mod events;
mod protocol;
use desktop_context:... |
//! This crate contains the CO compiler _frontend_: the part of the compiler which
//! visitors the source code into an intermediate representation defined in `program` and
//! subsequently consumed by some compiler _backend_.
//!
//! All static checks are performed during this phase. The generated IR is guaranteed to ... |
//! Generates headers for a Weld program.
#[macro_use]
extern crate weld;
extern crate libc;
extern crate clap;
extern crate code_builder;
use code_builder::CodeBuilder;
use weld::*;
use weld::ffi::*;
use weld::runtime::*;
use clap::{Arg, App};
use libc::c_char;
use std::ffi::{CStr, CString};
use std::collections:... |
// Copyright 2015 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-MIT or ... |
// Copyright 2019 The Exonum 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 to i... |
//! Consensus check functions
use chrono::{DateTime, Utc};
use zebra_chain::{
block::{Block, Hash, Header, Height},
parameters::{Network, NetworkUpgrade},
transaction,
work::{difficulty::ExpandedDifficulty, equihash},
};
use crate::{error::*, parameters::SLOW_START_INTERVAL};
use super::subsidy;
//... |
use getopts::Options;
use std::env;
use std::process;
use rand::Rng;
use std::str::FromStr;
use std::{thread, time::Duration};
use std::net::{IpAddr, Ipv4Addr, UdpSocket};
use procfs::net;
use pnet::datalink::{self, NetworkInterface, MacAddr};
use pnet::datalink::Channel::Ethernet;
use pnet::packet::arp::{ArpHardwareT... |
use rand::Rng;
use super::leiden::leiden;
use crate::clustering::{ClusterItem, Clustering};
use crate::errors::CoreError;
use crate::log;
use crate::network::prelude::*;
use std::collections::HashSet;
use std::collections::VecDeque;
struct HierarchicalWork {
subnetwork: LabeledNetwork<CompactNodeId>,
parent_c... |
//! clap_generate implementation for markdown.
extern crate clap;
extern crate clap_generate;
use clap::{App, Arg};
use clap_generate::Generator;
use std::io::Write;
// A macro to automatically unwraps `write!`.
macro_rules! w {
($($arg:tt)*) => {
write!($($arg)*).expect("Failed to write to generated file... |
// Copyright Materialize, Inc. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License... |
use crate::reader::decoding::Decoder;
use std::{error::Error, fmt};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DecodeErrorKind {
UnexpectedEoi,
InvalidPrefix,
InvalidMutf8,
InvalidIndex,
InvalidLength,
TagMismatch,
TagReserved,
InvalidTag,
InvalidDescriptor,
UnknownAt... |
use std::{env, fs};
use std::collections::{HashMap, VecDeque};
use std::fmt::{Display, Formatter, Write};
use crate::SyntaxError::{Corrupted, Incomplete};
use crate::Token::*;
mod test;
const DEBUG: bool = false;
#[derive(Debug, PartialEq, Copy, Clone, Hash, Eq)]
enum Token {
OpnRound,
ClsRound,
OpnSqua... |
// Copyright (c) 2017-2020 <NAME>
//! Var to Phi Promotion
use crate::{analysis::PredecessorTable, ir::prelude::*, opt::prelude::*};
use std::collections::{HashMap, HashSet};
/// Var to Phi Promotion
///
/// This pass tries to replace `var`, `ld`, and `st` instructions with `phi`
/// nodes as far as possible.
///
pu... |
//! Example scene showing simple usage of a shape system.
// === Standard Linter Configuration ===
#![deny(non_ascii_idents)]
#![warn(unsafe_code)]
use ensogl_core::display::shape::*;
use ensogl_core::display::world::*;
use ensogl_core::prelude::*;
use wasm_bindgen::prelude::*;
use ensogl_core::data::color;
use enso... |
pub mod input;
use std::fmt::{Display, Error, Formatter};
/// A custom type to extract the formatter and feed it to formal_impl
/// Source: https://github.com/rust-lang/rust/issues/46591#issuecomment-350437057
pub struct Fmt<F>(pub F)
where
F: Fn(&mut std::fmt::Formatter) -> std::fmt::Result;
impl<F> std::fmt::D... |
//! Utility functions to standardize reading certificates
use crate::{error::Result,
fs::cache_ssl_path,
package::{PackageIdent,
PackageInstall}};
use native_tls::Certificate;
use std::{fs,
path::{Path,
PathBuf},
result::Result as StdRe... |
use proc_macro::TokenStream;
use quote::{quote, ToTokens};
use std::collections::HashSet as Set;
use syn::fold::{self, Fold};
use syn::parse::{Parse, ParseStream, Result};
use syn::punctuated::Punctuated;
use syn::{parse_macro_input, parse_quote, Expr, Ident, ItemFn, Local, Pat, Stmt, Token};
/// Parses a list of vari... |
extern crate proc_macro;
use proc_macro::TokenStream;
use quote::ToTokens;
use core::str::FromStr;
use quote::quote;
use std::iter::FromIterator;
use syn::parse_macro_input;
use syn::parse_quote;
use syn::token::Comma;
use syn::DeriveInput;
use syn::Lit;
use syn::Meta;
use syn::WherePredicate;
enum TypeEnum {
Nor... |
use nanoserde::DeRon;
use ureq::{Agent, AgentBuilder};
use std::collections::HashMap;
use crate::config_duration::ConfigDuration;
use crate::grunt::Grunt;
use crate::pipeline::action::{ConfigActionMap, PipelineAction, Reference};
use crate::pipeline::step_handler::{
StepCompletion, StepError, StepHandler, StepHan... |
use feroxbuster::config::{CONFIGURATION, PROGRESS_PRINTER};
use feroxbuster::scanner::scan_url;
use feroxbuster::utils::{ferox_print, get_current_depth, module_colorizer, status_colorizer};
use feroxbuster::{banner, heuristics, logger, reporter, FeroxResult};
use futures::StreamExt;
use reqwest::Response;
use std::coll... |
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the THIRD-PARTY file.
use super::{errno_res... |
use std::{convert::TryFrom, num::ParseIntError};
use snafu::{ensure, ResultExt, Snafu};
use crate::{
board::CastleState, constants::BOARD_DIMENSION, pieces::PieceError,
square::Error as SquareError, Board, Color, Column, Piece, PieceType, Square,
};
#[derive(Debug, Snafu)]
pub enum FenError {
InvalidFEN,... |
#![allow(unused_variables)]
use std::borrow::Cow;
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use std::time::Duration;
use std::usize;
use bytes::Bytes;
use typemap::{Key, TypeMap};
use tokio_core::reactor::Handle;
use client::{Broker, BrokerRef, Client, Cluster, ConsumerGroup, ConsumerG... |
use crate::block_map::BlockMapBuilder;
use crate::content_types::ContentTypesBuilder;
use crate::p7x::Digests;
use anyhow::Result;
use serde::Serialize;
use sha2::{Digest, Sha256};
use std::fs::File;
use std::io::{BufReader, Cursor, Read, Seek, SeekFrom};
use std::path::{Path, PathBuf};
use xcommon::{Scaler, ScalerOpts... |
// Copyright 2019 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... |
extern crate pwasm_abi;
use pwasm_abi::types::*;
use cap9_core::Serialize;
use cap9_core::StorageValue;
/// Generic wasm error
#[derive(Debug)]
pub struct Error;
use crate::proc_table;
use crate::syscalls::*;
use crate::*;
use crate::data::*;
use core::marker::PhantomData;
/// A vector of values in storage.
///
//... |
use bevy::{asset::LoadState, prelude::*, sprite::TextureAtlasBuilder, window::WindowMode};
use bevy_tilemap::{
dimensions::{Dimensions2, Dimensions3},
map::{TileMap, TileMapComponents},
tile::{Tile, TileSetter},
ChunkTilesPlugin,
};
use rand::Rng;
#[derive(Default, Clone)]
pub struct TileSpriteHandles ... |
use std::{
fmt,
sync::{
atomic::{AtomicU32, Ordering},
Arc, Weak,
},
};
use super::{BoundedShape, Bounds, Intersection, PointLight, Ray};
use crate::{
math::{Matrix, Tuple},
properties::{Color, Material},
};
#[cfg(test)]
use std::any::Any;
static NEXT_ID: AtomicU32 = AtomicU32::ne... |
#[macro_use]
extern crate slog;
extern crate slog_async;
extern crate slog_term;
extern crate reqwest;
extern crate cookie;
extern crate kuchiki;
use kuchiki::traits::*;
use slog::Drain;
use cookie::{CookieJar, Cookie};
use reqwest::header::Headers;
use std::env;
// use std::io::{self, Write};
struct Identity {
... |
// Copyright 2020 The Facebook AI Research Team Authors
// Copyright 2020-present, the HuggingFace Inc. team.
// 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
// ... |
pub mod day_4 {
#[derive(Clone, Debug)]
pub struct Board {
arr: [[(u8, bool); 5]; 5],
}
#[derive(Clone, Debug)]
pub struct Data {
boards: Vec<Board>,
draws: Vec<u8>,
}
fn chomp_board<'a, I>(input: &mut I) -> Option<Board>
where
I: Iterator<Item = &'a st... |
use oauth2::basic::{BasicClient, BasicTokenResponse};
use oauth2::reqwest::http_client;
use oauth2::{
AuthUrl, AuthorizationCode, ClientId, CsrfToken, PkceCodeChallenge, RedirectUrl, Scope,
TokenResponse, TokenUrl,
};
use anyhow::Error;
use anyhow::Result;
use tiny_http::{Response, Server};
use qstring::QStr... |
use anyhow::Result;
use std::collections::HashSet;
use std::include_str;
use std::str::FromStr;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum DayError {
#[error("MapNotFormatted properly. Either it's 0 in some dimension or not even")]
MapNotFormatted,
#[error("PointOutOfBounds")]
PointOutOfBou... |
// Copyright 2020 the Deno authors. All rights reserved. MIT license.
use crate::diagnostic::{LintDiagnostic, Position};
use once_cell::sync::Lazy;
use regex::Regex;
use std::collections::HashMap;
use swc_common::comments::Comment;
use swc_common::comments::CommentKind;
use swc_common::BytePos;
use swc_common::SourceMa... |
use crate::widgets;
use sauron::{
html::{attributes::*, events::*, units::*, *},
Cmd, Component, Node,
};
use sqlparser::{dialect::GenericSqlDialect, sqlparser::Parser};
#[derive(Debug, PartialEq, Clone)]
pub enum Msg {
ToggleShowQuery,
ToggleShowRelatedTabs,
ChangeQuickFind(String),
QueryChang... |
extern crate utils;
use std::env;
use std::str::FromStr;
use std::num::ParseIntError;
use std::io::{self, BufReader};
use std::io::prelude::*;
use std::fs::File;
use utils::*;
type Input = Vec<Sue>;
#[derive(PartialEq, Eq, Hash, Copy, Clone, Debug)]
enum Component {
Children, Cats, Samoyeds, Pomeranians, Akitas,... |
use combine::*;
use combine::stream::state::State;
use errors::*;
use std::str::FromStr;
/// A primitive java type. These are the things that can be represented without
/// an object.
#[allow(missing_docs)]
#[derive(Eq, PartialEq, Debug, Clone, Copy)]
pub enum Primitive {
Boolean, // Z
Byte, // B
Char, ... |
use crate::{GameState, GameError, LENGTH_OF_FIELD};
use wasm_bindgen::JsValue;
use std::time::Instant;
use rand::Rng;
use wasm_bindgen::prelude::*;
pub fn get_random_number(from: usize, to: usize) -> usize {
#[cfg(not(target_arch = "wasm32"))]
{
let mut rng = rand::thread_rng();
re... |
/*
* File: src/monitor/help_window.rs
* Date: 31.10.2019
* Author: MarkAtk
*
* MIT License
*
* Copyright (c) 2019 MarkAtk
*
* 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 ... |
#![doc = include_str!("../README.md")]
use std::io::{BufRead, BufReader, Read};
use std::process::{Command, Stdio};
use std::sync::atomic::Ordering;
use std::time::Duration;
pub use ::chazi_macros::test;
use crate::probe::{generate_probe, parse_probe};
use crate::reached::{parse_reach_info, ReachLineInfo, CHECK_REAC... |
extern crate hwloc2;
extern crate libc;
extern crate rayon;
use hwloc2::{ObjectType, Topology, TopologyObject, CpuBindFlags, CpuSet};
use std::sync::{
Arc, Mutex,
};
use log::trace;
/// Same as rayon's ThreadPoolBuilder expect you get an extra `bind` method.
pub struct ThreadPoolBuilder {
builder: rayon::Thre... |
use crate::utils::{error, result, ToJs};
use regex;
use regex_syntax::Parser;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsValue;
/// A compiled regular expression for matching Unicode strings.
/// @see https://docs.rs/regex/latest/regex/
#[wasm_bindgen]
pub struct RRegex {
regex: regex::Regex,
}
#[wasm_bindge... |
use crate::models::models::{
Changelog, ChangelogInsert, ChangelogPage, ChangelogQueryParams, SubmissionChangelog,
};
use crate::tools::cache::CacheState;
use crate::tools::config::Config;
use crate::tools::helpers::check_for_valid_score;
use actix_web::{get, post, web, HttpResponse, Responder};
use sqlx::PgPool;
... |
use yew::{agent::Dispatcher, prelude::*};
use yewtil::NeqAssign;
use crate::{
app_state::{data::DataID, data_manager, data_manager::DataManager},
collection_service::{self, Etag, MaybeEtag},
collection_service::{collection::Collection, CollectionService},
};
pub struct CollectionForm {
link: Component... |
use std::cmp::{Ordering, PartialEq, PartialOrd};
use std::ops::{Add, AddAssign, Sub};
mod error;
pub use error::OOGError;
/// The method for deriving the `Gas Units` of a transaction
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum GasMode {
/// Fixed-Gas - Determined by using static-analysis prior to execution... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.