text stringlengths 3.09k 13.9k |
|---|
use rustc::hir::def_id::DefId;
use rustc::mir::*;
use rustc::ty::TyCtxt;
use rustc_index::vec::Idx;
use std::fmt::Debug;
use std::io::{self, Write};
use super::pretty::dump_mir_def_ids;
/// Write a graphviz DOT graph of a list of MIRs.
pub fn write_mir_graphviz<W>(
tcx: TyCtxt<'_>,
single: Option<DefId>,
... |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Tracking of sent... |
/// The message used by the client to register interest in an entity.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Request {
/// The `target` value **must** be a valid URL path pointing to an entity
/// to watch. Note that the service name **must** be
/// removed from the target field (e.g., the... |
use crate::utils::{get_tx_batch_nonce, GasCost};
use clarity::PrivateKey as EthPrivateKey;
use clarity::{Address as EthAddress, Uint256};
use mhub2_utils::error::GravityError;
use mhub2_utils::error::GravityError::InvalidEstimationError;
use mhub2_utils::message_signatures::encode_tx_batch_confirm_hashed;
use mhub2_uti... |
use utils::error::Result;
use jq_rs;
use std::io::{self, Read};
use serde_json;
use std::fs::File;
use std::io::prelude::*;
use std::collections::HashSet;
use serde_yaml;
extern crate yaml_rust;
use yaml_rust::{YamlLoader, YamlEmitter};
extern crate sanitize_filename;
extern crate glob;
use self::glob::glob;
pub fn sh... |
/// You can use this enum to parse `Appointment.appointment_type`.
/// This is done to make matching easier.
///
/// ```no_run
/// # use zermelo::AppointmentType;
/// let t = AppointmentType::parse("exam"); // => Some(AppointmentType::Exam)
/// let n = AppointmentType::parse("abc"); // => None
/// ```
#[derive(Deserial... |
use bevy_utils::HashSet;
use std::hash::Hash;
// unused import, but needed for intra doc link to work
#[allow(unused_imports)]
use bevy_ecs::schedule::State;
/// A "press-able" input of type `T`.
///
/// This type can be used as a resource to keep the current state of an input, by reacting to
/// events from the inpu... |
#[allow(unused_imports)]
use std::collections::HashMap;
use std::convert::From;
use std::error::Error;
use std::fmt;
use serde_json;
use crate::requests::SlackWebRequestSender;
/// Exchanges a temporary OAuth code for an API token.
///
/// Wraps https://api.slack.com/methods/oauth.access
pub fn access<R>(
clie... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Start comparator"]
pub tasks_start: crate::Reg<tasks_start::TASKS_START_SPEC>,
#[doc = "0x04 - Stop comparator"]
pub tasks_stop: crate::Reg<tasks_stop::TASKS_STOP_SPEC>,
#[doc = "0x08 - Sample comparator value"]
pub... |
//! An [etcd](https://github.com/etcd-io/etcd) v3 API client for Rust.
//! It provides asynchronous client backed by [tokio](https://github.com/tokio-rs/tokio) and [tonic](https://github.com/hyperium/tonic).
//!
//! # Supported APIs
//!
//! - KV
//! - Watch
//! - Lease
//! - Auth
//! - Maintenance
//! - Cluster
//! - L... |
#[cfg(feature = "serde-serialize")]
use serde::{Deserialize, Serialize};
use crate::allocator::Allocator;
use crate::base::{DefaultAllocator, MatrixMN, MatrixN, SquareMatrix, VectorN};
use crate::dimension::{DimDiff, DimSub, U1};
use crate::storage::Storage;
use simba::scalar::ComplexField;
use crate::linalg::househo... |
use async_trait::async_trait;
use chrono::{DateTime, Duration, Utc};
use log::debug;
use oauth2::ClientSecret;
use serde::{Deserialize, Serialize};
use std::fs::File;
use std::{fs, str};
use twitch_api2::twitch_oauth2;
use twitch_api2::twitch_oauth2::TwitchToken;
use twitch_irc::login::TokenStorage;
#[derive(Clone, De... |
use url::Url;
use mysql;
use ansi_term::Colour::*;
#[derive(Debug)]
pub struct DB {
database_type: String,
host: String,
port: u16,
socket: String,
user: String,
pass: String,
database: String,
connection: Option<mysql::Pool>,
}
pub fn connect_with_url(url: &str) -> DB {
let parse... |
/*
* Copyright 2019 The Starlark in Rust Authors.
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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/lic... |
use logos::{Lexer, Logos};
use std::borrow::Cow;
#[derive(Logos, Debug, PartialEq)]
pub enum Token<'a> {
#[error]
#[regex(r"[ \t\n\f]+", logos::skip)]
Unknown,
// One-symbol operators
#[token("<")]
Lt,
#[token(">")]
Gt,
#[token("+")]
Plus,
#[token("-")]
Minus,
#[tok... |
use std::convert::TryFrom;
use std::fmt::{Display, Formatter};
use std::hash::{Hash, Hasher};
use std::str::FromStr;
use std::{fmt, str};
use ed25519_dalek::{Signature, Verifier};
use once_cell::sync::Lazy;
use crate::key_error::KeyError;
const DER_PREFIX: &str = "302a300506032b6570032100";
const DER_PREFIX_BYTES: L... |
//! Relocation is the process of assigning load addresses for position-dependent
//! code and data of a program and adjusting the code and data to reflect the
//! assigned addresses.
//!
//! [Learn more](https://en.wikipedia.org/wiki/Relocation_(computing)).
//!
//! Each time a `Compiler` compiles a WebAssembly functio... |
#[derive(Copy, Clone, PartialEq, Debug, PartialOrd)]
/// H3 digit representing ijk+ axes direction.
/// Values will be within the lowest 3 bits of an integer.
pub enum Direction {
/// H3 digit in center
CENTER_DIGIT, //= 0,
/// H3 digit in k-axes direction
K_AXES_DIGIT, //= 1,
/// H3 digit in j-axes... |
use crc;
use pyo3::prelude::*;
use pyo3::exceptions::PyRuntimeError;
use std::collections::HashMap;
use std::fs;
use std::io::prelude::*;
use std::io::Error;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, AtomicI32, Ordering};
use std::sync::{mpsc, Arc, Mutex};
use threadpool::ThreadPool;
use walkd... |
use crate::sys;
use std::{error::Error, ffi::CStr, fmt::Display};
/// Enum encapsulating function status returns. All cuDNN library functions return their status.
///
/// cuDNN [docs](https://docs.nvidia.com/deeplearning/cudnn/api/index.html#cudnnStatus_t)
/// may offer additional information about the APi behavior.
#... |
use super::{Bounds, DefaultVal, TypeBounds};
use crate::{
derive::{
attr_parsing::{self, AttrParsing, SharedConfig, ParseCtx},
DataStructure, DataVariant, Field, ParseBufferExt, Struct,
},
TokenStream2,
};
use proc_macro2::Span;
use syn::{
parse::ParseBuffer,
Ident, Token,
};
use... |
use std::collections::BTreeSet;
use serde::Serialize;
use crate::pii::utils::process_pairlist;
use crate::processor::{
process_value, Pii, ProcessValue, ProcessingState, Processor, SelectorPathItem, SelectorSpec,
ValueType,
};
use crate::protocol::{AsPair, PairList};
use crate::types::{Annotated, Meta, Proces... |
/*
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... |
//! Emulates the trap circuit and I/O Unit 42. See TX-2 User Handbook
//! Chapter 4 section 42.
use base::prelude::*;
use std::time::Duration;
use crate::io::{TransferFailed, Unit, UnitStatus};
#[derive(Debug)]
pub struct TrapCircuit {
mode: Unsigned12Bit,
set_metabits_disabled: bool,
}
impl TrapCircuit {
... |
use crate::error::Error;
use crate::protocol::{Decode, Encode, KeyPair, KeyType, Request, Response, SecretKeyEncoding};
use crate::seal_signer::SealedSigner;
use crate::server::C2S;
use crossbeam_channel::{unbounded, Receiver, Sender};
use log::debug;
use signatory::ed25519;
use signatory::public_key::PublicKeyed;
use ... |
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::thread::sleep;
use std::time::{Duration, Instant};
use influx_db_client::{InfluxClient, Point, Points, Precision, Value};
use influx_db_client::Error as InfluxError;
use snafu::ResultExt;
use tesla::{TeslaClient, Vehicle, VehicleClient, State... |
use base64::DecodeError;
use chrono;
use http::uri::InvalidUri;
use native_tls;
use openssl::error::ErrorStack;
use ring::error;
use serde_json::error::Error as JsonError;
use std::string::FromUtf8Error;
use std::time::{Duration, SystemTime};
use std::{convert::From, error::Error, fmt, io::Error as IoError};
#[derive(... |
//! Implementation of pseudocode from chapter 2 of <NAME>'s
//! [Computer Graphics from Scratch](https://gabrielgambetta.com/computer-graphics-from-scratch/)
//! book. I am not affiliated with Gabriel or his book in any way.
//!
//! This example is the first step in implementing a basic ray tracer. It renders three sph... |
extern crate mdbook;
use comrak::{
nodes::{AstNode, NodeValue},
parse_document, Arena, ComrakOptions,
};
use mdbook::{renderer::RenderContext, BookItem};
use roffman::{IntoRoffNode, Roff, RoffNode, Roffable, SectionNumber};
fn iter_nodes<'a, F>(node: &'a AstNode<'a>, out: &mut Parser, f: &F)
where
F: Fn(&... |
use std::{io, io::Read, io::Write, io::Seek};
use std::fs::File;
use std::path::Path;
mod crc32;
mod sha2;
mod check;
mod cipher;
mod glue;
use crc32::crc;
use sha2::Hasher;
use glue::{encipher_glue, unglue_decipher};
#[cfg(test)]
mod tests;
const BLOCK_SIZE: usize = 256;
const BLOCK_COUNT: usize = 64;
const BUFFE... |
use crate::b2_math::*;
use crate::b2_settings::*;
use crate::b2_shape::*;
use crate::private::collision::b2_distance as private;
use std::sync::atomic::AtomicUsize;
pub static B2_GJK_CALLS: AtomicUsize = AtomicUsize::new(0);
pub static B2_GJK_ITERS: AtomicUsize = AtomicUsize::new(0);
pub static B2_GJK_MAX_ITERS: Atom... |
/*
* Copyright 2020 <NAME> (DMats)
*
* 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... |
extern crate session_types_ng;
use std::thread::spawn;
use std::sync::mpsc::{SendError, RecvError};
use session_types_ng::*;
use session_types_ng::mpsc::Value;
type Id = String;
type Atm = Recv<Value<Id>, Choose<Rec<AtmInner>, Choose<End, Nil>>>;
type AtmInner =
Offer<AtmDeposit,
Offer<AtmWithdraw,
Offe... |
use crate::{
Channel, Channels, Compressed, Compression, FastChannelsCompression, FillChannels,
UninitChannels,
};
macro_rules! impl_channels_for_tuple {
( $( $var1:ident, $var2:ident : $t:ident ),+ ) => {
impl<$($t),+> Channels for ($($t,)+)
where
$($t: Channels),+
{
... |
use super::*;
use numpy::PyArray2;
///
#[pyclass]
#[derive(Debug, Clone)]
#[text_signature = "(*, embedding_size, window_size, clipping_value, number_of_negative_samples, walk_length, return_weight, explore_weight, change_edge_type_weight, change_node_type_weight, max_neighbours, random_state, iterations, dense_node_m... |
use crate::bounding_volume::BoundingVolume;
use crate::math::{Isometry, Real};
use crate::query::contact_manifolds::ContactManifoldsWorkspace;
use crate::query::query_dispatcher::PersistentQueryDispatcher;
use crate::query::visitors::BoundingVolumeIntersectionsVisitor;
use crate::query::ContactManifold;
#[cfg(feature =... |
//! SPI Commands for the Waveshare 7.5" E-Ink Display
use crate::traits;
/// EPD7in5 commands
///
/// Should rarely (never?) be needed directly.
///
/// For more infos about the addresses and what they are doing look into the PDFs.
#[allow(dead_code)]
#[allow(non_camel_case_types)]
#[derive(Copy, Clone)]
pub(crate) e... |
mod pkt_decoder;
pub use pkt_decoder::Pkt;
use crate::error::Error;
use crate::jni_ffi::ToJavaMsg;
use crate::player::Player;
use crate::util::interval_measure::IntervalMeasure;
use log::{info, warn};
use mio::net::UdpSocket;
use std::io;
use std::net::SocketAddr;
use std::sync::mpsc;
use std::sync::{
atomic::{At... |
// Copyright 2015 The Ramp 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 applicab... |
use std::collections::HashSet;
use std::fmt;
use std::str::FromStr;
use diesel::{dsl::sql, prelude::*};
use diesel::{sql_types::Text, PgConnection};
use regex::Regex;
use graph::components::store::DeploymentId;
use graph::{
components::store::DeploymentLocator,
data::subgraph::status,
prelude::{
a... |
//! Partitions a list of files into disjoint subsets.
//!
//! Files which do not belong to any explicitly configured `FileSet` belong to
//! the default `FileSet`.
use std::fmt;
use fst::{IntoStreamer, Streamer};
use rustc_hash::FxHashMap;
use crate::{AnchoredPath, FileId, Vfs, VfsPath};
/// A set of [`VfsPath`]s id... |
mod dependency_graph;
use std::collections::{HashMap, HashSet};
use std::fs::read_dir;
use crate::manifests::CargoToml;
use crate::services::cargo_toml_reader::{CargoTomlReader, CargoTomlReaderImpl};
use crate::services::list_crates_service::dependency_graph::DependencyGraph;
use crates_io_api::SyncClient;
pub struc... |
use regex::{Regex, escape};
#[derive(Debug)]
pub struct Line {
content: String,
line: usize,
file: String
}
#[derive(PartialEq, Debug, Clone)]
pub struct LexedToken {
content: String,
line: usize,
index: usize,
line_content: String,
token_type: Token,
file: String,
}
#[derive(Debu... |
use std::fs::{create_dir_all, remove_file, File, OpenOptions};
use std::io::{self, BufReader, BufWriter, Seek, SeekFrom, Write};
use std::ops::Range;
use std::path::{Path, PathBuf};
use ropey::{Rope, RopeSlice};
use agda_mode::agda::ReplState;
use agda_mode::pos::{InteractionPoint, Interval};
const FAIL_CREATE_DEFAU... |
#![allow(clippy::trivial_regex)]
use crate::LanguageType;
use once_cell::sync::Lazy;
use regex::bytes::Regex;
pub static START_SCRIPT: Lazy<Regex> =
Lazy::new(|| Regex::new(r#"<script(?:.*type="(.*)")?.*?>"#).unwrap());
pub static END_SCRIPT: Lazy<Regex> = Lazy::new(|| Regex::new(r#"</script>"#).unwrap());
pub s... |
#[macro_use]
extern crate glium;
use std::time::{Instant, Duration};
use std::cmp::max;
use noise::{NoiseFn, OpenSimplex};
use glium::{glutin, Surface};
use glium::texture::{RawImage2d, Texture2d};
use glium::Display;
use glium::glutin::dpi::LogicalSize;
fn get_raw_noise_values(width: u32, height: u32) -> Vec<Vec<f3... |
/*******************************************************************************
* Copyright (c) 2017 Association Cénotélie (cenot<EMAIL>.fr)
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Found... |
use std::cell::RefCell;
use std::fmt::{Display, Formatter};
use std::fs;
use std::rc::Rc;
use crate::interpreter::{InterpretError, Interpreter};
use crate::parser::Parser;
use crate::resolver::{Binding, Resolve};
use crate::scanner::Scanner;
mod id;
mod interpreter;
mod parser;
mod resolver;
mod scanner;
/// Represe... |
pub(crate) mod auth;
pub(crate) mod internal_user;
pub(crate) mod middleware;
pub(crate) mod problem_list;
pub(crate) mod progress_reset;
pub(crate) mod ranking;
pub(crate) mod rated_point_sum_ranking;
pub(crate) mod time_submissions;
pub(crate) mod user_info;
pub(crate) mod user_submissions;
pub(crate) mod utils;
pub(... |
// Copyright 2020 <NAME>. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This f... |
use crate::name_resolution::{Expression, IfBranch, Statement, Type};
use std::collections::btree_map::Entry::{Occupied, Vacant};
use std::collections::{BTreeMap, BTreeSet};
fn statement_dependencies(statement: &Statement) -> BTreeSet<usize> {
use Statement as S;
match &statement {
S::Assignment { value... |
pub mod trainers;
use itertools::Itertools as _;
use rand::{thread_rng, Rng as _};
use std::collections::HashMap;
use std::fmt;
use std::fmt::Write as _;
use std::iter::FromIterator;
/// The smallest amount of wording that can be used to represent Markov
/// states.
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, Pa... |
use std::path::Path;
use blstrs::Scalar as Fr;
use filecoin_hashers::{Domain, Hasher};
use generic_array::typenum::Unsigned;
use merkletree::store::StoreConfig;
use storage_proofs_core::{
merkle::{MerkleTreeTrait, MerkleTreeWrapper},
util::default_rows_to_discard,
};
use storage_proofs_update::{constants::Tre... |
extern crate config;
#[macro_use]
extern crate log;
extern crate log4rs;
extern crate nix;
extern crate postgres;
mod arg;
mod bot_utility;
mod emojistats;
mod bot;
use std::env::args;
use std::ffi::CString;
use std::process;
use nix::unistd::execv;
use log4rs::config::Logger;
use emojistats::Database;
use bot::BotDi... |
use crate::errors::K8sError;
use crate::middleware::parse_container_path;
use futures::stream::StreamExt;
use http::types::body::{KeyValueMap, LineBuilder};
use k8s_openapi::api::core::v1::Pod;
use kube::{
api::{ListParams, WatchEvent},
config::Config,
runtime::Informer,
Api, Client,
};
use metrics::Met... |
/*
* Copyright 2020 Fluence Labs Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... |
use crate::config::Config;
use crate::data::{Objective, OtherExperience, PersonalInfo, ProjectInfo, Resume, Technologies};
use crate::renderer::markdown_renderer::MarkdownRenderer;
use crate::renderer::Renderer;
use crate::util::{add_https_to_url, write_string_to_file, FooterText};
use std::path::PathBuf;
pub struct G... |
#![deny(clippy::all)]
#![deny(clippy::correctness)]
#![deny(clippy::style)]
#![deny(clippy::complexity)]
#![deny(clippy::perf)]
// #![deny(clippy::pedantic)]
#![deny(clippy::nursery)]
#![deny(clippy::cargo)]
const DB_NAME: &str = "word-list.txt";
enum Command {
Invalid,
AddFiles {
input: Vec<String>,
... |
use proc_macro2::TokenStream;
use quote::ToTokens;
use syn::parse::{Parse, ParseStream, Parser, Result};
use syn::punctuated::Punctuated;
use syn::{parenthesized, Attribute, Data, Field, Fields, Ident, Index, LitStr, Token, Type};
pub fn parse_attributes<T: MetaParser>(attributes: Vec<Attribute>) -> T {
let mut re... |
/*
* Copyright (C) 2019-2021 TON Labs. All Rights Reserved.
*
* Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
* this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an ... |
//! Gapless Playback Example
//! Copyright (c), Firelight Technologies Pty, Ltd 2004-2021.
//!
//! This example shows how to schedule channel playback into the future with
//! sample accuracy. Use several scheduled channels to synchronize 2 or more
//! sounds.
#![allow(clippy::try_err)]
use {
fmod::cstr,
fmod... |
use clap::{App, AppSettings, Arg};
use regex::Regex;
use std::env;
use std::io::prelude::*;
use std::os::unix::net::UnixStream;
use std::path::Path;
use std::process::Command;
use std::str;
fn get_pid() -> Option<String> {
let mut command = Command::new("ps");
command.arg("-C")
.arg("swarm")
.arg("-o")
.arg("p... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
use crate::material::Material;
use bvh::aabb::{Bounded, AABB};
use bvh::bounding_hierarchy::BHShape;
use bvh::bvh::BVH;
use nalgebra::base::Scalar;
use nalgebra::{Point3, Vector3};
use rand::prelude::ThreadRng;
use rand_distr::{Distribution, UnitBall};
use std::cmp::Ordering;
pub(crate) type RT = f32;
fn bvh_position... |
/*!
Payment Output
*/
use serde::{de, Deserialize};
use std::fmt;
use logic::type_aliases::TokenAmount;
pub type Outputs = Vec<Output>;
/**
* Config which holds a vec of [`Output`]s
*
* Also has a version for backward compatability.
*
* [`Outputs`]: Output
*/
#[derive(Serialize, Deserialize, Debug, Eq, Par... |
use std::{ops::Neg, process::Output, fmt::Error};
use cauchy::Scalar;
use ndarray::{Data, RawData, Array2, ArrayBase, RawArrayView, Ix2, OwnedRepr, ScalarOperand};
use crate::{approximate_factorial, error::LinalgError, Identity, Inv, MatrixPower};
// NB: We use the notation of
// https://www.cs.jhu.edu/~misha/Re... |
use rustyline::{error::ReadlineError, Editor};
use std::path::PathBuf;
use url::Url;
mod cmd;
mod db;
mod parser;
mod script_builder;
use self::db::{Db, DbState};
pub struct Wallet {
prompt: String,
url: Url,
db: Db,
// Current ID to be sent when making requests
req_id: u32,
}
impl Wallet {
... |
use std::{
cell::{Cell, RefCell},
collections::HashSet,
};
type EntityId = u32;
type Generation = u32;
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub struct Entity {
id: EntityId,
gen: Generation,
}
impl Entity {
/// Retrieves the id of `self` without checking if `self` is still alive. Mo... |
// 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... |
use core::future::Future;
use core::{
marker::PhantomPinned,
pin::Pin,
task::{Context, Poll},
};
use futures_core::FusedFuture;
use pin_project::pin_project;
use super::super::Transposer;
use super::{
engine_time::EngineTime, input_buffer::InputBuffer, lazy_state::LazyState,
transposer_frame::Tran... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control"]
pub ctrl: crate::Reg<ctrl::CTRL_SPEC>,
#[doc = "0x02 - CRC Control"]
pub crcctrl: crate::Reg<crcctrl::CRCCTRL_SPEC>,
#[doc = "0x04 - CRC Data Input"]
pub crcdatain: crate::Reg<crcdatain::CRCDATAIN_SPEC>,
... |
// (C) 2020 <NAME> <<EMAIL>>
use crate::classdef::ClassDef;
use crate::common::GlyphID;
use crate::coverage::Coverage;
use crate::error::*;
use crate::types::{get_i16, get_u16, get_u32};
#[derive(Debug, Eq, PartialEq)]
pub(crate) enum GlyphClass {
Base,
Ligature,
Mark,
Component,
}
#[derive(Debug)]
s... |
use proc_macro2::*;
pub(crate) type TokenStreamIter = std::iter::Peekable<proc_macro2::token_stream::IntoIter>;
pub(crate) fn get_ident(token_iter: &mut TokenStreamIter) -> String {
match token_iter.next() {
Some(TokenTree::Ident(ident)) => ident.to_string(),
Some(tok) => panic!("Expected an Iden... |
use crate::device::Device;
use crate::{SettingsHandle, Shutdown};
use anyhow::{anyhow, Result};
use goxlr_ipc::{DaemonStatus, DeviceType, GoXLRCommand, HardwareStatus, Paths, UsbProductInformation};
use goxlr_usb::goxlr::{GoXLR, PID_GOXLR_FULL, PID_GOXLR_MINI, VID_GOXLR};
use goxlr_usb::rusb::{DeviceDescriptor, GlobalC... |
use crate::{
query::{lookup_keys, Query},
world::World,
};
use itertools::Itertools;
use lsp_async_stub::{
rpc::Error,
util::{LspExt, Position},
Context, Params,
};
use lsp_types::{Hover, HoverContents, HoverParams, MarkupContent, MarkupKind};
use serde_json::Value;
use taplo::{
dom::{KeyOrIndex... |
use std::io::{Read, Write};
use std::process::{Command, Stdio};
use crate::builtins;
use crate::context::Context;
use crate::parser;
pub fn choose_and_run(ctx: &mut Context, int: bool, raw: parser::ArgTypes) {
match raw {
parser::ArgTypes::Norm(data, false) => {
// normal command
s... |
#![cfg(feature = "async-io")]
use super::{Compressor, Dictionary, Preferences};
use crate::lz4f::Result;
use futures_lite::{AsyncBufRead, AsyncRead};
use pin_project::pin_project;
use std::{
cmp, fmt, io,
pin::Pin,
task::{Context, Poll},
};
/// The [`AsyncBufRead`]-based streaming compressor.
///
/// # Ex... |
use crate::entities::gamepads::{Gamepad, GamepadEvent};
use crate::{
Finger, InputModule, Keyboard, KeyboardEvent, Mouse, MouseEvent, TouchEvent, WindowPosition,
};
use modor::{Built, Entity, EntityBuilder, Query, Single, SingleMut, World};
/// The input event collector.
///
/// # Modor
///
/// - **Type**: singlet... |
use super::Instance;
use std::alloc::Layout;
use std::convert::TryFrom;
use std::ptr::{self, NonNull};
use std::sync::{Arc, Weak};
/// Dynamic instance allocation.
///
/// This structure has a C representation because `Instance` is
/// dynamically-sized, and the `instance` field must be last.
///
/// This `InstanceRef... |
//---------------------------------------------------------------------------//
// Copyright (c) 2017-2020 <NAME>. All rights reserved.
//
// This file is part of the Rusted PackFile Manager (RPFM) project,
// which can be found here: https://github.com/Frodo45127/rpfm.
//
// This file is licensed under the MIT license... |
use std::vec::Vec;
use std::net::SocketAddr;
use std::time::Duration;
use std::sync::{Arc, Mutex};
use futures::{Stream, Sink, future, Future};
use futures::sync::mpsc::{self, Sender, Receiver};
use tokio_core::net::{UdpSocket};
use tokio_core::reactor::{Core, Handle};
use tokio_timer::Timer;
use errors::*;
mod mil... |
use crate::parse::NomParse;
use nom::{
branch, bytes::complete as bytes, character::complete as character, combinator as comb,
sequence, IResult,
};
use std::{collections::HashSet, convert::TryFrom, fs, io};
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum Instruction {
NoOp(isize),
Accumulate(i32),
... |
use crate::cache::{Cache, CacheData};
use crate::config::Config;
use crate::error::Result;
use crate::parsers::{parse_kernel_docs, KERNEL_DOCS_PATH};
use crate::sysctl::parameter::Parameter;
use crate::sysctl::section::Section;
use crate::sysctl::{DISABLE_CACHE_ENV, PARAMETERS_CACHE_LABEL, PROC_PATH};
use parseit::glob... |
use std::fmt;
use globset::GlobBuilder;
use regex::bytes::{Regex, RegexBuilder};
use relay_common::UpsertingLazyCell;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
/// Returns `true` if any of the patterns match the given message.
fn is_match(globs: &[Regex], message: &[u8]) -> bool {
globs.iter(... |
use std::sync::Arc;
use pyo3::exceptions;
use pyo3::prelude::*;
use pyo3::types::*;
use serde::{Deserialize, Serialize};
use tk::processors::bert::BertProcessing;
use tk::processors::byte_level::ByteLevel;
use tk::processors::roberta::RobertaProcessing;
use tk::processors::PostProcessorWrapper;
use tk::{Encoding, Pos... |
#![feature(const_fn_fn_ptr_basics)]
#![feature(panic_info_message)]
#![feature(format_args_nl)]
#![feature(global_asm)]
#![feature(asm_const)]
#![feature(asm)]
#![cfg_attr(not(test), no_std)]
#![feature(slice_as_chunks)]
#![no_main]
#![allow(warnings)]
pub mod arch;
pub mod bsp;
mod exception;
pub mod fs;
pub mod log;... |
mod schedule;
mod tasks;
mod util;
use std::fmt::Write;
use crate::plan::tasks::parse_task_list;
use self::{tasks::TaskList, util::get_node_text};
use chrono::{Datelike, NaiveDate, Weekday};
use comrak::{nodes::NodeValue, parse_document, Arena, ComrakOptions};
use self::schedule::{parse_schedule, Schedule};
#[deriv... |
// midi_event.rs
//
// Copyright (c) 2020 All The Music, LLC
//
// This work is licensed under the Creative Commons Attribution 4.0 International License.
// To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send
// a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, U... |
use std::collections::HashSet;
#[aoc_generator(day4)]
fn parse_input(input: &str) -> (Vec<u64>, Vec<Vec<Vec<(u64, bool)>>>) {
// Values on each board are stored in 2D array with bool to represent marking state
let mut boards: Vec<Vec<Vec<(u64, bool)>>> = vec![];
let mut lines = input.lines();
// Get bi... |
//======---------------------------------------------------------------======//
// //
// Copyright 2022 <NAME> <<EMAIL>>. All rights reserved. //
// //
// Use of this ... |
//! Conversions
//!
//! Other conversions between temperatures, salinities, entropy, pressure
//! and height.
use crate::gsw_internal_const::{DB2PA, DEG2RAD, GAMMA, GSW_P0};
use crate::gsw_internal_funcs::enthalpy_sso_0;
/*
gsw_deltaSA_from_SP
gsw_SA_Sstar_from_SP
gsw_SR_from_SP
gsw_SP_from_SR
gsw_SP_from_SA
gsw_Ssta... |
extern crate bufstream;
extern crate cobs;
#[macro_use]
extern crate failure;
extern crate rand;
extern crate serialport;
use bufstream::BufStream;
use rand::rngs::SmallRng;
use rand::{FromEntropy, RngCore};
use serialport::SerialPort;
use std::io::{self, BufRead, Read, Write};
use std::time::Duration;
#[derive(Fail,... |
mod schema;
use diesel::prelude::*;
use model::*;
use std::collections::HashMap;
use std::str::FromStr;
use thiserror::Error;
#[macro_use]
extern crate diesel;
pub struct SqliteClient {
scorelog_db_url: String,
song_db_url: String,
score_db_url: String,
}
impl SqliteClient {
fn new(scorelog_db_url: ... |
#![crate_name="orbimage"]
#![crate_type="lib"]
extern crate orbclient;
extern crate resize;
extern crate image;
use std::{cmp, slice};
use std::path::Path;
use std::error::Error;
use std::cell::Cell;
use orbclient::{Color, Renderer, Mode};
pub use resize::Type as ResizeType;
pub struct ImageRoi<'a> {
x: u32,
... |
//! Enums and structs for the Pigeon IMU defined by the Phoenix API.
use core::fmt;
/// Data object for holding fusion information.
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(
feature = "miniserde",
derive(miniserde::Serialize, miniserde::Deserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serializ... |
// Copyright 2015-2021 <NAME>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL... |
use serde_json;
use logic::type_aliases::ProtocolVersion;
use logic::parsers::common::ResponseOperations;
use logic::output::Outputs;
use logic::input::Inputs;
use ErrorCode;
use logic::parsers::common::UTXO;
use logic::parsers::common::TXO;
use logic::type_aliases::TxnSeqNo;
use logic::address;
/**
for parse_get... |
use crate::context::{CmpContext, ValidationContext};
use crate::core::{Type, TypeRef};
use crate::identifier::Identifier;
use crate::metadata::{Meta, MetadataSetter, WithMetadata};
use crate::schema_builder::{BaseTypeSchemaBuilder, SchemaBuilder};
use crate::types::range::{Inclusion, TRange};
use crate::types::structur... |
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
use std::{
fmt::Debug,
path::{Path, PathBuf},
};
use crate::*;
// FIXME: Revisit the remaining types and methods on KvEngine. Some of these are
// here for lack of somewhere better to put them at the time of writing.
// Consider moving everyt... |
use super::{ButtplugServer, ButtplugServerStartupError};
use crate::{
connector::ButtplugConnector,
core::{
errors::{ButtplugError, ButtplugServerError},
messages::{self, ButtplugClientMessage, ButtplugServerMessage},
},
server::{DeviceCommunicationManager, DeviceCommunicationManagerCreator},
test::Te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.