text stringlengths 3.09k 13.9k |
|---|
use crate::cli::push::Config as PushConfig;
use crate::data::*;
use crate::models::*;
use crate::push;
use crate::schema::stock_infos::dsl::*;
use crate::{add_missing_stocks, web};
use chrono::{Datelike, Duration, Local, Timelike, Utc};
use clap::ArgMatches;
use clap::{App, Arg, SubCommand};
use diesel::prelude::*;
us... |
//! Code to convert line protocol to [`MutableBatch`]
#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)]
#![warn(
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
clippy::explicit_iter_loop,
clippy::future_not_send,
clippy::use_self,
cl... |
pub type boolean_t = ::c_uint;
pub type mcontext_t = *mut __darwin_mcontext64;
s! {
pub struct ucontext_t {
pub uc_onstack: ::c_int,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_link: *mut ::ucontext_t,
pub uc_mcsize: usize,
pub uc_mcontext: mcontext_t... |
use std::ffi::OsStr;
use std::fmt::{Debug, Display, Formatter};
use std::fmt;
use std::ops::{Deref, Index};
use std::os::unix::ffi::OsStrExt;
use std::path::Path;
use std::str::from_utf8;
use anyhow::Context;
use apply::Apply;
use DependencyType::{Implicit, Normal, Ordered};
use crate::parser::Parser;
use crate::uti... |
//! This is heavily inspired by kiss3d's implementation of window and context.
//! Go check out their code! https://github.com/sebcrozet/kiss3d
extern crate gl;
use crate::{
AbstractWindow, Event as EventWrapper, Key, ModifierKeys, MouseButton as MouseButtonWrapper,
};
use glutin::{
self,
dpi::{LogicalPos... |
use crypto::digest::Digest;
use crypto::sha1::Sha1;
use failure::ResultExt;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::fs::read_to_string;
use std::path::PathBuf;
use std::result;
use std::str::FromStr;
use structopt::StructOpt;
use ynab_sync::error::{ErrorKind, Result};
use ynab_sync::ingdiba::{IngDiB... |
use std::collections::HashMap;
use std::fs::{File, OpenOptions};
use std::io;
use std::io::{BufRead, Write};
use std::path::Path;
use std::process::exit;
/// Gathers the set of words from space-separated corpus and makes a vocabulary.
pub fn make_vocab<P: AsRef<Path>>(path: P, size: usize) -> Result<HashMap<String, u3... |
use crate::{
algorithm::{euclidean_distance::EuclideanDistance, euclidean_length::EuclideanLength},
CoordinateType, Line, LineString, Point,
};
use num_traits::{
identities::{One, Zero},
Float,
};
use std::ops::AddAssign;
/// Returns a fraction of the line's total length
/// representing the location
/... |
extern crate sfml;
use super::emulator::vm::VMInterface;
use crate::emulator::basics::{SCREEN_HEIGHT, SCREEN_WIDTH};
use crate::emulator::vm::Display;
use sfml::audio::{Sound, SoundBuffer, SoundSource};
use sfml::graphics::{Color, RectangleShape, RenderTarget, RenderWindow, Shape, Transformable};
use sfml::system::{Sf... |
use criterion::Criterion;
use fitsio::images::{ImageDescription, ImageType};
use fitsio::tables::{ColumnDataType, ColumnDescription, FitsRow};
use fitsio::FitsFile;
use fitsio_derive::FitsRow;
use tempfile::Builder;
fn opening_files(c: &mut Criterion) {
let filename = "../testdata/full_example.fits";
c.bench_f... |
use shm::{SharedMem, SharedMemMap, Access as SharedMemAccess};
use std::{io, fs, slice};
use std::ops::Deref;
use std::io::Read;
use serde::{Serialize, Deserialize, Serializer, Deserializer};
/// Wraps a normal `std::fs::File` so it may be transmitted to other processes.
#[derive(Debug)]
pub struct SendableFile<B = ... |
use crate::render::mesh::Mesh;
// From Bevy
// https://github.com/bevyengine/bevy/blob/cf221f9659127427c99d621b76c8085c4860e2ef/crates/bevy_render/src/mesh/shape/mod.rs
#[derive(Debug, Copy, Clone)]
pub struct Cube {
pub size: f32,
}
#[allow(dead_code)]
impl Cube {
pub fn new(size: f32) -> Cube {
Cub... |
use ct_lib_core::log;
use std::{cell::RefCell, collections::VecDeque, rc::Rc};
use wasm_bindgen::{prelude::*, JsCast};
use super::html_get_document;
const AUDIO_SAMPLE_RATE: usize = 44100;
const AUDIO_BUFFER_FRAMECOUNT: usize = 512;
const AUDIO_NUM_CHANNELS: usize = 2;
const AUDIO_CHANNEL_LEFT: usize = 0;
const AUD... |
use d10_core::pixelbuffer::PixelBuffer;
use d10_core::color::Rgb;
use d10_core::errors::ParseEnumError;
use std::str::FromStr;
use std::f32::consts::PI;
#[derive(Copy, Clone, Debug)]
pub enum FilterMode {
Nearest,
Bilinear,
Bicubic,
Lanczos3,
}
impl FromStr for FilterMode {
type Err = ParseEnumEr... |
use crate::assets::TileAssets;
use crate::map::MaxViewBounds;
use crate::prelude::*;
use bevy::input::mouse::{MouseWheel, MouseScrollUnit, MouseMotion};
use bevy::render::camera::RenderTarget;
use bevy::render::render_resource::FilterMode;
use bevy_tweening::*;
use bevy_tweening::lens::*;
use crate::AppGlobalState;
p... |
//! This module stores the errno utilities.
/// Type representing an Unix errno.
pub type Errno = i32;
/// Argument list too long.
pub const E2BIG: Errno = 0;
/// Permission denied.
pub const EACCES: Errno = 1;
/// Address in use.
pub const EADDRINUSE: Errno = 2;
/// Address not available.
pub const EADDRNOTAVAIL: Er... |
use std::fmt;
use attributes::{Attribute, RegulatoryRuleAttribute};
use netlink_rust as netlink;
use netlink_rust::generic;
use netlink_rust::Result;
bitflags! {
pub struct RegulatoryFlags: u32 {
const NO_OFDM = 1;
const NO_CCK = 1 << 1;
const NO_INDOOR = 1 << 2;
c... |
use crate::authorization_policy::AuthorizationPolicy;
use crate::connection_string::{ConnectionString, ConnectionStringBuilder};
use crate::error::Result;
use crate::operations::mgmt::ManagementQueryBuilder;
use crate::operations::query::ExecuteQueryBuilder;
use azure_core::auth::TokenCredential;
use azure_core::prelud... |
//! Provides `input!` macro.
//!
//! # Example
//!
//! ```no_run
//! #[macro_use]
//! extern crate input as _;
//!
//! use input::Usize1;
//!
//! fn main() {
//! // https://atcoder.jp/contests/abc166/tasks/abc166_b
//!
//! input! {
//! n: usize,
//! //ass: [[{ |n: usize| n - 1 }]],
//! a... |
use std::mem::size_of;
use ash::prelude::VkResult;
use ash::version::{DeviceV1_0, InstanceV1_0};
use ash::{self, vk};
use super::error::VulkanError;
use super::util;
pub struct BufferWrapper {
pub buffer: vk::Buffer,
pub memory: vk::DeviceMemory,
pub memory_type: vk::MemoryType,
}
impl BufferWrapper {
... |
use core::mem;
use helpers::*;
//use hil::uart;
use nvic;
use chip;
struct Registers {
startrx: u32,
stoprx: u32,
starttx: u32,
stoptx: u32,
reserved0: [u32; 62],
rxdrdy: u32,
reserved1: [u32; 4],
txdrdy: u32,
error: u32,
reserved2: [u32; 119],
inten: u32,
intenset: ... |
extern crate clap;
use clap::{App, Arg}; //, SubCommand};
mod paf;
use crate::paf::{PafFile, paf_query_end, paf_target, paf_target_length, paf_target_begin, paf_target_end, paf_query, paf_query_length, paf_query_is_rev, paf_query_begin};
fn main() {
let matches = App::new("paf2chain")
.version("0.1.0")
... |
// External Dependencies ------------------------------------------------------
use rand::Rng;
use std::{cmp, f32};
// Internal Dependencies ------------------------------------------------------
use shared::entities::Ship;
use shared::{SharedState, SharedLevel, Color, ColorName};
use shared::Lithium::{Entity, Entity... |
use quote::Tokens;
use syn::{Attribute, Field, Lit::Str, Meta, Meta::*, MetaList, MetaNameValue, NestedMeta::*};
fn walk_attrs(attrs: &[Attribute], callback: &mut FnMut(Meta)) {
use Meta::*;
use NestedMeta::*;
let valid_tokens = attrs
.iter()
.filter_map(|attr| {
let path = &at... |
extern crate rand;
use rand::distributions::{Distribution, Uniform};
use std::io::{self, Write};
mod player;
use player::Player;
fn main() {
let dice_distribution = get_distribution(6);
println!("Welcome to Farkle!");
let mut players = get_players(get_num_players());
while !is_game_over(&players) {
... |
use std::fs;
use std::fs::File;
use std::io::Write;
use std::path::{Path, PathBuf};
use anyhow::{ensure, Context, Result};
use rood::cli::OutputManager;
use rood::sys::file::{self, ensure_exists};
use sha2::{Digest, Sha256};
use tempfile::tempdir;
use walkdir::WalkDir;
use super::fuzzy_semver::parse_version_fuzzy... |
//! <https://github.com/EOSIO/eosio.cdt/blob/4985359a30da1f883418b7133593f835927b8046/libraries/eosiolib/core/eosio/crypto.hpp#L22-L48>
use crate::{NumBytes, Read, Signature, UnsignedInt, Write};
use alloc::string::ToString;
use codec::{Decode, Encode};
use core::{
convert::{TryFrom, TryInto},
fmt,
marker::... |
use sokol_bindings::{
cstr,
sg::{
self,
Bindings,
Pipeline,
PipelineDesc,
},
Int,
};
use math::{
Scale,
angle::{Radians, TAU},
mat4::Mat4,
vec3::vec3,
vec4::vec4,
};
use crate::shaders::{self, basic};
#[derive(Default)]
pub struct State {
pub bind... |
use hecs::Entity;
use sierra::{
descriptors, graphics_pipeline_desc, mat4, pipeline, shader_repr, vec4, DepthTest,
DescriptorsInput, DynamicGraphicsPipeline, Encoder, Extent2d, Format, FragmentShader,
ImageView, PipelineInput, RenderPassEncoder, Sampler, ShaderModuleInfo, VertexInputAttribute,
VertexInp... |
use crate::common::{info as __info, *};
use api::routes::graphql::graphql as graphql_route;
use api::routes::graphql::playground as playground_route;
use api::routes::healthz::healthz as healthz_route;
use api::routes::recover;
use api::routes::shortcuts::bargain_day as bargain_day_route;
use api::db::PgPool;
use api... |
//! Improved version of Rust's `include_bytes` macro that allows to reinterpret input as differently array.
//!
//! Due to inability to capture current file path in the stable Rust, this macro only accepts paths relative to crate's root.
#![warn(missing_docs)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::style)... |
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writ... |
//! # client
//!
//! Ssh2-config implementation with a ssh2 client
/**
* MIT License
*
* ssh2-config - Copyright (c) 2021 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software with... |
use std::io::Write;
use std::time::{Duration, Instant};
use clap::*;
use log::Level;
use memflow::cglue::*;
use memflow::error::Result;
use memflow::mem::*;
use memflow::os::{ModuleInfo, OsInner, Process};
use memflow::plugins::*;
use memflow::types::*;
use rand::{Rng, SeedableRng};
use rand_xorshift::XorShiftRng as... |
#![allow(clippy::non_ascii_literal)]
use serde::Deserialize;
use std::{collections::HashMap, path::Path};
use structopt::StructOpt;
type ImageId = String;
type ImageUrl = String;
pub type Frames = Vec<Node>;
#[derive(StructOpt, PartialEq, Debug, Deserialize)]
#[structopt(
name("🌇 Figma Asset Downloader"),
a... |
use std::io::BufRead;
use crate::{cli, Day, PartResult};
use std::error::Error;
use std::collections::HashMap;
pub struct Day14;
// Make sure each element is an uppercase letter.
fn check_char(b: u8) -> Result<u8, Box<dyn Error>> {
if b >= b'A' && b <= b'Z' { Ok(b) } else { Err(format!("bad char '{}'", b).into())... |
use bytes::{BufMut, BytesMut};
use config::Configuration;
use futures::{Async, AsyncSink, Future, Poll, Sink, StartSend, Stream};
use messages::{ClusterMessage, MultiPaxosMessage};
use serde::de::DeserializeOwned;
use serde::Serialize;
use serde_cbor::de;
use serde_cbor::ser;
use std::fmt;
use std::io;
use std::marker:... |
mod utils;
//extern crate js_sys;
use wasm_bindgen::prelude::*;
use std::fmt;
use std::collections::HashMap;
use crate::utils::set_panic_hook;
//use byteorder::BigEndian;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static A... |
use std::path::PathBuf;
use std::process::Stdio;
use tokio::process::{Command, Child, ChildStdin, ChildStdout};
use tokio::io::{
AsyncBufReadExt,
AsyncWriteExt,
BufReader,
};
use std::time::Duration;
use std::sync::Arc;
use tokio::sync::Mutex;
use lockedfile_test::*;
use tracing::instrument;
use tracing_sub... |
use serde::Deserialize;
use actix::prelude::*;
use actix_web_actors::ws;
use kosem_webapi::protocols::{JrpcMessage, JrpcResponse, JrpcError};
use crate::role_actors;
use crate::internal_messages::connection::{RpcMessage, SetRole, AddHumanActor};
pub struct WsJrpc {
pub state: role_actors::ActorRoleState,
}
impl... |
use alloc::boxed::Box;
use crate::proc_macro::TokenStream;
use crate::syn::{Data, DeriveInput, Fields, Lit, Meta, NestedMeta, Path};
use crate::{panic, TypeEnum, Validator};
#[derive(Debug)]
pub struct Struct(TypeEnum);
const ITEM: Struct = Struct(TypeEnum::CollectionLength);
const VALIDATOR: Validator = Validator:... |
use super::pubsub_core::*;
use futures::*;
use futures::task;
use futures::task::{Poll};
use std::sync::*;
use std::pin::{Pin};
///
/// Represents a subscriber stream from a publisher sink
///
pub struct Subscriber<Message> {
/// The publisher core (shared between all subscribers)
///
/// Note that whe... |
use crate::vec::*;
use crate::aabb::*;
use crate::ray::*;
use crate::hit::*;
use crate::material::*;
#[derive(Debug, Clone, Copy)]
pub struct Vertex {
pub pos: Vec3,
pub norm: Vec3,
}
pub struct Mesh {
//triangles: Vec<[u32; 3]>,
bvh: BvhNode,
vertices: Vec<Vertex>,
material: Option<Material>... |
use dioxus_core::*;
use crate::state::union_ordered_iter;
#[derive(Debug)]
pub struct NodeView<'a> {
inner: &'a VNode<'a>,
mask: NodeMask,
}
impl<'a> NodeView<'a> {
pub fn new(mut vnode: &'a VNode<'a>, view: NodeMask, vdom: &'a VirtualDom) -> Self {
if let VNode::Component(sc) = vnode {
... |
//! A naive, single-threaded Async Mutex implementation
//!
//! It is used by the embedded implementation and is only safe on
//! single-core systems.
//!
//! It should only ever be used in processor "thread" mode. (i.e. not in irq
//! contexts, exception handlers etc.)
//!
//! NOTE based on async-std v1.5.0
use core:... |
use advent_of_code::*;
use std::collections::{HashMap, HashSet};
use std::ops::RangeInclusive;
use std::str::FromStr;
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
enum Rule {
DepartureLocation,
DepartureStation,
DeparturePlatform,
DepartureTrack,
DepartureDate,
DepartureTime,
ArrivalL... |
/* Copyright 2018 <NAME> <<EMAIL>>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, ... |
use std::env;
use wireguard_proxy::{Args, ProxyClient, ProxyServer};
fn main() {
let raw_args = env::args().collect();
let args = Args::new(&raw_args);
if args.flag("-V") || args.flag("--version") {
print!("wireguard-proxy {} ", env!("CARGO_PKG_VERSION"));
#[cfg(not(any(feature = "tls", fe... |
use super::SourceLocation;
use std::fmt;
#[derive(Debug, PartialEq, Eq)]
pub enum CompilationErrorKind {
AbruptClosingOfEmptyComment,
CDataInHtmlContent,
DuplicateAttribute,
EndTagWithAttributes,
EndTagWithTrailingSolidus,
EofBeforeTagName,
EofInCdata,
EofInComment,
EofInScriptHtmlC... |
use std::io;
use std::net::Shutdown;
use std::pin::Pin;
use std::task::{Context, Poll};
use libc::{c_int, c_ushort, sa_family_t};
use socket2::{Domain, Protocol, SockAddr, Socket, Type};
use tokio::io::unix::AsyncFd;
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
// <bluetooth/hci.h>
const BTPROTO_HCI: c_int = 1;
c... |
// Declare all modules that are children of main
mod app;
mod cli;
mod config;
mod custom_sql_types;
mod db;
mod manager;
mod models;
mod notifications;
mod requests;
mod routes;
mod schema;
mod storage;
mod util;
mod validation;
#[cfg(test)]
mod unit_test_util;
#[macro_use]
extern crate diesel;
#[macro_use]
extern c... |
#![allow(clippy::many_single_char_names,clippy::explicit_counter_loop, clippy::redundant_closure)]
use chapter01::interface::Queue;
#[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BinaryHeap<T> {
a: Box<[Option<T>]>,
n: usize,
}
impl<T: PartialOrd> BinaryHeap<T> {
pub fn ... |
use crate::arguments::{FileDesc, Files, Mode};
use crate::read_counter::ReadCounter;
use std::fs::{metadata, remove_file, set_permissions, File, OpenOptions};
use std::io::{
self, Error as IoError, ErrorKind as IoErrorKind, Read, Result, Stdin, Stdout, Write,
};
use std::path::Path;
use atty::Stream;
use lz4jb::{... |
use anyhow::Result;
use clap::Parser;
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
use octocrab::models::workflows::Run;
use opentelemetry::trace::Tracer;
use opentelemetry::trace::TracerProvider;
use opentelemetry::KeyValue;
/// `gh-action-trace` is used to create traces for GitHub Action runs
/// by t... |
use diesel::*;
infer_schema!(dotenv!("DATABASE_URL"));
#[derive(PartialEq, Eq, Debug, Clone, Queryable, Identifiable)]
#[changeset_for(users)]
#[insertable_into(users)]
#[has_many(posts)]
pub struct User {
pub id: i32,
pub name: String,
pub hair_color: Option<String>,
}
impl User {
pub fn new(id: i32... |
use common::bdev_io;
use mayastor::{
bdev::nexus_create,
core::{BdevHandle, CoreError, MayastorCliArgs},
lvs::{Lvol, Lvs},
};
use rpc::mayastor::{
CreatePoolRequest,
CreateReplicaRequest,
ShareProtocolReplica,
ShareReplicaRequest,
};
use tracing::info;
pub mod common;
use common::{compose::... |
extern crate bellman_bignat;
extern crate num_bigint;
extern crate rand;
extern crate sapling_crypto;
use bellman_bignat::mp::bignat::nat_to_limbs;
use bellman_bignat::group::RsaQuotientGroup;
use bellman_bignat::hash::hashes::Poseidon;
use bellman_bignat::set::int_set::NaiveExpSet;
use bellman_bignat::set::GenSet;
us... |
use crate::puzzle_input;
use std::collections::HashMap;
use std::slice::Iter;
pub fn run() {
let input: Vec<String> = puzzle_input::read_all_lines("./input/2021-d04-input.txt");
let (draw, mut boards) = parse_input(&input);
let n = boards.len();
let (last, winner) = play(&draw, &mut boards, n);
le... |
use std::io::{self, Read};
// use std::collections::HashMap;
#[derive(Clone, Copy, Debug)]
enum Node {
Op {
op_type: u8,
l: usize,
r: usize,
accm: i32,
},
Val(i32),
None,
}
impl Default for Node {
fn default() -> Self { Node::None }
}
fn main() {
let mut buffer... |
// Copyright 2020-2021 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any l... |
use std::fmt;
use std::cmp;
fn main() {
let mut seq1: String = String::new();
let mut seq2: String = String::new();
println!("Enter two DNA sequences: ");
let stdin = std::io::stdin();
stdin.read_line(&mut seq1)
.expect("Failed to read sequence #1 from buffer!");
stdin.read_line(&mut... |
use super::memory::Memory;
use super::memory_map;
use super::bit_operations;
pub const FRAME_WIDTH : usize = 160;
pub const FRAME_HEIGHT : usize = 144;
pub const FRAME_HEIGHT_FULL : usize = 154;
#[allow(dead_code)]
const BG_DIMENSION : u16 = 256; // background dimension
const BG_BLOCKS_PER_AXIS : ... |
// Std
use std::str::FromStr;
// Third party
use bitflags::bitflags;
bitflags! {
struct Flags: u32 {
const REQUIRED = 1;
const MULTIPLE_OCC = 1 << 1;
const NO_EMPTY_VALS = 1 << 2;
const GLOBAL = 1 << 3;
const HIDDEN = 1 << 4;
const... |
use std::{collections::HashMap, fmt};
use super::*;
impl fmt::Display for Header {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Header::To(value) => write_simple_field("To", value, f),
Header::From(value) => write_simple_field("From", value, f),
H... |
use std::{path::{Path, self}, fs};
#[macro_use]
extern crate singlemap;
#[macro_use]
extern crate log;
extern crate log4rs;
extern crate serde_json;
pub mod auto_config;
pub mod run;
#[test]
fn copy_the_lib(){
let sym = get_path_symbol();
let crate_lib_path = env!("CARGO_MANIFEST_DIR");
let crate_lib_sy... |
//! Various utilities for string operations.
use itertools::Itertools;
/// Iterator over words in a camel-case
/// or snake-case string.
pub struct WordIterator<'a> {
string: &'a str,
index: usize,
}
impl<'a> WordIterator<'a> {
/// Create iterator over `string`.
pub fn new(string: &str) -> WordIterat... |
use std::collections::HashMap;
use codemap::{Span, Spanned};
use crate::{
common::Identifier,
error::SassResult,
value::Value,
{Cow, Token},
};
#[derive(Debug, Clone)]
pub(crate) struct FuncArgs(pub Vec<FuncArg>);
#[derive(Debug, Clone)]
pub(crate) struct FuncArg {
pub name: Identifier,
pub ... |
use std::{ffi::CString, result::Result as StdResult, time};
use crate::{
error::{DxLibError, I32CodeExt, Result},
math::vector::Vector4,
plugin::Plugin,
screen::Screen,
utils::to_sjis_bytes,
};
use dxlib_sys::*;
use smart_default::SmartDefault;
use winapi::shared::windef::HWND;
const DEFAULT_WIDTH... |
///
/// Blitz Explorer
///
/// The interface of the filesystem. With this the user can access
/// the content of tar.gz files
///
/// Copyright 2019 <NAME> <<EMAIL>>
///
use std::ffi::OsStr;
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use std::io::prelude::Read;
use libc::ENOENT;
use time::{self, Time... |
#[macro_use]
extern crate clap;
#[macro_use]
extern crate serde_derive;
// extern crate serde_yaml;
use std::collections::HashMap;
// use std::fs::File;
use std::io::{self, Write};
use clap::App;
#[derive(Debug, Serialize, Deserialize)]
struct RoundData {
attempts: Vec<AttemptData>,
mission_success: bool,
}
... |
use std::{cell::RefCell, rc::Rc, sync::atomic::Ordering, time::Duration};
#[cfg(feature = "debug")]
use smithay::backend::renderer::gles2::Gles2Texture;
#[cfg(feature = "egl")]
use smithay::{
backend::renderer::{ImportDma, ImportEgl},
wayland::dmabuf::init_dmabuf_global,
};
use smithay::{
backend::{input::... |
use std::sync::Arc;
use crate::{
array::{
Array, MutableArray, MutableBinaryArray, MutablePrimitiveArray, MutableUtf8Array, Offset,
},
bitmap::MutableBitmap,
datatypes::DataType,
error::{ArrowError, Result},
types::NativeType,
};
use super::FixedSizeListArray;
/// The mutable version ... |
// Copyright 2020 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... |
//! codetour_export_to_md/src/lib_internal.rs
//! This is an internal lib for the main.rs.
//! I don't want to make it a real lib.rs external library.
use ansi_term::Colour::Green;
use ansi_term::Colour::Red;
//use ansi_term::Colour::Yellow;
use glob::glob;
use serde_derive::{Deserialize, Serialize};
use std::fs;
use ... |
use std::collections::HashMap;
use std::sync::Arc;
use std::path::Path;
use std::fs;
use super::lexer;
use super::types;
use super::interpreter;
use super::exceptions;
use super::run;
#[derive(Clone)]
pub struct Origin {
pub start : lexer::LexerPosition,
pub end : lexer::LexerPosition,
pub context: ... |
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//! Common trait for all the directory entry objects.
#![warn(missing_docs)]
use {
fidl::endpoints::ServerEnd,
fidl_fuchsia_io::{
NodeMar... |
use alloc::boxed::Box;
use core::ops::{Deref, DerefMut};
use intrusive_collections::{
intrusive_adapter,
rbtree::{RBTree, CursorMut},
RBTreeLink,
KeyAdapter,
};
/// A wrapper for the type stored in the `StaticArrayRBTree::Inner::RBTree` variant.
pub struct Wrapper<T: Ord> {
link: RBTreeLink,
inner... |
//! CLI to create databases.
#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)]
#![warn(
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
clippy::explicit_iter_loop,
clippy::future_not_send,
clippy::use_self,
clippy::clone_on_ref_ptr
)]
... |
use core::{marker::PhantomData, ops::Deref};
use crate::{
gpio::pin::bank0::BankPinId,
gpio::pin::{FunctionI2C, Pin, PinId},
resets::SubsystemReset,
};
use pac::{i2c0::RegisterBlock as I2CBlock, RESETS};
use super::{Peripheral, SclPin, SdaPin, I2C};
/// I2C bus events
#[derive(Debug, PartialEq, Eq)]
pub ... |
use super::message::*;
use super::super::gtk_action::*;
use super::super::gtk_thread::*;
use super::super::gtk_event::*;
use super::super::widgets::*;
use flo_stream::*;
use gtk;
use gtk::prelude::*;
use glib;
use futures::prelude::*;
use futures::stream::{BoxStream};
use std::collections::{HashMap, VecDeque};
use s... |
#![deny(missing_docs)]
#![doc(html_root_url = "https://docs.rs/tokio-tls/0.2.1")]
//! Async TLS streams
//!
//! This library is an implementation of TLS streams using the most appropriate
//! system library by default for negotiating the connection. That is, on
//! Windows this library uses SChannel, on OSX it uses Se... |
#![warn(bare_trait_objects)]
extern crate image;
extern crate rand;
extern crate rayon;
extern crate atomic_counter;
mod ray;
mod vec;
mod sphere;
mod drawable;
mod world;
mod camera;
mod scatterer;
mod materials;
use atomic_counter::{AtomicCounter, RelaxedCounter};
use rand::Rng;
use std::time::Instant;
use std::sy... |
// 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... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - CRC32 Data In"]
pub crc32diw0: crate::Reg<crc32diw0::CRC32DIW0_SPEC>,
#[doc = "0x02 - CRC32 Data In"]
pub crc32diw1: crate::Reg<crc32diw1::CRC32DIW1_SPEC>,
#[doc = "0x04 - CRC32 Data In Reversed Bit"]
pub crc32dirbw... |
//! Gossip event handler which uses `SwitchboardState` as its underlying persisted store.
#![allow(clippy::unit_arg)]
use std::sync::Arc;
use crate::types::event::{KitsuneP2pEvent, KitsuneP2pEventHandler, KitsuneP2pEventHandlerResult};
use crate::{event::*, KitsuneHost};
use kitsune_p2p_types::bin_types::*;
use kits... |
use super::{
Imprint, ImprintField, ImprintHistory, ImprintOrderBy, NewImprint, NewImprintHistory,
PatchImprint,
};
use crate::graphql::utils::Direction;
use crate::model::{Crud, DbInsert, HistoryEntry};
use crate::schema::{imprint, imprint_history};
use crate::{crud_methods, db_insert};
use diesel::dsl::any;
u... |
use super::*;
use std::fs::File;
use std::io::{Seek, SeekFrom};
use std::os::windows::io::{AsRawHandle, RawHandle};
use winapi::shared::minwindef::{DWORD, LPVOID};
use winapi::shared::ntdef::LARGE_INTEGER;
use winapi::um::fileapi::{GetFileInformationByHandle, BY_HANDLE_FILE_INFORMATION};
use winapi::um::ioapiset::Dev... |
use crate::builtins::lookup_builtin;
use crate::exitstatus::ChildProcess;
#[cfg(unix)]
use crate::job::{add_to_process_group, make_foreground_process_group};
use crate::job::{Job, JOB_LIST};
use anyhow::{anyhow, bail, Context};
use cancel::Token;
use pathsearch::PathSearcher;
use shell_vm::{
Environment, IoEnvironm... |
#![windows_subsystem = "windows"]
#![feature(decl_macro, proc_macro_hygiene)]
use std::cmp;
use std::convert::TryFrom;
use std::fmt;
use std::io::Cursor;
use std::str::FromStr;
use std::string::ToString;
use std::sync::atomic::{AtomicU64, Ordering};
use std::thread;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
... |
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
use super::rpc::{RPCEvent, RPCMessage, RPC};
use futures::prelude::*;
use libp2p::core::identity::Keypair;
use libp2p::core::PeerId;
use libp2p::gossipsub::{Gossipsub, GossipsubConfig, GossipsubEvent, Topic, TopicHash};
use libp2p::identif... |
// Copyright (c) 2016-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
//
// Unl... |
#[cfg(test)]
mod datadriven_test;
use crate::get_dirs_or_file;
use crate::test_data::TestData;
use crate::test_data_reader::TestDataReader;
use anyhow::Result;
use regex::Regex;
use std::fs;
use std::fs::OpenOptions;
use std::io::Write;
use std::path::Path;
use lazy_static::lazy_static;
use similar_asserts::assert_eq... |
use std::{fmt, fmt::Display};
use std::collections::HashMap;
use std::default::Default;
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use network_messages::MessageType;
use network_primitives::protocol::Protocol;
use crate::connection::connection_info::ConnectionState;
use crate::connection::con... |
// Copyright (c) 2017 <NAME>
//
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, ... |
use gjson::Value as gjValue;
use nu_errors::ShellError;
use nu_protocol::{TaggedDictBuilder, UntaggedValue, Value};
use nu_source::{Tag, Tagged};
pub struct QueryJson {
pub query: String,
pub tag: Tag,
}
impl QueryJson {
pub fn new() -> QueryJson {
QueryJson {
query: String::new(),
... |
use clap::{App, Arg, ArgMatches, SubCommand};
use futures::{Future, Stream};
use futures::future::{self, result};
use reqwest::header::{ContentType, Connection};
use reqwest::unstable::async::{Client as ReqwestClient};
use serde_json;
use tokio_core;
use config::CeresConfig as Config;
use run_config::RunConfig;
use mo... |
// Copyright Materialize, Inc. and contributors. 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 ... |
mod button;
mod axis;
mod state;
mod device;
mod power;
use state::GamepadState;
pub use button::GamepadButton;
pub use axis::GamepadAxis;
pub use device::{GamepadId, GamepadDevice};
pub use power::PowerInfo;
use crate::error::{GameError, GameResult};
use crate::event::KeyAction;
use gilrs::{Gilrs, GilrsBuilder, Eve... |
use bytes::Bytes;
use futures::{FutureExt, SinkExt};
use http::{Request, StatusCode, Uri};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use serde_json::json;
use crate::{
config::{
log_schema, AcknowledgementsConfig, GenerateConfig, Input, SinkConfig, SinkContext,
SinkDescription... |
#![no_std]
#![no_main]
#![feature(alloc_error_handler)]
#![feature(llvm_asm)]
#![feature(global_asm)]
#![allow(unused)]
extern crate xs_hal;
extern crate alloc;
#[cfg(not(test))]
use core::alloc::Layout;
use core::panic;
#[cfg(not(test))]
use core::panic::PanicInfo;
use buddy_system_allocator::LockedHeap;
use riscv::... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.