text stringlengths 3.09k 13.9k |
|---|
use crypto::buffer::{ReadBuffer, WriteBuffer};
use crypto::{
aes, hmac::Hmac, pbkdf2::pbkdf2, sha2::Sha256, symmetriccipher::SymmetricCipherError,
};
use derive_more::{Display, From};
use log::*;
use rusqlcipher::Connection;
use serde_derive::*;
use std::io::Write;
use structopt::*;
#[derive(Debug)]
struct Identit... |
//! Implements the functionality to enable conversion between a struct type a map container type
//! in Rust through the use of a procedural macros.
#![recursion_limit = "128"]
extern crate proc_macro;
use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::quote;
use syn::{Data, DeriveInput, Fields, Ident, T... |
use super::{enums::StringLikeType, traits::CodeGenerator};
use convert_case::{Case, Casing};
use proc_macro2::{Ident, TokenStream};
use quote::{format_ident, quote};
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
#[serde(deny_unknown_fields, default)]
/// HTTP URL 查询请求参数信... |
use std::collections::{HashMap, HashSet, BTreeMap};
use std::cmp::{Ord, Ordering};
use cgmath::{Rad};
use core::object::{ObjectId};
use core::unit::{UnitId};
use core::sector::{SectorId};
use types::{WorldPos};
use mesh::{MeshId};
#[derive(PartialOrd, Ord, PartialEq, Eq, Hash, Clone, Copy, Debug)]
pub struct NodeId{pu... |
use aoc_runner_derive::{aoc, aoc_generator};
use std::{collections::HashMap, str::FromStr};
/// Source for a wire value
#[derive(Debug)]
pub enum Source {
/// Source is the value of another wire
Wire(String),
/// Source is a raw numeric value
Raw(u16),
}
impl FromStr for Source {
type Err = Strin... |
/* origin: FreeBSD /usr/src/lib/msun/src/s_expm1.c */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freel... |
// Copyright 2021. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclai... |
//! Remote Procedure Calls
//! Copyright (c) 2018-2021 Iqlusion Inc. (licensed under the Apache License, Version 2.0)
//! Modifications Copyright (c) 2021, Foris Limited (licensed under the Apache License, Version 2.0)
use crate::error::{Error, ErrorKind};
use anomaly::{fail, format_err};
use prost::Message as _;
use ... |
use itertools::Itertools;
use std::cell::RefCell;
use std::collections::VecDeque;
use std::sync::mpsc::{channel, Sender};
type Message = (usize, i32);
pub struct IntCodeComputer {
memory: RefCell<Vec<i32>>,
input: RefCell<VecDeque<i32>>,
output: RefCell<VecDeque<i32>>,
pointer: usize,
pub running:... |
#![cfg_attr(not(feature = "std"), no_std)]
use frame_support::codec::{Decode, Encode};
use frame_support::{
decl_error, decl_event, decl_module, decl_storage, ensure, traits::Get,
};
use frame_system::ensure_signed;
use sp_runtime::traits::{Zero, StaticLookup};
use sp_std::prelude::*;
#[cfg(test)]
mod mock;
#[cf... |
// 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... |
pub trait Dsp: Send + Sync {
fn process(&mut self, sample: &mut f32, c: usize);
fn set_mix(&mut self, mix: f32);
fn set_bypass(&mut self, bypass: bool);
fn set_param_transition(&mut self, v: f32);
}
#[derive(Copy, Clone)]
pub enum BiQuadType {
Peaking(f32),
LowPass,
HighPass,
}
pub struct ... |
use std::iter::FromIterator;
use serde_json;
use super::genesis::PoolTransactions;
use super::handlers::{
build_pool_catchup_request, build_pool_status_request, handle_catchup_request,
handle_consensus_request, handle_full_request, handle_status_request, CatchupTarget,
};
use super::pool::Pool;
use super::req... |
use crate::proc_macro::TokenStream;
use quote::{format_ident, quote};
use syn;
#[derive(Default)]
struct Config {
pub getter_type: String,
pub field: String,
pub field_container_name: String,
pub parent_field: String,
pub return_type: String,
}
pub fn impl_id_getters(ast: &syn::DeriveInput) -> syn... |
//! Test suite for the Web and headless browsers.
#![cfg(target_arch = "wasm32")]
extern crate libenchcrack;
use libenchcrack::manipulation::*;
use libenchcrack::utils::SimpleRandom;
use libenchcrack::*;
use std::num::Wrapping;
use std::panic;
use wasm_bindgen_test::*;
use web_sys::console;
pub struct Timer<'a> {
... |
use super::{AppDetails, Error, ErrorDetails, Result};
use std::marker::PhantomData;
/// Simple reader state for extracting data from a [`&[u8]`] slice.
///
/// Unlike the [`std::io::Read`] implementation for [`&[u8]`], this keeps track of the location
/// within the packet for more informative errors via [`Result`].
/... |
use crate::bsdf::{Bsdf, random_sample_dir_from_onb_phi_theta, random_sample_dir_from_onb_xyz};
use crate::color::LinearRGB;
use crate::intersection::ShadingIntersection;
use crate::material::MaterialInteraction;
use crate::math::{Scalar, ScalarConsts};
use crate::ray::Ray;
use crate::sample::Sampler;
use crate::scene::... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
//! This sub module provides different KV alternatives for context persistence
use std::str::FromStr;
use std::{
convert::{TryFrom, TryInto},
num::NonZeroUsize,
};
use serde::{Deserialize, Serialize};
use ... |
use serde::{Deserialize, Serialize};
use std::fs;
use std::env;
use lazy_static::lazy_static;
use reqwest::header::{CONTENT_TYPE, DATE};
use reqwest::header::{HeaderMap, HeaderName, HeaderValue};
use crypto::sha1::Sha1;
use crypto::hmac::Hmac;
use crypto::mac::Mac;
use chrono::prelude::*;
use crate::utils::url_encode;
... |
extern crate alloc;
use alloc::sync::Arc;
use crate::edge_config::role::Role;
use crate::{
httpd::registry::*,
httpd::*,
io,
mutex::*,
ota::{self, OtaRead, OtaSlot, OtaUpdate},
};
use super::*;
pub fn register<R, MO, MS, MP, O, S, EO, ES>(
registry: R,
pref: &str,
ota: Arc<MO>,
o... |
use amq_protocol::frame::AMQPFrame;
use log::trace;
use parking_lot::Mutex;
use std::{
collections::{HashMap, VecDeque},
sync::Arc,
};
use crate::{
channel::Reply,
channel_status::ChannelState,
id_sequence::IdSequence,
wait::{Cancellable, Wait, WaitHandle},
Error,
};
pub(crate) type SendI... |
// Copyright 2017-2018 by <NAME>.
// Licensed under the MIT License <https://opensource.org/licenses/MIT>
use super::Result;
use serde_yaml::from_str;
use std::env::current_dir;
use std::fs::File;
use std::io::prelude::*;
/// The YAML configuration file name (`.changelog.yml`).
///
/// The library looks for a file wi... |
use std::ops::Deref;
use chrono::{DateTime, NaiveDateTime, Utc};
use diesel::{delete, insert_into, prelude::*, update};
use rocket::http::Status;
use validator::Validate;
use super::super::super::super::{
errors::{Error, Result},
graphql::{context::Context, H},
orm::schema::forum_posts,
rfc::UtcDateTi... |
pub mod csv;
pub(crate) mod fork;
pub mod ipc;
pub mod json;
#[cfg(feature = "parquet")]
#[doc(cfg(feature = "parquet"))]
pub mod parquet;
use crate::prelude::*;
use arrow::{
csv::Reader as ArrowCsvReader, error::ArrowError, error::Result as ArrowResult,
json::Reader as ArrowJsonReader, record_batch::RecordBat... |
// Copyright 2017 <NAME>
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or http://apache.org/licenses/LICENSE-2.0> or the
// MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. This file may not be copied,
// modified, or distributed except according to those terms.
... |
/*
WebServe (Rust port)
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 w... |
use libc::size_t;
use std::ptr;
use super::body::*;
use super::super::common::math::*;
use super::super::common::settings::*;
use super::super::particle::particle_system::*;
use super::joints;
pub enum B2World {}
extern {
fn b2World_CreateBody(world: *mut B2World, bd: *const BodyDef) -> *mut B2Body;
... |
//! # asm, the module that provides structures that represent assembly instructions
use alloc::{
collections::BTreeMap,
string::{String, ToString},
};
use core::fmt;
use spin::Mutex;
/// This is the stack size that is used if the assembly file
/// does not specify one.
pub const DEFAULT_STACK_SIZE: usize = 25... |
// < begin copyright >
// Copyright <NAME> 2020
//
// See root directory of this project for license terms.
//
// < end copyright >
use crate::models::*;
use std::fs;
use std::convert::{TryFrom, TryInto};
mod neural_network;
fn clip(inp: u64, prefix: u64) -> usize {
let mask: u64 = (1 << prefix) - 1;
let va... |
// 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 in the LICENSE-APACHE file or at:
// https://www.apache.org/licenses/LICENSE-2.0
//! Custom version of [`syn`] fields types supporting initi... |
/*
* Copyright 2018-2020 TON DEV SOLUTIONS LTD.
*
* 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 "AS IS" BASI... |
pub mod tick;
use core::panic;
use laria_log::*;
use std::{array, str::Utf8Error};
use thiserror::Error;
use crate::{stack_frame::StackFrame, subroutine::Subroutine, value::Value, Flags, Script};
#[derive(Clone, Debug)]
pub enum VMStatus {
Running,
Return(Value),
Halted,
}
#[derive(Clone, Debug, Error)]... |
use proc_macro::TokenStream;
use quote::{format_ident, quote, ToTokens};
use syn::{
parse_macro_input, punctuated::Punctuated, token::Comma, AngleBracketedGenericArguments,
Attribute, Data, DataStruct, DeriveInput, Field, Fields, FieldsNamed, GenericArgument, Ident,
Lit, Meta, MetaNameValue, NestedMeta, Pat... |
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct CrossOrderCancelRequest {
/// MsgType = u
#[serde(flatten)]
pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'u', ' '>,
/// Unique identifier of most recent ... |
use std::{fmt, process, str, path::Path};
use failure::Fail;
pub use std::process::{
Stdio,
ExitStatus,
Output,
ChildStdin as Stdin,
ChildStdout as Stdout,
ChildStderr as Stderr,
};
// TODO: a lot of this stuff needs rethought
// For example which of the existing types in
// std::process we s... |
use std::{
fmt::Debug,
ops::{Deref, DerefMut},
};
// TODO don't think this is a great design... maybe we need a `Register` struct for a single
// register.
#[derive(Default)]
pub(super) struct Registers {
pub(super) af: Register,
pub(super) bc: Register,
pub(super) de: Register,
pub(super) hl: ... |
//!
//! Controls harvester creeps
//!
use log::*;
use screeps::prelude::*;
use screeps::{find};
use screeps::{Creep, HasStore, ResourceType, ReturnCode, Source, SpawnOptions, StructureSpawn};
use screeps::memory;
use crate::util;
use crate::metrics;
use crate::source;
use super::types::{BasicHarvester, CreepInfo};
... |
use std::io::Cursor;
use byteorder::{WriteBytesExt, ReadBytesExt, BigEndian};
//mod error;
use error::QuicError;
use error::Result;
use std::io::Read;
#[derive(Debug, PartialEq, Clone)]
pub struct StreamFrame {
pub fin: bool,
pub data_length_present: bool,
pub data_length: Option<u16>,
pub stream_id: ... |
use super::{Addr, MemoryArena};
use common::is_power_of_2;
use std::mem;
const MAX_BLOCK_LEN: u32 = 1u32 << 15;
const FIRST_BLOCK: u32 = 4u32;
#[inline]
pub fn jump_needed(len: u32) -> Option<usize> {
match len {
0...3 => None,
4...MAX_BLOCK_LEN => {
if is_power_of_2(len as usize) {
... |
use bevy::prelude::*;
use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin};
use rand::prelude::*;
use std::collections::HashMap;
use std::collections::HashSet;
const CELL_SIZE: i32 = 10;
const INITIAL_GRID_DIM: i32 = 64;
struct Materials {
cell_material: Handle<ColorMaterial>,
}
struct Game... |
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::error::bad_resource_id;
use crate::error::type_error;
use crate::error::AnyError;
use crate::gotham_state::GothamState;
use crate::resources::ResourceTable;
use crate::runtime::GetErrorClassFn;
use crate::BufVec;
use crate::ZeroCopyB... |
use crate::deps::{
anyhow::Error,
gameoflife,
serde::{
Deserialize,
Serialize,
},
wasm_bindgen::{
JsCast,
JsValue,
},
web_sys::{
CanvasRenderingContext2d as RenderingContext,
HtmlCanvasElement,
},
yew::{
format::{
Bi... |
use crate::how::AnyResult;
use crate::state::AppStateRaw as State;
use crate::sqlx::{Done, Executor};
use reqwest::Client;
use std::net::SocketAddr;
use std::{collections::HashMap as Map, time::Duration};
use tokio::task::spawn;
use tokio::time::delay_for as sleep;
pub const KEEP_CORE: &str = "keep_core";
pub const K... |
use std::collections::HashMap;
use std::rc::Rc;
use crate::atn_state::ATNState;
use crate::atn_state::ATNStateRef;
use crate::atn_type::ATNType;
use crate::dfa::ScopeExt;
use crate::interval_set::IntervalSet;
use crate::lexer_action::LexerAction;
use crate::ll1_analyzer::LL1Analyzer;
use crate::parser_rule_context::Pa... |
use c_ares::{self, AResults};
use std::borrow::Cow;
use std::fmt;
use std::io;
use std::net::{IpAddr, SocketAddr};
use std::sync::Arc;
use std::time::Duration;
use antidote::{Mutex, RwLock};
use futures::sync::oneshot;
use futures::{Async, Future, Poll};
use hyper::client::connect::Connected;
use net2::TcpBuilder;
us... |
// Copyright 2016 Google Inc. All rights reserved.
//
// 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... |
// Copyright 2018 <NAME> <<EMAIL>>
//
// 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 accordin... |
// Copyright 2013 The Servo Project Developers. 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 ... |
use super::{Error, Result};
use crate::proto::{
interval_aggregates_reply, total_aggregates_reply, AggregateFunction, Column, HookedCommit,
IntervalAggregatesReply, IntervalType, TotalAggregatesReply,
};
use ghss_tracing::log_event;
use rusqlite::{params, Connection, OpenFlags};
pub struct DB {
co... |
use std;
use std::collections::BTreeSet;
use std::error::Error;
use std::io::Write;
use std::rc::Rc;
use std::result::Result;
use serde_yaml;
use super::traits::{ConvertResult, Converter, ImportResult, Importer};
use crate::build::Val;
pub struct YamlConverter {}
impl YamlConverter {
pub fn new() -> Self {
... |
use crate::dataset::RankingDataset;
use crate::evaluators::SetEvaluator;
use crate::model::{DenseLinearRankingModel, ModelEnum, WeightedEnsemble};
use crate::randutil::shuffle;
use crate::FeatureId;
use crate::Scored;
use oorandom::Rand64;
use ordered_float::NotNan;
use rayon::prelude::*;
#[derive(Clone, Debug, Serial... |
extern crate clap;
extern crate portus;
extern crate portus_export;
extern crate slog;
use portus::ipc::Ipc;
use portus::lang::Scope;
use portus::{CongAlg, CongAlgBuilder, Datapath, DatapathInfo, DatapathTrait, Report};
use slog::{debug, warn};
use std::collections::HashMap;
#[derive(Clone, Copy)]
pub enum Constant {... |
#![allow(dead_code)]
mod cli;
mod encryption;
mod error;
mod logic;
mod secret;
mod x25519;
use crate::encryption::Scheme;
use crate::x25519::UserSecretKey;
use cli::Options;
pub use error::Error;
pub use secret::Secret;
use std::fs::File;
use std::path::{Path, PathBuf};
use std::str::FromStr;
use structopt::clap::{E... |
//Uses
use std::sync::mpsc;
use thiserror::Error;
use wgpu;
use winit::event::Event;
use winit::event_loop::ControlFlow;
use winit::event_loop::{EventLoop, EventLoopWindowTarget};
use winit::window::{Window, WindowBuilder};
pub use winit;
//WINDOW MANAGER EVENT DEFINITION
#[derive(Debug)]
enum EventLoopEvent {
Cr... |
use gfx::{self, Resources, CommandBuffer, ShaderSet, Factory, Rect, Slice, Encoder};
use gfx::pso::PipelineState;
use gfx::traits::FactoryExt;
use gfx::handle::Buffer;
use gfx::state::Rasterizer;
use gfx::format::*;
use super::{StyleInputs, Style, LightBlock, TransformBlock};
use ::mesh::{Primitive, VertNTT};
use ::{L... |
//! This module provides the services for serving data.
//!
//! There are multiple such services and the [`Fetcher`] trait
//! provides a single unifying interface for all of these.
mod model;
mod round_parameters;
mod seed_dict;
mod sum_dict;
use std::task::{Context, Poll};
use async_trait::async_trait;
use futures... |
use crate::{cmd::get_cached_entry_by_name, compile, opts::forge::ContractInfo};
use eyre::{Context, ContextCompat};
use ethers::{
prelude::{
artifacts::Libraries, cache::SolFilesCache, ArtifactId, Project, ProjectCompileOutput,
},
solc::artifacts::{CompactContractBytecode, ContractBytecode, Contrac... |
use std::io::Read;
use mime::Mime;
use crate::model::{Category, Content, Entry, Feed, FeedType, Image, Link, Person, Text};
use crate::parser::util::{if_some_then, timestamp_rfc3339_lenient};
use crate::parser::{ParseFeedError, ParseFeedResult};
#[cfg(test)]
mod tests;
/// Parses a JSON feed into our model
pub(crat... |
use std::io;
use std::io::{Write};
use std::fs;
struct GameState {
dictionary : Vec<[char; 5]>,
correct_chars: [char; 5],
misplaced_chars: Vec<(usize, char)>,
incorrect_chars: Vec<char>,
current_guess: [char; 5]
}
fn main() {
let mut game_state = GameState {
dictionary: read_dictionary_from_file(),
correct... |
use anyhow::{format_err, Error};
use clomonitor_core::{
linter::{lint, LintOptions, Report, RepositoryKind},
score::{self, Score},
Linter,
};
use deadpool_postgres::{Client as DbClient, Transaction};
use std::time::Instant;
use std::{path::Path, str::FromStr};
use tempdir::TempDir;
use tokio::process::Comma... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license OR Apache 2.0
#![feature(nll)]
#![feature(async_closure)]
#![feature(backtrace)]
#![feature(label_break_value)]
#![allow(dead_code)]
#![warn(unused_imports)]
use anyhow::Result;
use clap::{App, Arg, SubCommand};
use snocat::util;
use std::{
pa... |
// This file is part of Substrate.
// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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
//
// ht... |
use blip_buf::BlipBuf;
use nes::{Cartridge, Machine, Region};
mod ui;
use ui::audio::{Audio, CpalAudio, Null as NullAudio};
use ui::sync::{FrameSync, NaiveSync};
use ui::window::{Window, WindowHandle};
use nes_ntsc::NesNtscSetup;
use clap::{App, Arg, SubCommand};
use std::fs::File;
fn main() {
let args = Args... |
use crate::peer::{MsgForSystem, PeerChannels, PeerIndex, PeerTask, ResetEpoch};
use ntp_os_clock::UnixNtpClock;
use ntp_proto::{
ClockController, ClockUpdateResult, FilterAndCombine, NtpInstant, PeerSnapshot, SystemConfig,
SystemSnapshot,
};
use tracing::info;
use std::{error::Error, sync::Arc};
use tokio::syn... |
#![warn(clippy::all, missing_docs, trivial_casts, trivial_numeric_casts)]
//! Implementations of Java classes in pure Rust
//!
//! For interop with your old Java applications or the like
/// Implentations from `java.lang.Object`
///
/// Only consists of the `HashCode` trait, since the
/// other methods don't make sens... |
use error_chain::bail;
#[allow(unused_imports)]
use tracing::{debug, error, info, instrument, span, trace, warn, Level};
use crate::crypto::KeySize;
use crate::error::*;
use crate::spec::*;
use serde::{Deserialize, Serialize};
use super::*;
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct HelloMetadata {
... |
//! API in rcl/time.h
use std::os::raw::c_void;
use crate::*;
/// A single point in time, measured in nanoseconds since the Unix epoch.
pub type rcl_time_point_value_t = rcutils_time_point_value_t;
/// A duration of time, measured in nanoseconds.
pub type rcl_duration_value_t = rcutils_duration_value_t;
#[repr(u32)]... |
//! Doubly Connected Edge List structures
use std::cell::RefCell;
use std::rc::{Rc, Weak};
use crate::graph::Graph;
pub struct Edge {
pub id: usize,
pub start: usize,
pub end: usize,
pub twin: WeakEdge,
pub prev: WeakEdge,
pub next: WeakEdge,
pub face: Option<RcFace>,
}
#[derive(Debug)]... |
#![cfg(feature = "async-io")]
use super::{super::comp::WRITER_INVALID_STATE, Decompressor};
use crate::lz4f::{FrameInfo, Result};
use futures_lite::{ready, AsyncWrite};
use pin_project::pin_project;
use std::{
borrow::Cow,
fmt, io,
marker::Unpin,
pin::Pin,
task::{Context, Poll},
};
/// The [`Async... |
use std::cmp::Ordering;
use std::collections::HashMap;
use std::fmt;
use std::iter::FromIterator;
use std::ops::{Deref, DerefMut};
use log::debug;
use crate::class::Instance;
use crate::collection::btree::{BTreeRange, Collator};
use crate::collection::schema::Column;
use crate::error;
use crate::general::Map;
use cra... |
// Copyright (c) 2018, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of condition... |
use nalgebra_glm::{max2, min2, normalize, vec2, vec3, Mat4, Vec2, Vec3};
/// X+, X-, Y+, Y-, Z+, Z-
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum CubeFace {
Right,
Left,
Top,
Bottom,
Front,
Back,
}
impl From<CubeFace> for u32 {
fn from(face: CubeFace) -> Self {
match face {
... |
use std::fmt::Display;
use serde::{Deserialize, Serialize};
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub enum CanticleId {
None,
Canticle1,
Canticle2,
Canticle3,
Canticle4,
Canticle5,
Canticle6,
Canticle7,
Canticle8,
Canticle9,
Canticle10,
... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
access_path::{AccessPath, Accesses},
account_address::AccountAddress,
account_state_blob::AccountStateBlob,
byte_array::ByteArray,
event::EventHandle,
identifier::{IdentStr, Identifier},
languag... |
//! # HAL for the STM32F1 family of microcontrollers
//!
//! This is an implementation of the [`embedded-hal`] traits for the STM32F1 family of
//! microcontrollers.
//!
//! [`embedded-hal`]: https://crates.io/crates/embedded-hal
//!
//! # Usage
//!
//! ## Building an application (binary crate)
//!
//! A detailed usage... |
use crate::error::Error;
use crate::sass::Name;
use crate::variablescope::Scope;
use crate::{css, sass};
use lazy_static::lazy_static;
use std::collections::BTreeMap;
use std::sync::Arc;
use std::{cmp, fmt};
#[macro_use]
mod macros;
mod module;
mod color;
mod list;
mod map;
mod math;
mod meta;
mod selector;
mod strin... |
use std::borrow::Cow;
use std::cell::RefCell;
use std::rc::Rc;
use deno_core::error::type_error;
use deno_core::error::AnyError;
use deno_core::op;
use deno_core::ZeroCopyBuf;
use deno_core::{CancelFuture, Resource};
use deno_core::{CancelHandle, OpState};
use deno_core::{RcRef, ResourceId};
use serde::Deserialize;
u... |
// Copyright 2019 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.
//! This module defines a framework for using the crate::expectations module in
//! asynchronous situations, where you wish you detect the satisfiability o... |
// Copyright (c) 2019, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the "hack" directory of this source tree.
use ocamlrep::rc::RcOc;
use crate::{
lexable_token::{LexablePositionedToken, LexableToken},
lexable_trivia::LexableTr... |
// Copyright (c) 2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless r... |
use std::hash::{Hash, Hasher};
use futures_util::stream::StreamExt;
use serde_json::Value as SJsonValue;
use ursa::bls::Generator;
use crate::common::error::prelude::*;
use crate::config::constants::DEFAULT_GENERATOR;
use crate::state_proof::{check_state_proof, result_without_state_proof, BoxedSPParser};
use crate:... |
// Copyright 2014 The Gfx-rs Developers.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
//! Bit Manipulation Instruction (BMI) Set 2.0.
//!
//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
//! Manual Volume 2: Instruction Set Reference, A-Z][intel64_ref].
//!
//! [Wikipedia][wikipedia_bmi] provides a quick overview of the instructions
//! available.
//!
//! [intel64_ref]: http:/... |
use rand_core::impls::fill_bytes_via_next;
use rand_core::le::read_u64_into;
use rand_core::{Error, RngCore, SeedableRng};
/// A xoshiro256++ random number generator.
///
/// The xoshiro256++ algorithm is not suitable for cryptographic purposes, but
/// is very fast and has excellent statistical properties.
///
/// Th... |
#![allow(unused_imports)]
extern crate console_error_panic_hook;
use wasm_bindgen::prelude::*;
extern crate maths; use maths::{ Math, mat4::*, quat::*, vec3::*, color::* };
extern crate ecs; use ecs::{ Ecs, IStorage };
#[macro_use]
mod wasm; use wasm::{ glctx, Buffer, Vao, VaoCache, Shader, ShaderCache, UniformT... |
use std::io::{self, BufRead};
use std::vec;
use std::{fs::File, path::Path};
fn main() {
let basic_map = vec![
vec![0, 1, 2, 4, 5, 6], // 0
vec![2, 5], // 1 unique
vec![0, 2, 3, 4, 6], // 2
vec![0, 2, 3, 5, 6], // 3
vec![1, 2, 3, 5], //... |
use std::env;
use std::fs;
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() < 2 {
println!("filename arg is required");
return;
}
let filename = &args[1];
println!("Reading file: {}", filename);
let contents = fs::read_to_string(filename).expect("error... |
use common;
use data_container::{Direction, Sort};
use rustorm::types::SqlType;
use rustorm::DbError;
use rustorm::Dao;
use rustorm::DaoManager;
use rustorm::Rows;
use rustorm::Table;
use rustorm::TableName;
use rustorm::Value;
use std::collections::BTreeMap;
use tab::Tab;
use table_intel;
pub struct Query {
sql: ... |
use parking_lot::Mutex;
use std::mem::size_of;
use crate::gc::swiper::controller::SharedHeapConfig;
use crate::gc::swiper::LARGE_OBJECT_SIZE;
use crate::gc::{Address, Region};
use crate::mem;
use crate::os;
pub struct LargeSpace {
total: Region,
space: Mutex<LargeSpaceProtected>,
config: SharedHeapConfig,... |
use std::{fmt, io::Read, str};
#[cfg(feature = "crypto")]
use crate::crypto;
use super::{error::InternalError, result::InternalResult, flags::Flags};
/// Used to configure and give extra information to the [`Archive`](crate::archive::Archive) loader.
/// Used exclusively in archive source and integrity validation.
#[... |
use crate::rendering::*;
use crate::{EmeraldError, Sound, SoundKey};
use miniquad::Context;
use std::collections::HashMap;
const INITIAL_TEXTURE_STORAGE_CAPACITY: usize = 100;
const INITIAL_FONT_STORAGE_CAPACITY: usize = 100;
// const INITIAL_SOUND_STORAGE_CAPACITY: usize = 100;
/// The AssetStore stores all Texture... |
// This is a modification of base32 encoding to support the zbase32 alphabet.
// The original piece of software can be found at https://github.com/andreasots/base32
// The original portions of this software are Copyright (c) 2015 The base32 Developers
/* This file is licensed under either of
* Apache License, Versio... |
use crate::common::CommandCraterExt;
use assert_cmd::prelude::*;
use difference::Changeset;
use rand::{self, distributions::Alphanumeric, Rng};
use serde_json::{self, Value};
use std::env;
use std::path::{Path, PathBuf};
use std::process::Command;
trait CommandMinicraterExt {
fn minicrater_exec(&mut self);
}
impl... |
use bevy::prelude::*;
use bevy_egui::{EguiContext, EguiPlugin, EguiSettings};
const BEVY_TEXTURE_ID: u64 = 0;
fn main() {
App::build()
.add_resource(ClearColor(Color::rgb(0.0, 0.0, 0.0)))
.add_resource(Msaa { samples: 4 })
.add_plugins(DefaultPlugins)
.add_plugin(EguiPlugin)
... |
use std::sync::mpsc::{Sender, Receiver};
use std::sync::mpsc;
use std::thread;
extern crate common;
extern crate os_info;
use std::net::TcpStream;
//use std::io::BufRead;
//use std::io::BufReader;
//use std::io;
use std::io::prelude::*;
extern crate configuration;
extern crate time;
extern crate datetime;
//use datetim... |
use crate::error;
use crate::plots::{Plot, PlotData, PlotMetaData};
use crate::primitives::{Measurement, TimeInstance};
use crate::util::Result;
use snafu::ensure;
pub struct AreaLineChart {
timestamps: Vec<TimeInstance>,
values: Vec<f64>,
measurement: Measurement,
draw_area: bool,
}
impl AreaLineChar... |
use acme_common::error::Error;
use serde::Deserialize;
use std::fmt;
use std::str::FromStr;
pub trait ApiError {
fn get_error(&self) -> Option<Error>;
}
#[derive(PartialEq)]
pub enum AcmeError {
AccountDoesNotExist,
AlreadyRevoked,
BadCSR,
BadNonce,
BadPublicKey,
BadRevocationReason,
B... |
use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::higher::VecArgs;
use clippy_utils::last_path_segment;
use clippy_utils::macros::root_macro_call_first_node;
use clippy_utils::paths;
use clippy_utils::source::{indent_of, snippet};
use clippy_utils::ty::match_type;
use rustc_errors::Applicability;
use... |
// Copyright 2019 The Epic Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
use pest::iterators::Pair;
use pest::Parser;
use std::io;
use super::ast;
use super::utils;
#[derive(Parser)]
#[grammar = "parser/grammar.pest"]
struct JFECParser;
fn parse_arg(arg_p: Pair<Rule>) -> Result<ast::Arg, io::Error> {
let mut iter = arg_p.into_inner();
let name = utils::next_string(&m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.