text stringlengths 3.09k 13.9k |
|---|
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
config::{global::Config as GlobalConfig, strip},
errors::*,
evaluator::Stage,
};
use language_e2e_tests::account::Account;
use libra_types::transaction::{parse_as_transaction_argument, TransactionArgument};
use... |
use failure::Fail;
use std::collections::HashMap;
use std::collections::hash_map::Iter;
use std::str::FromStr;
#[derive(Clone, Debug, Fail)]
#[fail(display = "Invalid class type '{}'", _0)]
pub struct ClassTypeParseError(String);
/// Contains all the data for a class/job insofar as it pertains to a specific character... |
extern crate actix;
extern crate actix_web;
extern crate config;
extern crate env_logger;
extern crate failure;
extern crate futures;
extern crate log;
extern crate serde;
extern crate serde_derive;
extern crate serde_urlencoded;
use actix_web::{
client, middleware, server, fs, App, Error, Form, HttpMessage,
H... |
mod cleaner;
mod debug;
mod gltf;
mod reducer;
mod version;
pub use self::cleaner::*;
pub use self::debug::*;
pub use self::gltf::*;
pub use self::reducer::*;
use byteorder::{ReadBytesExt, WriteBytesExt, LE};
use serde_json::Value;
use std::fs::OpenOptions;
use std::io::{BufReader, BufWriter, Read, Write};
use std::pa... |
use std::{
sync::Arc,
task::{Context, Poll},
time::Duration,
};
use async_trait::async_trait;
use axum::{
extract::{FromRequest, RequestParts},
response::IntoResponse,
routing::{get, post},
AddExtensionLayer, Router,
};
use futures::future::BoxFuture;
use http::{Method, Request, Response};
... |
use opencv::{
imgcodecs,
imgproc,
prelude::*,
videoio,
core,
};
use std::{
path::Path,
fs,
io::Write,
env,
};
type Tuple = (f64, f64);
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() < 4 {
println!("Invalid arguments.\nUsage: adbreak-rm <video in... |
// Copyright 2019 <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... |
use rand;
use std;
use prelude::*;
use scene;
pub struct Output {
data : Vec<RGB>,
w : u32,
h : u32,
}
impl Output {
pub fn new(w: u32, h: u32) -> Self {
Output {
data : std::iter::repeat(RGB { r: 0.0, g: 0.0, b: 0.0 }).take((w * h) as usize).collect(),
w : w,
h : h,
}
... |
use std::os::raw::c_void;
use std::path::Path;
use std::{fs, io};
use base64;
use gl;
use gltf;
use gltf::json::texture::MinFilter;
use gltf::image::Source;
use image;
use image::ImageFormat::{JPEG, PNG};
use image::DynamicImage::*;
use image::GenericImage;
use image::FilterType;
use importdata::ImportData;
pub str... |
use std::cmp::Reverse;
use std::collections::{BinaryHeap, HashMap};
use std::error::Error;
use std::io::{self, Write};
use std::result;
const DEPTH: usize = 9171;
const TARGET: Coordinate = Coordinate { x: 7, y: 721 };
macro_rules! err {
($($tt:tt)*) => { Err(Box::<Error>::from(format!($($tt)*))) }
}
type Result... |
use crate::prelude::*;
use bytes::{BufMut, BytesMut};
use futures::stream::StreamExt;
use futures_codec::{Decoder, Encoder, Framed};
use log::trace;
use nu_errors::ShellError;
use nu_parser::ExternalCommand;
use nu_protocol::Value;
use std::io::{Error, ErrorKind};
use subprocess::Exec;
use super::ClassifiedInputStream... |
use log::*;
use serenity::framework::standard::{Args, CommandError};
use serenity::model::id::{ChannelId, UserId};
use serenity::prelude::Context;
use crate::commands::servers::CommandResponse;
use crate::DetailsCacheHandle;
use crate::{
commands::servers::details::started_details_from_server,
db::*,
model... |
use super::buckets::Buckets;
use super::metric::{Metric, MetricKind};
use std::collections::HashMap;
use time;
/// Creates derived values from metric data.
///
/// Creates:
///
/// - timer percentile data.
/// - internal processing metrics
pub fn process(buckets: &mut Buckets) {
let start_time = time::get_time();
... |
//! Code used to serialize crate data to JSON.
mod api;
mod attributes;
pub use self::api::*;
use analysis::{AnalysisHost, DefKind};
use error;
use Result;
use std::collections::VecDeque;
/// Creates the documentation from the given `AnalysisHost`.
///
/// The documentation can be serialized to JSON.
pub fn creat... |
use super::*;
use crate::common::{chain, committee, keys, MockMempool};
use crypto::SecretKey;
use std::fs;
use tokio::sync::mpsc::channel;
async fn core(
name: PublicKey,
secret: SecretKey,
store_path: &str,
) -> (
Sender<ConsensusMessage>,
Receiver<NetMessage>,
Receiver<Block>,
) {
let (t... |
#![allow(warnings, unused)]
#![allow(clippy::float_cmp)]
use image::{ImageBuffer, RgbImage};
use indicatif::ProgressBar;
pub mod camera;
pub mod color;
pub mod material;
pub mod ray;
pub mod shapes;
pub mod tools;
pub mod vec3;
use camera::Camera;
use color::Color;
use material::Dielectric;
use material::Lamber;
use m... |
use crate::{error::Error, AppState};
use anchor_client::solana_sdk::instruction::AccountMeta;
use std::{cmp::min, marker::Send, sync::Arc, time::Duration};
use tokio::time::{Interval, MissedTickBehavior};
use tracing::{info, warn};
pub struct CrankConfig {
pub cache_oracle_interval: Duration,
pub cache_interes... |
//
// Sysinfo
//
// Copyright (c) 2017 <NAME>
//
use crate::sys::ffi;
use libc::{self, c_char, CTL_NET, NET_RT_IFLIST2, PF_ROUTE, RTM_IFINFO2};
use std::collections::HashMap;
use std::ptr::null_mut;
use crate::{NetworkExt, NetworksExt, NetworksIter};
macro_rules! old_and_new {
($ty_:expr, $name:ident, $old:ide... |
//! A simple example that demonstrates capturing window and input events.
use std::collections::HashSet;
use coffee::graphics::{
Color, Frame, Image, Point, Rectangle, Sprite, Window, WindowSettings,
};
use coffee::input::{self, keyboard, mouse, Input};
use coffee::load::Task;
use coffee::ui::{
Align, Column, ... |
/*
* Copyright (C) 2020-2021 Fanout, Inc.
*
* 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 ... |
use super::{
are_equal, binary_not, enforce_left_shift, enforce_stack_copy, field, is_binary, is_zero,
EvaluationResult,
};
// CONSTANTS
// ================================================================================================
const POW2_IDX: usize = 0;
const X_BIT_IDX: usize = 1;
const Y_BIT_IDX: u... |
use async_std::fs::{self, File};
use async_std::io::{self, BufReader};
use async_std::net::{Shutdown, TcpListener, TcpStream};
use async_std::prelude::*;
use async_std::process::{Command, Stdio};
use async_std::task;
use clap::{App, Arg};
use futures::stream::FuturesUnordered;
use log::{debug, error, info, warn};
use s... |
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::auto::traits::ListModelExt;
use crate::ListModel;
use crate::ListStore;
use glib::translate::*;
use glib::Cast;
use glib::{IsA, Object};
use std::cmp::Ordering;
impl ListStore {
#[doc(alias = "g_list_store_insert_sorted")]
... |
use core::marker::PhantomData;
use core::mem;
use crate::gpio::gpioa::*;
use crate::gpio::gpiob::*;
use crate::gpio::gpioc::*;
use crate::gpio::gpiod::*;
use crate::gpio::gpiof::*;
use crate::gpio::{AltFunction, DefaultMode};
use crate::rcc::Rcc;
use crate::stm32::{TIM1, TIM14, TIM15, TIM16, TIM17};
use crate::time::H... |
#![no_std]
pub mod pins;
pub use pins::Pins;
extern crate atsamd_hal as hal;
#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;
use hal::prelude::*;
use hal::*;
pub use hal::common::*;
pub use hal::target_device as pac;
use gpio::{Floating, Input, PfC, Port};
use ... |
use serde::{Deserialize, Serialize};
/// An enum representing the errors that can occur.
#[derive(Debug)]
#[non_exhaustive]
pub enum Error {
/// The exhaustive list of Meilisearch errors: <https://github.com/meilisearch/specifications/blob/main/text/0061-error-format-and-definitions.md>
/// Also check out: <h... |
// 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... |
use draw::mesh::vertex::{IntoPoint, IntoVertex};
use draw::properties::spatial::{self, orientation, position};
use draw::properties::{Draw, Drawn, IntoDrawn, Primitive, SetOrientation, SetPosition};
use draw::{self, Drawing};
use geom::line::join::miter;
use geom::{self, pt2, Point2};
use math::BaseFloat;
use mesh::ver... |
#![cfg(test)]
#![cfg(feature = "bitcoin")]
extern crate merkletree;
extern crate ring;
use merkletree::hash::{Algorithm, Hashable};
use merkletree::merkle::MerkleTree;
use merkletree::merkle::VecStore;
use ring::digest::{Context, SHA256};
use std::fmt;
use std::hash::Hasher;
use std::iter::FromIterator;
#[derive(Clon... |
use serde_json::{Value, to_value};
use helpers::{
object_from_list,
next_index,
create_array,
push_item_to_array
};
fn merge_object_and_array(to: &mut Value, from: &Value) -> Option<Value> {
let tree = to.as_object_mut().unwrap();
let vec = from.as_array().unwrap();
let index = next_index(t... |
use std::rc::Rc;
use std::cell::RefCell;
use std::hash::Hash;
use timely::ExchangeData;
use timely::dataflow::{ProbeHandle, Scope};
use ::{Dataset, Measurement};
// Reports for each `index` the number of nodes with degree greater than `index`.
//
// This measurement captures the cumulative density function for the ve... |
use anyhow::bail;
use aws_sdk_gamelift::model::{
GameSession, MatchmakingConfigurationStatus, MatchmakingTicket, Player, PlayerSession,
};
use tokio::{
io::{stdin, AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader},
net::TcpStream,
};
use tracing::info;
use uuid::Uuid;
use crate::gamelift::new_client... |
// Copyright 2022 pyke.io
// 2019-2021 Tauri Programme within The Commons Conservancy
// [https://tauri.studio/]
//
// 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... |
use crate::issues::IssueType;
use itertools::Itertools;
use serde::Serialize;
#[derive(Serialize, Debug)]
pub struct Metadata {
pub start_date: Option<String>,
pub end_date: Option<String>,
pub stop_areas_count: usize,
pub stop_points_count: usize,
pub lines_count: usize,
pub networks: Vec<Stri... |
#[macro_use]
extern crate diesel;
#[macro_use]
extern crate diesel_migrations;
use std::path::PathBuf;
use eyre::{Report, Result, WrapErr};
use futures::stream::{StreamExt, TryStreamExt};
use google_photoslibrary1::PhotosLibrary;
use log::LevelFilter;
use structopt::StructOpt;
use yup_oauth2::{
authenticator::Def... |
// Copyright 2020 The Tink-Rust Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
use super::callee::DeferredCallResolution;
use super::MaybeInProgressTables;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::vec_map::VecMap;
use rustc_hir as hir;
use rustc_hir::def_id::{DefIdMap, LocalDefId};
use rustc_hir::HirIdMap;
use rustc_infer::infer;
use rustc_infer::infer::{InferCtxt, In... |
use errors::*;
use std::env;
use std::default::Default;
use std::path::PathBuf;
use std::fs::File;
use std::io::Read;
use std::net::SocketAddr;
use std::str::FromStr;
use std::fmt;
use toml;
use logger::CodeLogLevel;
use siege_render::Config as RenderConfig;
//--------------------------------------------------
#[in... |
use super::Transducer;
use crate::types::{FlagDiacriticOperation, FlagDiacriticOperator, SymbolNumber, ValueNumber};
use hashbrown::HashMap;
type OperationsMap = HashMap<SymbolNumber, FlagDiacriticOperation>;
#[derive(Debug)]
pub struct TransducerAlphabet {
pub(crate) key_table: Vec<String>,
pub(crate) initia... |
// Copyright 2018 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... |
use std::collections::HashMap;
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct InputCellID(usize);
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct ComputeCellID(usize);
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct CallbackID(usize);
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CellID {
Input... |
use std::iter::Peekable;
use std::str::Chars;
use crate::token;
use token::{Token, TokenType};
#[cfg(test)]
#[path = "./lexer_test.rs"]
mod lexer_test;
type IsFunc = dyn Fn(char) -> bool;
// TODO: Add positions
pub struct Lexer<'a> {
input: Peekable<Chars<'a>>,
offset: usize,
}
impl<'a> Lexer<'a> {
pub... |
/*! Live brain viewer */
/*
Author: <NAME> <<EMAIL>>
SPDX-License-Identifier: AGPL-3.0-or-later
*/
use bevy::app;
use bevy::app::{ Events, EventReader };
use bevy::asset::{ Assets, AssetServer };
use bevy::ecs::{ Commands, Entity, Local, Query, Res, ResMut, SystemStage, With };
use bevy::math::{ Rect, Size, Vec3 };... |
use super::*;
use crate::process;
#[derive(Debug)]
struct PgrpInner {
pgid: pid_t,
process_group: HashMap<pid_t, ProcessRef>, // process id, process ref
leader_process: Option<ProcessRef>,
}
#[derive(Debug)]
pub struct ProcessGrp {
inner: RwLock<PgrpInner>,
}
impl ProcessGrp {
pub fn default() ->... |
#![allow(missing_docs)]
use crate::debug::TableEntry;
use crate::durability::Durability;
use crate::CycleError;
use crate::Database;
use crate::Query;
use crate::QueryTable;
use crate::QueryTableMut;
use crate::RuntimeId;
use crate::SweepStrategy;
use std::borrow::Borrow;
use std::fmt::Debug;
use std::hash::Hash;
pub... |
use super::{
constants::*,
mbr,
FatError,
};
use crate::sdcard::SdCardRef;
use avr_hal_generic::port::PinOps;
use core::convert::TryInto;
#[repr(packed)]
struct BiosParameterBlock {
bytes_per_sector: u16,
sectors_per_cluster: u8,
reserved_sector_count: u16,
fat_count: u8,
_root_dir_ent... |
use super::{DevicesTabs, Pages};
use crate::backend::{
ApiResponse, AuthenticatedBackend, Json, JsonHandlerScopeExt, Nothing, RequestHandle,
};
use crate::{
console::AppRoute,
error::{error, ErrorNotification, ErrorNotifier},
html_prop,
pages::{apps::ApplicationContext, devices::DetailsSection},
... |
use crate::{FileType, Highlighter, Position, Row, SearchDirection};
use anyhow::Result;
use std::{
fs,
io::{self, Write},
};
#[derive(Default)]
pub struct Document<'a> {
rows: Vec<Row>,
pub file_name: Option<String>,
dirty: bool,
file_type: FileType<'a>,
}
impl<'a> Document<'a> {
pub fn op... |
#![deny(warnings)]
extern crate toml;
#[macro_use]
extern crate serde_derive;
extern crate capabilities;
extern crate libc;
use std::convert::From;
use std::ffi::{CString, OsString};
use std::fs;
use std::io::Write;
use std::os::unix::io::AsRawFd;
use std::process::exit;
// The "prctl" library depends on nix, which ... |
// Copyright 2019 The Druid Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
use super::*;
#[repr(C)]
#[derive(Debug, Copy, Clone, Default)]
pub struct UniformData {
pub model: math::Mat4,
pub view: math::Mat4,
pub proj: math::Mat4,
}
pub struct Uniform {
handle: UniformHandle,
/// Pointer to mapped uniform buffer memory
// Later on resources will me referenced by ha... |
//! Support for MSA300 accelerometer
/* MSA300 code based on 'accelerometer' demo by <EMAIL> */
use crate::soc::i2c::I2C;
/** MSA300 Registers */
enum reg {
/** Part ID (R) */
PARTID = 0x01,
/** X-acceleration LSB (R) */
ACC_X_LSB = 0x02,
/** X-acceleration MSB (R) */
ACC_X_MSB = 0x03,
/** ... |
use std::any::TypeId;
use cranelift_entity::EntityList;
use libeir_diagnostics::SourceSpan;
use meta_table::{impl_meta_entry, MetaEntry};
use pretty::{DocAllocator, RefDoc};
use super::{DynOp, Op, OpBuild};
use crate::pattern::{PatternClause, PatternContainer};
use crate::traits::{FormatOpCtx, OpBranches, OpPrinter};... |
use super::{Vector4, VectorField};
use std::f32;
fn lerpf(a: f32, b: f32, t: f32) -> f32 {
a * (1.0 - t) + b * t
}
fn lerp((ax, ay, az, afa): Vector4, (bx, by, bz, bfa): Vector4, t: f32) -> Vector4 {
(
lerpf(ax, bx, t),
lerpf(ay, by, t),
lerpf(az, bz, t),
lerpf(afa, bfa, t),
... |
#![doc(html_root_url = "https://docs.rs/jpeg-to-pdf/0.2.2")]
//! Creates PDFs from JPEG images.
//!
//! Images are embedded directly in the PDF, without any re-encoding.
//!
//! # Example
//!
//! ```no_run
//! use std::fs::{self, File};
//! use std::io::BufWriter;
//!
//! use jpeg_to_pdf::JpegToPdf;
//!
//! let out_fil... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
use super::{futures, waiters::SomeWaker};
use crate::{
fail::Fail,
file_table::FileDescriptor,
protocols::{ipv4, Protocol},
runtime::Runtime,
scheduler::SchedulerHandle,
};
use nix::{self, sys::socket, unistd};
use std::{... |
use std::path::PathBuf;
#[cfg(feature = "battle_fuse")]
mod fuse;
mod io;
use crate::{assert_exists, error_abort};
use crate::utils;
use std::fs::{File, OpenOptions, DirBuilder};
use std::io::{Seek, SeekFrom, Write, Read};
use byteorder::{ReadBytesExt, WriteBytesExt};
use io::BattlePackReader;
use walkdir::WalkDir;... |
use super::{Player, PlayerType};
use crate::attribute::Quality;
use crate::describe::Description;
use crate::item::Item;
use crate::list::ListTrait;
use crate::location::Coord;
use crate::soul::SoulKind;
use crate::text::message::Broadcast;
use rand::Rng;
use serde::{Deserialize, Serialize};
use std::sync::mpsc::{chann... |
use crate::{endpoint::Endpoint, http::SkipHttpDetection, Accept, Outbound};
pub use linkerd_app_core::proxy::api_resolve::ConcreteAddr;
use linkerd_app_core::{profiles, svc, tls, transport::OrigDstAddr, Addr, Error};
pub use profiles::LogicalAddr;
use tracing::debug;
#[derive(Clone)]
pub struct Logical<P> {
pub or... |
use log::{error, warn};
use rusoto_core::credential::StaticProvider;
use rusoto_core::{HttpClient, Region, RusotoError};
use rusoto_s3::{PutObjectError, S3Client};
use rusoto_s3::{PutObjectRequest, S3};
use std::time::Duration;
mod fabric;
mod forge;
mod minecraft;
#[derive(thiserror::Error, Debug)]
pub enum Error {
... |
/*
* 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 std::fs::File;
use std::io::{BufWriter, Write};
use std::path::{Path, PathBuf};
use std::process::exit;
use anyhow::{Context... |
use crate::{
assets::Color,
hex::pointer::{HexPointer, VerticalDirection},
world::RhombusViewerWorld,
};
use amethyst::{
core::{math::Vector3, transform::Transform},
ecs::prelude::*,
input::{get_key, ElementState},
prelude::*,
winit::VirtualKeyCode,
};
use rhombus_core::hex::coordinates:... |
use std::result;
use std::fmt;
use source_span::{
Span,
SourceBuffer,
Metrics
};
use crate::{
syntax,
typing
};
use crate::{
Located,
Environment
};
pub struct Infos {
content: String,
label: Option<String>,
notes: Vec<String>,
highlights: Vec<(Span, Option<String>)>
}
impl Infos {
pub fn content(&self) -... |
use auth::{
method::{BothAuthInfo, EitherUserIdent},
AuthError,
};
use base::BoxFuture;
use serde::{de::DeserializeOwned, Serialize};
use std::borrow::Cow;
use std::hash::Hash;
/// One-time password auth user identification data
///
/// This is a user identification data such as email address, phone number and... |
extern crate regex;
use regex::Regex;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
pub struct TokenKind(pub u16);
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
pub struct Token {
pub kind: TokenKind,
pub len: usize,
}
pub type ExternRule = Box<Fn(&str) -> Option<usize> + Sen... |
//use std::i64;
use super::utils;
use super::Params;
use super::REVCOMP_AWARE;
use std::collections::HashMap;
use std::collections::HashSet;
//use pbr::ProgressBar;
//use bio::io::fasta;
//use std::path::PathBuf;
//use fasthash::city;
use itertools::Itertools;
use std::fs::File;
use std::io::{BufRead, BufReader};
//use... |
use chrono_tz::Tz;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use wasm_bindgen_futures::JsFuture;
use web_sys::{Request, RequestInit, RequestMode, Response};
use yew::prelude::*;
use crate::components::select::Select;
use crate::fetch::{FetchError, FetchState};
use crate::gbfs::{Gbfs, SystemInformation};
... |
use std::cmp;
use std::collections::HashMap;
pub trait Grid {
type Value;
type Coordinate;
fn height(&self) -> usize;
fn width(&self) -> usize;
fn at(&self, coord: &Self::Coordinate) -> Option<&Self::Value>;
fn points(&self) -> Vec<(Self::Coordinate, &Self::Value)>;
fn from_rows(source: i... |
extern crate failure;
#[macro_use] extern crate failure_derive;
extern crate serde;
#[macro_use] extern crate serde_derive;
use failure::Error;
use ghakuf::reader::*;
use std::collections::HashMap;
use std::env;
use std::fs;
use std::fs::File;
use std::io::BufReader;
use std::path::Path;
pub mod envelope;
use enve... |
use super::super::*;
#[ derive (Clone, Debug) ]
pub enum BtrfsLeafItem <'a> {
ChunkItem (BtrfsChunkItem <'a>),
DirIndex (BtrfsDirIndex <'a>),
DirItem (BtrfsDirItem <'a>),
ExtentData (BtrfsExtentData <'a>),
ExtentItem (BtrfsExtentItem <'a>),
InodeItem (BtrfsInodeItem <'a>),
InodeRef (BtrfsInodeRef <'a>),
Invali... |
use std::marker::PhantomData;
use specs::{storage::ComponentEvent, world::Index, BitSet, Join, ReadStorage, ReaderId, System, SystemData, WriteExpect, WriteStorage, World};
use crate::{bodies::PhysicsBody, pose::Pose, Physics, PhysicsWorld};
use nalgebra::RealField;
use nphysics::object::DefaultBodySet;
use super::... |
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Kani Contributors
// See GitHub history for details.
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir::def::Res;
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::{self, Visitor};
use rustc_hir::{HirId, Path};
use rus... |
use async_rustls::{client::TlsStream, webpki::DNSNameRef, TlsConnector};
use rustls::{ClientConfig, RootCertStore};
use std::{
fmt::{self, Debug, Formatter},
future::Future,
io::{Error, ErrorKind, Result},
marker::PhantomData,
net::SocketAddr,
pin::Pin,
sync::Arc,
task::{Context, Poll},
... |
use crate::{FromInner, Inner, IntoInner};
use std::ffi::CStr;
use uv::{
uv_fs_get_path, uv_fs_get_ptr, uv_fs_get_result, uv_fs_get_statbuf, uv_fs_get_system_error,
uv_fs_get_type, uv_fs_req_cleanup, uv_fs_t,
};
callbacks! {
pub FsCB(req: FsReq);
}
/// Additional data stored on the request
pub(crate) struc... |
use super::prelude::*;
pub use super::prelude::dyn;
use super::super::nodes::tests::{ApplyNot, EqTest, OrdTest, BetweenTest, StrArrayTest};
use super::super::nodes::beta::TestRepr;
use runtime::memory::StringCache;
use shared::fact::Fact;
use errors::CompileError;
#[derive(Clone, Hash, Eq, PartialEq, Debug)]
pub enum ... |
// Copyright © 2018 <NAME> - Piemyth
// [This work is licensed under the "MIT License"]
// Please see the file LICENSE in the source
// distribution of this software for license terms.
use std::{fs::File, io::{BufReader, Read}, path::Path, collections::HashMap};
use actix_web::{error, dev::{ServiceResponse, Service},... |
use chrono::{NaiveDate, NaiveTime};
use nom::character::complete::{char, one_of};
use nom::combinator::opt;
use nom::number::complete::float;
use nom::IResult;
use crate::parse::NmeaSentence;
use crate::{
sentences::utils::{parse_date, parse_hms, parse_lat_lon},
NmeaError,
};
#[derive(Debug, PartialEq)]
pub ... |
use ::{PhysicalAddress,VirtualAddress};
use ::{Void, Event, Handle, TableHeader};
use guid::Guid;
use memory::{MemoryType, MemoryDescriptor};
use status::Status;
pub type PoolPointer<T> = *mut T;
pub type Tpl = usize;
pub type EventNotifyFcn = extern "win64" fn(Event, *mut Void) -> ();
#[repr(C)]
pub enum TimerDelay ... |
#![allow(unknown_lints)]
#![allow(bare_trait_objects)]
use codec::Codec;
use codec::CodecSettings;
use codec::CodecTransform;
use codec::Direction;
use codec::Error;
use codec::FlushState;
use codec::Status;
use codec::TransformableCodec;
use std::cmp;
use std::collections::BTreeMap;
use std::io;
#[derive(Default)]
p... |
mod connected;
mod main;
mod widgets;
pub use self::connected::{Connect, Event};
pub use self::main::Main;
pub use self::widgets::{FontList, FontRow, Header};
use fontfinder::{
dirs,
fonts::{FontsList, Sorting},
html,
};
use gtk;
use gtk::prelude::*;
use gtk::WidgetExt;
use webkit2gtk::*;
use crate::utils... |
//! A scalable reader-writer lock.
//!
//! This implementation makes read operations faster and more scalable due to less contention,
//! while making write operations slower. It also incurs much higher memory overhead than
//! traditional reader-writer locks.
use std::cell::UnsafeCell;
use std::collections::HashMap;
... |
use arrow::{array::as_primitive_array, datatypes::Int64Type, record_batch::RecordBatch};
use futures::FutureExt;
use influxdb_iox_client::write_info::generated_types::{
GetWriteInfoResponse, KafkaPartitionStatus,
};
use std::time::Duration;
use test_helpers::timeout::FutureTimeout;
use test_helpers_end_to_end::{
... |
#![allow(unused, unused_macros)]
use std::collections::{HashMap, HashSet};
use proc_macro::TokenStream;
use quote::{format_ident, quote, quote_spanned, ToTokens};
use syn::{
parse_macro_input, parse_quote, parse_str, Attribute, Data::Struct, DeriveInput, Error, Field,
Fields, GenericParam, Generics, Ident, Met... |
use std::fs;
use walkdir::{DirEntry, WalkDir};
fn is_hidden(entry: &DirEntry) -> bool {
entry.path().to_string_lossy().starts_with("/etc/nixos/nixpkgs/.git")
}
fn main() {
let walker = WalkDir::new("/etc/nixos/nixpkgs").into_iter();
for entry in walker.filter_entry(|e| !is_hidden(e)) {
let entry... |
use std::error::Error;
use std::fmt;
use std::io;
use std::iter;
use std::path::{Path, PathBuf};
use xmlparser as xml;
use crate::audiofile::dynamic::LoadError as AudioFileLoadError;
use crate::error::FromSourceAndContext;
#[derive(Debug)]
pub struct ParseError {
msg: String,
context: String,
}
impl ParseEr... |
use anyhow::Result;
#[derive(Clone, Debug, tangram::PredictInput)]
pub struct Input {
pub age: f32,
pub gender: Gender,
pub chest_pain: ChestPain,
pub resting_blood_pressure: f32,
pub cholesterol: f32,
pub fasting_blood_sugar_greater_than_120: FastingBloodSugarGreaterThan120,
pub resting_ecg_result: RestingEcgR... |
use crate::AutoLaunch;
use std::fs;
use std::io::{Error, ErrorKind, Result, Write};
use std::path::{Path, PathBuf};
use std::process::{Command, Output};
/// Macos implment
impl AutoLaunch {
/// Create a new AutoLaunch instance
/// - `app_name`: application name
/// - `app_path`: application path
/// - ... |
use std::{
collections::{HashMap, HashSet},
env,
sync::Arc,
};
use serenity::prelude::*;
use serenity::{
async_trait,
client::bridge::gateway::{ShardId, ShardManager},
framework::standard:: StandardFramework,
http::Http,
model::{
channel::{Message, Reaction, ReactionType},
... |
//! ID3v2 items and utilities
//!
//! ## Important notes
//!
//! See:
//!
//! * [`Id3v2Tag`]
//! * [Frame]
mod flags;
#[cfg(feature = "id3v2")]
mod frame;
#[cfg(feature = "id3v2")]
mod items;
#[cfg(feature = "id3v2")]
pub(crate) mod read;
#[cfg(feature = "id3v2_restrictions")]
mod restrictions;
#[cfg(feature = "id3v2"... |
use std::{fs, collections::{HashMap, HashSet}};
pub fn part_1() {
println!("fastest path is {} scary", find_fastest_path("./input/day_15.txt"));
}
pub fn part_2() {
println!("fastest path is {} scary", find_in_bigger_path("./input/day_15.txt"));
}
#[derive(Hash, PartialEq, Eq, Debug)]
struct Vertex ... |
use std::cmp::Ordering;
use std::collections::BTreeSet;
use std::iter::FromIterator;
use std::path::{Path, PathBuf};
use clap::{App, Arg};
#[derive(Clone, Debug)]
struct File {
path: PathBuf,
hash: u64,
}
impl Ord for File {
fn cmp(&self, other: &File) -> Ordering {
self.hash.cmp(&other.hash)
... |
/*
* 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 hex::encode;
use lazy_static::lazy_static;
use secp256k1::{
constants,
key::{PublicKey, SecretKey},
recovery::{RecoverableSignature, RecoveryId},
Error as SecpError, Message as SecpMessage, Secp256k1,
};
use std::fmt;
use std::ops::{Deref, DerefMut};
use types::{H160, H256, H512};
/// Secp256k1 Pri... |
use ::gamepad::GamepadMappingType;
/// A named button on the standard gamepad.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum Button {
/// "A" on Xbox, "cross" on PlayStation, "B" on Nintendo.
South,
/// "B" on Xbox, "circle" on PlayStation, "A" on Nintendo.
East,
/// "X" on... |
#![feature(plugin, decl_macro)]
#![plugin(rocket_codegen)]
#![feature(non_modrs_mods)]
#![feature(crate_in_paths)]
#![feature(nll)]
extern crate base62;
#[macro_use]
extern crate lazy_static;
extern crate r2d2;
extern crate r2d2_sqlite;
extern crate rand;
extern crate reqwest;
extern crate rocket;
#[macro_use]
extern ... |
use super::cargo_cmds::*;
use super::Result;
use std::io::{self, Write};
use std::process::ExitStatus;
const FN_MAIN: &str = "fn main() {";
#[derive(Clone)]
pub struct Repl {
pub body: Vec<String>,
cursor: usize,
}
impl Repl {
pub fn new() -> Self {
Self {
body: vec![
... |
use web_sys::*;
use web_sys::WebGlRenderingContext as Gl;
pub fn link_prg(
gl: &WebGlRenderingContext,
vert_src: &str,
frag_src: &str,
) -> Result<WebGlProgram, String>{
let prg = gl.
create_program()
.ok_or_else(|| String::from("Error creating program"))?;
let vert_shader = compile... |
/*
Traverses the molecule adjacency matrix and recognizes against the functional group patterns
*/
use crate::molecule::molecule::*;
static DEBUG_LEVEL : i32 = 1;
macro_rules! debug_println {
($($args:expr), *) => {
if DEBUG_LEVEL >= 2 {
println!($($args), *);
}
}
}
// finds sub... |
use crate::error::Error;
use parquet_format_async_temp::ConvertedType;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum PrimitiveConvertedType {
Utf8,
/// an enum is converted into a binary field
Enum,
/// A decimal value.
///
/// This may be used to annotate binary or fixed primitiv... |
use anyhow::Error;
use move_binary_format::access::{ModuleAccess, ScriptAccess};
use move_binary_format::CompiledModule;
use move_binary_format::file_format::{
Ability, AbilitySet, SignatureToken, StructHandleIndex, Visibility,
};
use move_core_types::account_address::AccountAddress;
use crate::bytecode::accessor::... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.