text stringlengths 3.09k 13.9k |
|---|
#![doc(html_root_url = "https://docs.rs/opener/0.5.0")]
//! This crate provides the [`open`] function, which opens a file or link with the default program
//! configured on the system:
//!
//! ```no_run
//! # fn main() -> Result<(), ::opener::OpenError> {
//! // open a website
//! opener::open("https://www.rust-lang.o... |
//! Prepares subtitles from given text.
use unicode_segmentation::UnicodeSegmentation; // 1.7.1
/// Split the entire file into *potential* subtitles.
pub fn split_into_subtitles(file_content: &str) -> Vec<String> {
let mut subtitle_list: Vec<String> = Vec::new();
let sentence_list: Vec<&str> = file_content.un... |
use super::json_file_finder::FoundJsonFile;
use crate::impl_prelude::*;
use crate::rc_string::RcString;
use crate::utils::json;
use std::collections::{HashMap, HashSet};
use std::convert::TryFrom;
pub static MAIN_LOCALE: &str = "en_US";
pub static KNOWN_BUILTIN_LOCALES: &[&str] =
&["en_US", "de_DE", "zh_CN", "zh_TW... |
//! Command line interface for resampling a snapshot to a regular grid.
use super::{
direct_sampling::create_direct_sampling_subcommand,
weighted_cell_averaging::create_weighted_cell_averaging_subcommand,
weighted_sample_averaging::create_weighted_sample_averaging_subcommand,
};
use crate::{
cli::{snap... |
// Zinc, the bare metal stack for rust.
// Copyright 2014 Vladimir "farcaller" Pouzanov <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/... |
//! Escape control characters.
//! 制御文字をエスケープします。
use chrono::Local;
use regex::Regex;
use std::process;
use std::sync::Mutex;
use std::thread;
lazy_static! {
/// Triple single quotation.
/// 3連シングル・クォーテーション。
static ref RE_TRIPLE_SINGLE_QUOTE: Mutex<Regex> = Mutex::new(Regex::new(r"'''").unwrap());
}
... |
//! A struct and trait and an instance of the auto-deref specialization trick for the purposes of
//! converting between Discord's autocomplete data and Rust types, in order to run the parameter
//! autocomplete callbacks
#[allow(unused_imports)] // required if serenity simdjson feature is enabled
use crate::serenity:... |
use alloc::boxed::Box;
use alloc::string::String;
use alloc::vec::Vec;
use core::any::Any;
use crate::rsp::rsp::RSP;
use crate::rsp::rsp_assembler::{E, Element, GPR, RSPAssembler, VR, VSARAccumulator};
use crate::rsp::spmem::SPMEM;
use crate::tests::{Level, Test};
use crate::tests::soft_asserts::soft_assert_eq;
fn ru... |
use crate::{DelegateLookup, Error::*, OwnerLookup, PortalRepository, TenantLookupT};
use codec::{Decode, Encode, EncodeLike};
use frame_support::{
ensure,
pallet_prelude::{Member, Parameter},
};
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_runtime::{traits::Dispa... |
use tokio_util::codec::{Decoder, Encoder};
use crate::framed_impl::{RWFrames, ReadFrame, UdpFramedImpl, WriteFrame};
use pin_project_lite::pin_project;
use tokio::net::UdpSocket;
use tokio_stream::Stream;
use bytes::BytesMut;
use futures_sink::Sink;
use std::{
borrow::Borrow,
fmt, io,
net::SocketAddr,
... |
//! This crate wraps [libkres](https://knot-resolver.cz) from
//! [CZ.NIC Labs](https://labs.nic.cz). libkres is an implementation of a full DNS recursive resolver,
//! including cache and DNSSEC validation. It doesn't require a specific I/O model and instead provides
//! a generic interface for pushing/pulling DNS mes... |
use std::cell::Cell;
mod pulse;
use pulse::{Counter, Pulse};
pub struct Apu {
pulse_1: Pulse,
pulse_2: Pulse,
noise: Noise,
triangle: Triangle,
dmc: Dmc,
frame_int: Cell<bool>,
counter: u16,
mode: Mode,
int_inhibit: bool,
}
#[derive(Debug, Copy, Clone)]
enum Mode {
Step4,
... |
// 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.
use {
failure::{format_err, Error, ResultExt},
fidl::endpoints,
fidl_fuchsia_io::{DirectoryMarker, MODE_TYPE_SERVICE},
fidl_fuchsia_sys2 as... |
use std::collections::VecDeque;
use std::env;
use std::fmt;
use std::fs::File;
use std::io;
use std::io::BufRead;
#[macro_use]
extern crate text_io;
fn main() {
let args = env::args().collect::<Vec<String>>();
if args.len() < 3 {
panic!("Not enough arguments")
}
let input_filename = &args[2];... |
extern crate ggez;
use ggez::event::{self, MouseButton, MouseState, Keycode, Mod};
use ggez::graphics::{self, Point2, Mesh, DrawParam, Color};
use ggez::{Context, GameResult, ContextBuilder, mouse};
extern crate hex_test;
use hex_test::{grid, HexShape, Orientation};
use grid::initializers::HexagonalCenteredGridIterat... |
use crate::number_theory::pow_mod;
use num::BigUint;
/// Berlekamp-Massey algorithm to find the minimal recurrence relation of a given sequence under a field.
///
/// Refer to [Wikipedia: Berlekamp-Massey algorithm](https://en.wikipedia.org/wiki/Berlekamp%E2%80%93Massey_algorithm) for basic information.
/// Assumes t... |
extern crate quickcheck;
#[macro_use(quickcheck)]
extern crate quickcheck_macros;
mod non_empty_string;
use chrono::prelude::*;
use non_empty_string::{
AppNameString, ArbitraryString, HostNameString, NameString, NoColonString, ProcIdString,
ValueString,
};
use quickcheck::{Arbitrary, Gen};
use syslog_loose::{... |
use crate::pairing::ff::{Field};
use crate::pairing::{Engine, CurveProjective};
use std::marker::PhantomData;
use super::{Proof, SxyAdvice};
use super::batch::Batch;
use super::poly::{SxEval, SyEval};
use super::parameters::{Parameters};
use crate::SynthesisError;
use crate::sonic::transcript::{Transcript, Transcrip... |
use std::cmp;
use std::error::Error;
use std::fs::File;
use std::io::{BufRead, BufReader};
#[macro_use]
extern crate scan_fmt;
const INFINITE:i32 = -1;
const UNVISITED:i32 = -1;
const SHARED:i32 = -2;
struct Coord {
x: i32,
y: i32
}
impl Coord {
pub fn manhattan(a:&Coord, b:&Coord) -> i32 {
(a.x... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00..0x10 - The memory that stores M"]
pub m_mem: [crate::Reg<m_mem::M_MEM_SPEC>; 16],
_reserved1: [u8; 0x01f0],
#[doc = "0x200..0x210 - The memory that stores Z"]
pub z_mem: [crate::Reg<z_mem::Z_MEM_SPEC>; 16],
_reserved... |
use rand::random;
use std::{
mem,
ops::{Index, IndexMut},
str::FromStr,
};
// [s, e, partial-header)
pub type RangeUnit = (u64, u64, String);
pub type RangeUnits = Vec<RangeUnit>;
#[derive(Default, Debug, Clone, PartialEq)]
pub struct RangesForm {
partail: bool,
boundary: u128,
ranges: RangeU... |
#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate serde_json;
mod argparser; // 引数解析
mod daemon; // デーモン処理
mod debounce; // 間引き処理
mod file; // I/O
mod lang; // 言語特定
mod snippet; // スニペット処理
mod watch; // 監視処理
use argparser::LaunchType;
use file::{open_file, FileReader};
use snippet::KeyList;
use... |
use std::option::Option::None;
use std::sync::Arc;
use std::time::Duration;
use anyhow::Result;
use maplit::btreeset;
use openraft::raft::AppendEntriesRequest;
use openraft::raft::InstallSnapshotRequest;
use openraft::Config;
use openraft::Entry;
use openraft::EntryPayload;
use openraft::LeaderId;
use openraft::LogId;... |
use crate::dialect::Dialect;
use crate::error::AoristError;
use crate::parameter_tuple::ParameterTuple;
use abi_stable::external_types::parking_lot::rw_lock::RRwLock;
use abi_stable::std_types::RArc;
use anyhow::Result;
use aorist_primitives::AOption;
use aorist_primitives::{AString, AVec, Ancestry, AoristConcept, TAor... |
//! This lib wraps svn command line tool on your system
#![warn(missing_docs)]
#![warn(unsafe_code)]
use std::result::Result;
mod cmd_wrapper;
mod errors;
mod sub_commands;
mod types;
pub use crate::{
errors::SvnError,
sub_commands::{
info::{EntryCommit, SvnInfo},
list::{ListEntry, ListsList, ... |
use std::marker::PhantomData;
use std::sync::Arc;
use failure::Fallible;
use shrev::{EventChannel, ReaderId};
use specs::prelude::*;
use utils::throw;
use vulkano::command_buffer::{AutoCommandBuffer, AutoCommandBufferBuilder, DynamicState};
use vulkano::framebuffer::Subpass;
use vulkano::instance::{Instance, PhysicalD... |
pub const NAME_PAGE_WIDTH: &str = "page-width";
pub const NAME_PAGE_HEIGHT: &str = "page-height";
pub const NAME_PAGE_SIZE: &str = "page-size";
pub const DEFAULT_PAGE_WIDTH: &str = "210mm";
pub const DEFAULT_PAGE_HEIGHT: &str = "297mm";
pub const DEFAULT_PAGE_SIZE: &str = "a4";
pub fn make_page_size_str(p: &Option<&s... |
use std::io::{self, Write as IoWrite};
use std::fmt;
use std::str::Chars;
use std::iter::Peekable;
use MathError::*;
use Token::*;
fn main() {
println!("Shunting Yard algorithm calculator, enter an expression to be evaluated.");
println!("Type `exit` to exit");
let mut input = String::new();
// let m... |
//! This module is used to convert a continuous second order differential equation into a discretized state space model
//!
//! December 9, 2021
//!
use nalgebra::{Matrix3, RowVector3, Vector3};
use num_complex::Complex;
use serde::Serialize;
use std::fmt;
const Z_CPLX: Complex<f64> = Complex { re: 0., im: 0. };
///... |
use chrono::{DateTime, Utc};
use log::trace;
use rust_decimal_macros::dec;
use serde::{Deserialize, Serialize};
use rust_decimal::prelude::*;
use crate::{
binance_signature::{append_signature, binance_signature, query_vec_u8},
common::{get_req_get_response, ResponseErrorRec},
common::{utc_now_to_time_ms, ... |
use crate::{
from_data,
tables::*,
};
#[cfg(not(target_arch = "wasm32"))]
use crate::atlas::*;
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize)]
pub struct FullTiling {
pub tiling: Tiling,
pub labels: Vec<Label>,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct FullTil... |
use serde::{Deserialize, Serialize};
use worker::*;
use crate::wasm_bindgen::JsValue;
use hmac::{Hmac, Mac};
use sha2::Sha256;
type HmacSha256 = Hmac<Sha256>;
mod utils;
fn log_request(req: &Request) {
console_log!(
"{} - [{}], located at: {:?}, within: {}",
Date::now().to_string(),
req.... |
#![allow(dead_code)]
mod utils;
pub use crate::utils::*;
// use gnuplot::*;
extern crate csv;
extern crate serde_json;
use serde::{Deserialize, Serialize};
use rayon::prelude::*;
use std::convert::TryInto;
use std::fs::File;
use std::io;
use std::io::{BufReader, BufWriter};
use std::path::Path;
extern crate struc... |
/***********************************************************************************************************************
* Mathematical function used by the Porous Absorber Calculation Engine
*
* (c) <NAME> 2020
*/
extern crate wasm_bindgen;
use libm::{fabs, pow, sqrt};
use num::complex::Complex;
use crate::confi... |
#![recursion_limit = "100"]
#![feature(box_patterns, proc_macro_hygiene)]
#![allow(dead_code)]
#![allow(non_camel_case_types)]
use std::collections::HashSet;
use std::rc::Rc;
pub mod parser;
#[macro_use]
pub mod grammar;
use ctoken::token::Token;
use fragment::fragment::{FragmentIterator, Source};
use preprocessor::... |
use primitives::{AuthorityId, ed25519};
use template_node_runtime::{
AccountId, GenesisConfig, ConsensusConfig, TimestampConfig, BalancesConfig, UpgradeKeyConfig,
DemocracyConfig, GrandpaConfig, SessionConfig, StakingConfig, TreasuryConfig, Permill, Perbill
};
use substrate_service;
// Note this is the URL for the t... |
use super::parse::*;
use std::{
borrow::Cow,
cmp::Ordering,
fmt,
hash::{Hash, Hasher},
iter,
};
/// A media-type parameter value.
///
/// The constructor accepts both an unquoted string and a quoted string like `"Hello Wold!"`.
/// If the string is not quoted, the allowed characters are
/// alphabe... |
//! Parses the `[package.metadata.rtic-scope]` and
//! `[workspace.metadata.rtic-scope]` blocks from the RTIC application
//! manifest for persistent RTIC Scope options. Some options can be
//! supplied/overridden via command-line options.
use crate::build::CargoWrapper;
use crate::diag;
use crate::ManifestOptions;
us... |
use std::{
fmt::Display,
iter::repeat,
num::ParseIntError,
slice::{ChunksExact, ChunksExactMut},
str::FromStr,
};
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub struct GridIndex(pub usize, pub usize);
impl Display for GridIndex {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::f... |
// Copyright 2020 Twitter, Inc.
// Licensed under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
use std::io::{Error, ErrorKind, Write};
use mio::net::TcpStream;
use rustcommon_buffer::*;
use rustls::ServerSession;
use rustls::Session as TlsSession;
use crate::*;
#[allow(dead_code)]
/... |
use std::collections::HashMap;
use std::collections::HashSet;
use std::path::Path;
use std::path::PathBuf;
use crossbeam::queue::SegQueue;
use walkdir::WalkDir;
use crate::commit::{self, Commit};
use crate::run::RunLoader;
const EVENT_FILE_BASENAME_INFIX: &'static str = "tfevents";
const LOADER_THREAD_COUNT: usize ... |
/*!
[](https://docs.rs/wasm-snip/) [](https://crates.io/crates/wasm-snip) [](https://crates.io/crates/wasm-snip) [>) -> HashMap<String, ModDefinition> {
let mut hash_map = HashMap::new();
for (path, mod_lines) in mods {
let mut mod_definition: ModDefinitio... |
extern crate nanovg;
extern crate sdl2;
extern crate sdl2_sys;
use std::rc::{Rc, Weak};
use std::cell::RefCell;
use self::sdl2::keyboard::{Mod, Scancode};
use self::sdl2::mouse::Mouse;
use self::sdl2_sys::keycode::SDL_Keymod;
use common::Cursor;
use widget::{Widget, WidgetObj};
use theme::Theme;
use layout::Layout;
us... |
use std::cmp::Reverse;
use std::collections::BinaryHeap;
use std::collections::HashSet;
use std::io::BufRead;
use std::io::BufReader;
use std::io::Read;
use itertools::Itertools;
use regex::Regex;
use common::Solution;
type Coordinate = (usize, usize);
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Copy, Clone, De... |
use std::ffi::{CString, OsStr, OsString};
use std::os::unix::ffi::OsStrExt;
use std::path::{Path, PathBuf};
use nix::unistd;
use super::errors::*;
#[test]
fn test_privdrop() {
if unistd::geteuid().is_root() {
PrivDrop::default()
.chroot("/var/empty")
.user("nobody")
.a... |
use std::fs::File;
use std::io::Read;
use std::path::Path;
use std::sync::Arc;
use bvh::bvh::BVH;
use indicatif::ProgressBar;
use nalgebra::{Point3, Vector3};
use tobj::Mesh;
use yaml_rust::YamlLoader;
use lights::area::AreaLight;
use lights::distant::DistantLight;
use lights::point::PointLight;
use lights::Light;
us... |
//! The xdg_wm_base interface is exposed as a global object enabling clients to turn
//! their wl_surfaces into windows in a desktop environment. it defines the basic
//! functionality needed for clients and the compositor to create windows that can
//! be dragged, resized, maximized, etc, as well as creating transient... |
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
use std::ops::Deref;
use std::ops::DerefMut;
use std::ops::Range;
use std::rc::Rc;
use super::rawbytes;
use super::transl8::FromV8;
/// A V8Slice encapsulates a slice that's been borrowed from a JavaScript
/// ArrayBuffer object. JavaScript o... |
// so the idea was to store bloom of all ancestors in each node
// so we could easily bit-check if any of the dirty nodes was
// an ancestor of some other node and this way sort-of quickly figure
// out what needs to be re-evaluated (because of inherited props)
//
// I thought it would be a good trick because bloom is ... |
// Copyright 2021 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0
use super::generated_ops::psa_sign_message::{Operation as OperationProto, Result as ResultProto};
use crate::operations::psa_sign_message::{Operation, Result};
use crate::requests::ResponseStatus;
use log::error;
use std::conve... |
use crate::bitmaps::{BitmapImage, Texture2d, TextureRect};
use crate::{Point, Rect, Size};
use anyhow::{ensure, Result as Fallible};
use std::rc::Rc;
use thiserror::*;
pub const TEX_SIZE: u32 = 4096;
const PADDING: usize = 1;
#[derive(Debug, Error)]
#[error("Texture Size exceeded, need {}", size)]
pub struct OutOfTex... |
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
use byteorder::{BigEndian, ByteOrder};
use forest_encoding::{
de::{Deserialize, Deserializer},
ser::{Serialize, Serializer},
serde_bytes,
};
use std::u64;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Bitfield([u64; 4]);
... |
use bevy_ecs::prelude::{Component, ReflectComponent};
use bevy_reflect::Reflect;
type LayerMask = u32;
/// An identifier for a rendering layer.
pub type Layer = u8;
/// Describes which rendering layers an entity belongs to.
///
/// Cameras with this component will only render entities with intersecting
/// layers.
/... |
use std::ops::{Bound, Range, RangeBounds};
use delegate::delegate;
use wasm_bindgen::UnwrapThrowExt;
use crate::cssom::TextWrap;
use crate::dom::{impl_try_from_element, SelectionDirection};
use crate::html::{
constraint_validation_target_seal, form_listed_element_seal, impl_extendable_element,
impl_html_eleme... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
access_path::AccessPath,
account_address::AccountAddress,
account_config::CORE_CODE_ADDRESS,
event::{EventHandle, EventKey},
};
use anyhow::{format_err, Result};
use move_core_types::{
ident_str,
ide... |
//! A forest of B+-trees.
//!
//! This module provides a data structures representing a set of small ordered sets or maps.
//! It is implemented as a forest of B+-trees all allocating nodes out of the same pool.
//!
//! **These are not general purpose data structures that are somehow magically faster that the
//! stand... |
use std::cmp;
use crate::ParserContext;
use wa1_ast::prelude::*;
use wa1_types::prelude::*;
pub use wa1_errs::Error;
pub use wa1_errs::prelude::*;
fn try_get_local_variable(expr: &TypedExpr) -> Option<String> {
match &expr.expr {
Expr::LocalVariableUse(name) => {
Some(name.clone())
}... |
use std::collections::HashMap;
use std::sync::Arc;
use anyhow::{anyhow, ensure, Result};
use async_trait::async_trait;
use bitvec::prelude::*;
use interface::{FacetResponse, Hit, MetadataList, Query, QueryResponse};
use crate::node::store::iface::{DynDocumentIDStore, DynMetadataStore, DynStorageMappingStore};
pub... |
mod message_queue_data;
use std::convert::{TryFrom, TryInto};
use std::sync::Arc;
use anyhow::*;
use liblumen_alloc::erts::exception::Alloc;
use liblumen_alloc::erts::process::alloc::{default_heap_size, heap, next_heap_size};
use liblumen_alloc::erts::process::priority::Priority;
use liblumen_alloc::erts::process::P... |
use super::utils;
use clap::ArgMatches;
use std::fs;
use std::process;
fn start_raw_syscall_logging(trace_setting_path: &str) {
disable_raw_syscall_all(trace_setting_path);
enable_raw_syscall_all(trace_setting_path);
}
fn disable_raw_syscall_all(trace_setting_path: &str) {
let syscall_enable = format!("{}... |
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
use std;
pub type SupportedInputConfigs = std::vec::IntoIter<SupportedStreamConfigRange>;
pub type SupportedOutputConfigs = std::vec::IntoIter<SupportedStreamConfigRange>;
use super::parking_lot::Mutex;
use super::sys;
use std::hash::{Hash, Hasher};
use std::sync::Arc;
use BackendSpecificError;
use DefaultStreamConfig... |
use std::str::FromStr;
use bigdecimal::BigDecimal;
use num::{bigint::ToBigInt, rational::Ratio, BigUint};
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use crate::convert::*;
#[derive(Clone, Debug)]
pub struct UnsignedRatioSerializeAsDecimal;
impl UnsignedRatioSerializeAsDecimal {
pub fn ser... |
use pyo3::{
prelude::*,
PyObjectProtocol,
types::PyDict
};
use python_utils::{
self,
py_repr,
// rc_wrapper_type,
// wrapper_type,
wrapper_type,
get_from_kwargs
};
use fp::vector::FpVectorT;
use python_fp::vector::FpVector;
use python_fp::prime::new_valid_prime;... |
use ra_parser::{TokenSource, Token};
use ra_syntax::{classify_literal, SmolStr, SyntaxKind, SyntaxKind::*, T};
use std::cell::{RefCell, Cell};
use tt::buffer::{TokenBuffer, Cursor};
#[derive(Debug, Clone, Eq, PartialEq)]
struct TtToken {
pub kind: SyntaxKind,
pub is_joint_to_next: bool,
pub text: SmolStr,
... |
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//! RSA, a public-key encryption algorithm.
#[cfg(doc)]
use std::convert::Infallible;
/// A length for the modulus of an RSA public key.
#[derive(Clone, Copy, PartialE... |
//
// Copyright (C) 2018 Kubos Corporation
//
// 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 std::fs::File;
use std::io::{prelude::*, stdin};
use std::path::PathBuf;
use std::str::FromStr;
use clap::Parser;
use vaporetto::{BoundaryType, CharacterType, Model, Predictor, Sentence};
use vaporetto_rules::{
sentence_filters::{ConcatGraphemeClustersFilter, KyteaWsConstFilter},
string_filters::KyteaFullw... |
//! Object model of the UniprotKB XML database.
//!
//! The model was derived from the latest [Uniprot XML schema], with some
//! small changes to make the type hierarchy fit with the Rust conventions.
//!
//! [Uniprot XML schema]: https://www.uniprot.org/docs/uniprot.xsd
pub mod comment;
pub mod feature_location;
pub... |
#![deny(clippy::all, clippy::pedantic)]
#![deny(warnings, intra_doc_link_resolution_failure)]
#![doc(deny(warnings))]
use fs_extra::dir::{self, CopyOptions};
use std::env;
use std::path::PathBuf;
use std::process::Command;
/// vendored mruby version
const MRUBY_REVISION: &str = "bc7c5d3";
/// Path helpers
struct Bui... |
//! Module providing the TermLogger Implementation
use log::{
set_boxed_logger, set_max_level, Level, LevelFilter, Log, Metadata, Record, SetLoggerError,
};
use std::error;
use std::fmt;
use std::io::{Error, Write};
use std::sync::Mutex;
use termcolor;
use termcolor::{StandardStream, ColorChoice, WriteColor, Color... |
use crate::time_date::{
parse_datetime_rfc822, parse_duration_from_str, serialize_option_datetime, DurationFormator,
};
use chrono::offset::Utc;
use chrono::DateTime;
use reqwest::Url;
use serde::Serializer;
use std::convert::{TryFrom, TryInto};
use std::str::FromStr;
#[derive(Debug, serde::Serialize)]
#[serde(ren... |
// surfman/surfman/src/platform/unix/wayland/connection.rs
//
//! A wrapper for Wayland connections (displays).
use crate::Error;
use crate::egl::types::{EGLAttrib, EGLDisplay};
use crate::egl;
use crate::platform::generic::egl::device::EGL_FUNCTIONS;
use crate::platform::generic::egl::ffi::EGL_PLATFORM_WAYLAND_KHR;
u... |
use super::error::Error;
use super::{sdmmc_cmd, CardInfo, CardType, Sd};
use crate::gpio::InputPin;
use stm32f7::stm32f7x6::{RCC, SDMMC1};
/// Initializes the SD Card, if it is inserted and not already initialized. If the card is already
/// initialized this function does nothing and returns no error.
///
/// # Errors... |
use cgmath::Point2;
use genmesh::{generators::{IndexedPolygon, Plane, SharedVertex}, Triangulate, Vertices};
use specs::prelude::{Read, ReadStorage, WriteStorage};
use crate::character::controls::CharacterInputState;
use crate::game::constants::{ASPECT_RATIO, TILE_SIZE, TILES_PCS_H, TILES_PCS_W, VIEW_DISTANCE};
use cr... |
use crate::cartesian::*;
use crate::physics::*;
pub type Commands = Vec<ControlCmd>; // cap: GENOME_SIZE
pub type Trajectory = Vec<LanderState>; // cap: GENOME_SIZE
pub type ControlCmdBuilder = Box<dyn Fn(usize) -> ControlCmd>;
#[derive(Copy, Clone, PartialEq, Default, Debug)]
pub struct ControlCmd {
pub power:... |
// Copyright (c) 2016 The vulkano developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be ... |
mod proposer_block;
mod transaction;
mod voter_block;
use crate::block::{Block, Content};
use crate::blockchain::BlockChain;
use crate::blockdb::BlockDatabase;
use crate::config::*;
use crate::crypto::hash::{Hashable, H256};
use crate::crypto::merkle::verify;
extern crate bigint;
/// The result of block validation.
#[... |
use std::rc::Rc;
use glow::{HasContext, PixelPackData};
use half::f16;
use nalgebra::Vector2;
use thiserror::Error;
use crate::gl::TextureValueType;
use super::{Context, NewTextureError, Texture};
#[derive(Error, Debug)]
pub enum NewFramebufferError {
#[error("GL error: {0}")]
OpenGL(#[from] super::Error),
... |
#![feature(once_cell)]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
use std::io;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::{env, future::Future};
use runtime::ch::protocol::ConnCtx;
use runtime::ch::{
codecs::{BytesExt, CHMsgWriteAware},
prot... |
// Copyright 2021 <NAME>
// SPDX-License-Identifier: Apache-2.0
use crate::{
discovery::messages::{DiscoveryRequest, VerificationRequest},
hash,
hash::message_hash,
local::Local,
packet::MessageType,
peer::peer_id::PeerId,
peering::messages::PeeringRequest,
task::Repeat,
time::{self... |
// 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 crate::{utils, Data};
use std::io;
const LABEL_PADDING: usize = 2;
/// The `Chart` struct contains the configuration for displaying some data.
///
/// By default, a chart has a radius of `9`, an aspect ratio of `2` and doesn't show its legend.
/// # Example usage:
/// ```rust
/// use piechart::{Chart, Color, Data... |
use anyhow::Error as AnyhowError;
use auth_server_ext::google_openid::OpenidError;
use http::{Error as HTTPError, StatusCode};
use indexmap::IndexMap;
use log::error;
use rusoto_core::RusotoError;
use rusoto_ses::{GetSendQuotaError, GetSendStatisticsError, SendEmailError};
use rweb::{
http::uri::InvalidUri,
ope... |
//! Non-Interactive Proofs of Knowledge of Exponent (NI-PoKE2). See BBF (pages 10 and 42) for
//! details.
use crate::group::UnknownOrderGroup;
use crate::hash::{blake2b, hash_to_prime};
use rug::Integer;
#[allow(non_snake_case)]
#[derive(PartialEq, Eq, Hash, Clone, Debug)]
/// Struct for NI-PoKE2.
pub struct Poke2<G:... |
use failure::Error;
use hexplay::{self, HexViewBuilder, CODEPAGE_ASCII};
use metagoblin;
use metagoblin::Object;
use prettytable::Cell;
use prettytable::Row;
use format::*;
use Opt;
const SCALE: [char; 100] = [' '; 100];
fn minmaxscale(n: usize, min: usize, max: usize) -> usize {
(SCALE.len() as f32 * (n as f32 ... |
//! orbits: Define planetary systems with complex orbits.
//!
//! This model uses a simple tree hierarchy and only considers
//! orbits in relation to their parents, ignoring siblings.
use std::convert::TryFrom;
use std::f64::consts::PI;
use num_enum::{IntoPrimitive, TryFromPrimitive};
use serde::{Deserialize, Serial... |
// 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... |
//! Functions for creating an instance with extensions.
//!
//! The Instance struct holds the ash entry and ash instance along with the
//! debug callback. This is convenient because the application needs to hold
//! references to all of this data, but it's unwieldy to have separate handles
//! to each constantly float... |
#![feature(test)]
extern crate test;
extern crate yaxpeax_x86;
extern crate yaxpeax_arch;
use yaxpeax_arch::Decoder;
#[cfg(feature = "capstone_bench")]
use std::ffi::c_void;
#[cfg(feature = "capstone_bench")]
use std::io::Write;
use test::Bencher;
/*
use yaxpeax_x86::{Instruction, decode_one};
fn decode(bytes: &[... |
// Copyright © 2018 <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 without
// restriction, including without limitation the rights to use, copy, modify, merge, publish,
// distribu... |
// Copyright (c) 2015 <NAME>
// This file is part of vlc-rs.
// Licensed under the MIT license, see the LICENSE file.
use crate::sys;
use crate::{Instance, EventManager};
use crate::enums::{State, Meta, TrackType};
use crate::tools::{to_cstr, from_cstr, path_to_cstr};
use std::path::Path;
pub struct Media {
pub(c... |
use std::collections::{BTreeSet, BinaryHeap};
use std::cmp::min;
use std::io::{self, Read};
use regex::Regex;
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd)]
struct Player {
hp: u16,
armor: u16,
mana: u16
}
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd)]
struct Boss {
hp: u16,
damage: u16
}
fn... |
#![deny(missing_docs, unsafe_code)]
//! Crate for generating type-safe bindings to Ethereum smart contracts. This
//! crate is intended to be used either indirectly with the `ethcontract`
//! crate's `contract` procedural macro or directly from a build script.
#[cfg(test)]
#[allow(missing_docs)]
#[macro_use]
#[path =... |
use crate::config::{Config, Metadata};
use crate::error::NdkError;
use crate::manifest::Manifest;
use crate::ndk::{Key, Ndk};
use crate::target::Target;
use std::path::{Path, PathBuf};
use std::process::Command;
pub struct ApkConfig {
pub ndk: Ndk,
pub build_dir: PathBuf,
pub assets: Option<PathBuf>,
p... |
#![doc(html_root_url = "https://docs.rs/human_format")]
//! `human_format` provides facilitates creating a formatted string, converting between numbers that are beyond typical
//! needs for humans into a simpler string that conveys the gist of the meaning of the number.
//!
//! ## Setup
//!
//! Add the library to your... |
use cursive::{Printer, XY};
use cursive::align::Align;
use cursive::direction::Direction;
use cursive::event::{Event, EventResult, Key};
use unicode_width::UnicodeWidthStr;
use cursive::utils::{LinesIterator, Row};
use cursive::vec::Vec2;
use cursive::view::{SizeCache, View};
use cursive::view::ScrollBase;
use std::... |
//! Typed inter-thread, intra-process channels.
use std::rc::Rc;
use std::cell::RefCell;
use std::sync::{Arc, Mutex};
use std::any::Any;
use std::time::Duration;
use std::collections::{HashMap, VecDeque};
use crossbeam_channel::{Sender, Receiver};
use crate::allocator::thread::{ThreadBuilder};
use crate::allocator::{... |
#[cfg(test)]
#[path = "../../../tests/unit/construction/constraints/conditional_test.rs"]
mod conditional_test;
use crate::construction::constraints::{ConstraintModule, ConstraintVariant};
use crate::construction::heuristics::{RouteContext, SolutionContext};
use crate::models::problem::Job;
use hashbrown::HashSet;
use... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.