text stringlengths 7.05k 33.9k |
|---|
pub extern crate serde;
extern crate serde_json;
extern crate rmp_serde;
use serde::{Deserialize, Serialize};
use std::convert::Infallible;
use std::convert::TryFrom;
pub mod prelude;
#[cfg_attr(feature = "trace", tracing::instrument)]
pub fn encode<T: serde::Serialize + std::fmt::Debug>(
val: &T,
) -> Result<V... |
use bevy::{
prelude::*,
reflect::TypeUuid,
render::{
mesh::{shape, Indices},
pipeline::{PrimitiveTopology, PipelineDescriptor, RenderPipeline},
render_graph::{base, AssetRenderResourcesNode, RenderGraph},
renderer::{
RenderResource, RenderResourceType,
RenderResourceIterator, RenderRes... |
use std::future::Future;
use std::sync::Arc;
use std::time::Duration;
use data_types::database_state::DatabaseStateCode;
use data_types::server_id::ServerId;
use data_types::{database_rules::DatabaseRules, DatabaseName};
use futures::future::{BoxFuture, Shared};
use futures::{FutureExt, TryFutureExt};
use internal_typ... |
// 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 ... |
#![allow(dead_code)]
use chrono::prelude::*;
use comfy_table::presets::UTF8_FULL;
use comfy_table::*;
#[path = "./currency.rs"]
mod currency;
#[path = "./config.rs"]
mod conf;
use config::Value;
use rust_decimal::prelude::FromPrimitive;
use std::collections::HashMap;
// #[derive(Debug, Eq, Ord, PartialEq, PartialOrd)]... |
// The MIT License (MIT)
//
// Copyright (c) 2013 <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... |
// Rust Bitcoin Library
// Written by
// The Rust Bitcoin developers
// The Rust Elements developers
//
// To the extent possible under law, the author(s) have dedicated all
// copyright and related and neighboring rights to this software to
// the public domain worldwide. This software is distributed without
// an... |
use std::fs::File;
use std::io::BufReader;
use std::io::Read;
use std::mem::size_of;
use std::num::Wrapping as Wrap;
// The following initialization data was taken from:
// https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf (page 15)
const INIT_HASH_VALUES: [u32; 8] = [
0x6A09E667, 0xBB67AE85, 0x3C6EF372,... |
// Copyright 2020-2021 <NAME> under the terms of the MIT License as detailed
// in the accompanying file README.md or <https://opensource.org/licenses/MIT>.
//! Means by which the player may alter or interact with the world.
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::error::Error;
use std::sync::A... |
extern crate common;
extern crate rand;
use rand::{Rng, SeedableRng, StdRng};
use common::*;
use common::Register::*;
use common::Data::*;
use common::Instruction::*;
#[no_mangle]
pub fn new_game(instructions: [Instruction; PLAYFIELD_SIZE], size: Size) -> Game {
let seed: &[_] = &[42];
let mut rng: StdRng =... |
use std::{
collections::HashMap,
ops::Sub,
sync::{Arc, Mutex},
time::{Duration, Instant},
};
use log::*;
use rdkafka::{
consumer::{BaseConsumer, Consumer, ConsumerContext, Rebalance},
producer::{BaseProducer, BaseRecord},
ClientContext, Message, TopicPartitionList,
};
use rdkafka::{error::K... |
use crate::config::*;
use crate::suffix::BitvectorSuffix;
pub struct Builder {
// trie level < sparse_start_level_: LOUDS-Dense
// trie level >= sparse_start_level_: LOUDS-Sparse
include_dense: bool,
sparse_dense_ratio: u32,
sparse_start_level: level_t,
// LOUDS-Sparse bit/byte vectors
lab... |
#![feature(ip)]
use crate::plot_data::PlotData;
use anyhow::{anyhow, Result};
use chrono::prelude::*;
use crossterm::event::{KeyEvent, KeyModifiers};
use crossterm::{
event::{self, DisableMouseCapture, EnableMouseCapture, Event as CEvent, KeyCode},
execute,
terminal::{disable_raw_mode, enable_raw_mode, Ent... |
use crate::commands;
use crate::error::RedisError;
use crate::modules::inner::RedisClientInner;
use crate::multiplexer::{commands as multiplexer_commands, utils as multiplexer_utils};
use crate::types::{
ClientState, ConnectHandle, CustomCommand, FromRedis, InfoKind, ReconnectPolicy, RedisConfig, RedisValue,
Shutdo... |
extern crate tokio_codec;
extern crate websocket;
extern crate base64;
use self::websocket::stream::r#async::Stream as WsStream;
use self::websocket::OwnedMessage;
use futures;
use futures::sink::Sink;
use futures::stream::Stream;
use std;
use std::io::Result as IoResult;
use std::io::{Read, Write};
use tokio_io::{Asy... |
// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// Substrate 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 la... |
use crate::utils::*;
use bigint::U256;
use std::cmp::{Ordering, PartialEq, PartialOrd};
use std::collections::HashMap;
use std::fmt;
#[derive(Clone, PartialEq)]
pub struct Balance {
pub coin_id: u32,
pub amount: i64, // allow minus balance
}
impl fmt::Debug for Balance {
fn fmt(&self, f: &mut fmt::Formatt... |
use crate::{
Store,
Module,
ExternVal,
ModuleInst,
Error,
Frame,
FuncInst,
ExternType,
Thread,
StackEntry,
Val,
// Instr,
// Start,
FuncAddr,
GlobalType,
GlobalAddr,
GlobalInst,
Func,
FuncType,
TableInst,
Limits,
TableType,
Tab... |
use crate::tests::{construct_code_module, WASM_ENGINE};
use wasmtime::{Linker, Module, Store};
/// IF_ACMPEQ, IF_ACMPNE, IF_CMPEQ, IF_CMPNE, IF_CMPLT, IF_CMPLE, IF_CMPGT, IF_CMPGE
#[test]
fn if_cmp() -> anyhow::Result<()> {
let module = construct_code_module(
// Generated instructions will actually be the ... |
pub use outcome::*;
pub use policy::*;
pub use protocol::*;
pub use result::*;
pub use settings::*;
pub use source::*;
mod outcome;
mod policy;
mod protocol;
mod result;
mod settings;
mod source;
use std::fmt::{self, Debug};
use std::sync::Arc;
use async_trait::async_trait;
use cast_trait_object::dyn_upcast;
use onc... |
use nannou::prelude::*;
use std::fs;
mod commits;
use chrono::{DateTime, Utc};
use commits::read_commit_data;
use commits::Commit;
use indexmap::IndexMap;
use std::collections::HashMap;
use std::path::PathBuf;
// Visualisation planning:
// 1. Tracing files over time, watching the repo grow.
// Track every file, when i... |
#![deny(missing_docs)]
// Copyright (c) 2014 The Rust Project Developers
// 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... |
// Copyright 2017 The Grin 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 crate::*;
use crate::block::{Block, BlockPtr, Item, ItemContent, Prelim, ID};
use crate::block_store::StateVector;
use crate::event::UpdateEvent;
use crate::id_set::{DeleteSet, IdSet};
use crate::store::Store;
use crate::types::array::Array;
use crate::types::xml::{XmlElement, XmlText};
use crate::types::{
Bra... |
// 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 ... |
use crate::core::ribosome::error::RibosomeError;
use crate::core::ribosome::guest_callback::entry_defs::EntryDefsInvocation;
use crate::core::ribosome::guest_callback::entry_defs::EntryDefsResult;
use crate::core::ribosome::CallContext;
use crate::core::ribosome::RibosomeT;
use crate::core::workflow::call_zome_workflow... |
//! Prototype module for cross chain assets backing.
#![cfg_attr(not(feature = "std"), no_std)]
#![recursion_limit = "128"]
#[cfg(all(feature = "std", test))]
mod mock;
#[cfg(all(feature = "std", test))]
mod tests;
mod types {
use crate::*;
/// Balance of an account.
pub type Balance = u128;
pub type DepositId ... |
extern crate proc_macro;
use proc_macro::TokenStream;
use quote::{quote, quote_spanned};
use std::collections::{hash_map::Entry, HashMap, HashSet};
use syn::{
parenthesized,
parse::{Parse, ParseStream, Result},
parse_macro_input,
punctuated::Punctuated,
spanned::Spanned,
Error, Fields, Ident, T... |
use super::glsl;
use super::shaders;
use crate::format;
use crate::gl;
use crate::model::BlockVertex;
use crate::render::Renderer;
use crate::shared::Direction;
use crate::types::hash::FNVHash;
use byteorder::{NativeEndian, WriteBytesExt};
use cgmath::{Matrix4, Point3, SquareMatrix};
use collision::{self, Frustum, Sphe... |
// Copyright (c) 2021, 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.
#[derive(Debug)]
enum Error {
RusqliteError(rusqlite::Error),
IoError(std::io::Error),
DepgraphError(String),
... |
// Copyright (c) 2017 <NAME>, RWTH Aachen University
// <NAME>, RWTH Aachen University
//
// 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 fi... |
//! Almost direct (but slightly optimized) Rust translation of Figure 3 of "Printing
//! Floating-Point Numbers Quickly and Accurately"[^1].
//!
//! [^1]: <NAME>. and <NAME>. 1996. Printing floating-point numbers
//! quickly and accurately. SIGPLAN Not. 31, 5 (May. 1996), 108-116.
use crate::cmp::Ordering;
use crate... |
#[cfg(test)]
#[path = "../../../tests/unit/construction/constraints/capacity_test.rs"]
mod capacity_test;
use crate::construction::constraints::*;
use crate::construction::heuristics::*;
use crate::models::common::*;
use crate::models::problem::{Job, Single};
use crate::models::solution::{Activity, Route};
use hashbro... |
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
mod auth_api;
mod beacon_api;
mod chain_api;
mod common_api;
mod gas_api;
mod mpool_api;
mod net_api;
mod state_api;
mod sync_api;
mod wallet_api;
use crate::{beacon_api::beacon_get_entry, common_api::version, state_api::*};
use ahash::AH... |
/// Phase II: Determine pairs of submission with significant fingerprint overlap
use std::collections::HashSet;
use std::collections::HashMap;
use std::collections::BTreeSet;
use fnv::FnvHashMap;
use std::iter::FromIterator;
use crate::{Doc, Sub};
/// A SubPair represents an unordered pair of Subs with overlapping ha... |
use crate::sim1::types::{AttackType, UnstackableBuff, Vision, NOBLESSE_OBLIGE};
// this State class is meant to hold numbers only so that
// 1) they can be merged
// 2) initialized without arguments
#[derive(Debug)]
pub struct State {
pub base_hp: f32, pub base_def: f32, pub base_atk: f32,
pub hp: f32, pub def... |
use std::fmt;
use std::ops::{Add, Sub, Mul};
use super::*;
/// Function expression.
#[derive(Clone, PartialEq, PartialOrd, Debug)]
pub enum Expr {
/// A symbol that is used together with symbolic knowledge.
Sym(Symbol),
/// Some function that returns a value, ignoring the argument.
///
/// This ca... |
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
use chrono::NaiveDateTime;
use tui::buffer::Buffer;
use tui::layout::{Alignment, Constraint, Direction, Layout, Rect};
use tui::style::Modifier;
use tui::text::{Span, Spans};
use tui::widgets::{
Block, Borders, Cell, List, ListItem, ListState, Paragraph... |
use std::any::Any;
use std::collections::*;
use std::iter::FromIterator;
use crate::expression::{BasicExprOps, SetComprehension, SetCompreOp};
use crate::module::*;
use crate::parser::combinator::parse_program;
use crate::term::*;
use crate::type_system::*;
use crate::rule::Rule;
use crate::util::map::GenericMap;
pu... |
///! Parse text files and extract asset and transaction data
///! Currently, transaction documents from comdirect bank are supported
use super::german_string_to_date;
use super::german_string_to_float;
use super::{DocumentType, ParsedTransactionInfo, ReadPDFError};
use chrono::NaiveDate;
use finql_data::{Asset, CashAmo... |
// Copyright 2020 The Grin 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 std::ops::Range;
use std::ops::RangeTo;
use std::ops::RangeFrom;
use std::ops::RangeFull;
use std::iter::Enumerate;
use nom::*;
use std::str;
use std::str::FromStr;
use std::str::Utf8Error;
#[derive(Debug, Clone, PartialEq)]
pub enum Token {
Comment(String),
Float(f64),
Integer(i64),
Char(char),
... |
// Copyright 2016 rust-punkt developers
//
// 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 acc... |
use anyhow::{Context, Result};
use nix::{libc::{major, minor}, sys::stat::fstat};
use smithay::backend::{egl::{EGLError, SwapBuffersError, display::EGLDisplayHandle, native::{EGLNativeDisplay, EGLNativeSurface, EGLPlatform}}};
use smithay::reexports::drm::control::{crtc, plane};
use super::gpu::Fd;
use std::{
cel... |
//! This module contains all Functions to work with a single Step
//!
//! The most important struct is the VariableResult. This struct contains all data and various functions to work with that data.
use num::complex::Complex;
use gnuplot::{Figure, Caption, Color,AxesCommon,AutoOption};
use std::str::FromStr;
/// This... |
use std::convert::TryFrom;
use std::sync::Arc;
use anyhow::Result;
use rand::Rng;
use ton_api::ton::{self, TLObject};
use ton_api::IntoBoxed;
use crate::adnl_node::AdnlNode;
use crate::overlay_node::MAX_OVERLAY_PEERS;
use crate::subscriber::*;
use crate::utils::*;
use self::buckets::*;
use self::storage::*;
mod buc... |
#![allow(non_camel_case_types)]
extern crate libc;
use libc::{
c_void,
c_char,
c_uchar,
c_int,
c_uint,
int8_t,
int16_t,
int32_t,
uint32_t,
c_double,
};
pub const FREENECT_COUNTS_PER_G: c_int = 819; // Ticks per G for accelerometer as set per http://www.kionix.com/Product%20Shee... |
// SPDX-License-Identifier: MIT
// Copyright (C) 2018-present iced project and contributors
mod call_instr;
mod ip_relmem_instr;
mod jcc_instr;
mod jmp_instr;
mod simple_br_instr;
mod simple_instr;
mod xbegin_instr;
use crate::block_enc::block::{Block, BlockData};
use crate::block_enc::instr::call_instr::CallInstr;
u... |
// Copyright 2021 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 {
crate::core::collection::{Components, ManifestData, Manifests, Sysmgr},
anyhow,
scrutiny::{
collectors, controllers,
engi... |
use super::{ByteArray, ByteVec, NiceBigUint};
use serde::{Deserialize, Serialize};
/// The header of an Ethereum block
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct BlockHeader {
pub parent_hash: ByteArray<32>,
pub sha3_uncles: ByteArray<32>,
pub miner: ByteArray<20>,
pub state_... |
//! Bounds represent an interval with inclusive ends. They are used to indicates the lowest and
//! highest value that can be selected in a selection component.
//!
//! Note: this is used instead of `Range`, as `Range` cannot easily be used in our FRP because it
//! does not implement `Default`.
use crate::prelude::*;... |
use log::{debug, info, trace, warn};
use osmgraphing::{
configs::{
self,
routing::{ExploratorAlgo, RoutingAlgo},
},
defaults,
helpers::err,
network::{Graph, RoutePair},
routing::{
dijkstra::{self, Dijkstra},
explorating::ConvexHullExplorator,
paths::Path,
... |
//use std::mem; // Needed if useing transmute
use self::ARM7Mode::*;
use std::fmt;
use gba_cpu::RType;
use gba_cpu::register::Register;
// Important PSR bits from:
// http://www.atmel.com/Images/DDI0029G_7TDMI_R3_trm.pdf
// section 2.7, page 2-13
// Condition code flag bits (28-31)
const COND_MASK: RType = 0xF0000000... |
use std::borrow::Cow;
use async_std::{
channel::Sender,
io::BufReader,
net::{Incoming, SocketAddr, TcpListener, ToSocketAddrs},
stream, task,
};
use futures::{
stream::FuturesUnordered,
AsyncRead, AsyncWrite, {future, AsyncBufReadExt, AsyncWriteExt, StreamExt},
};
use crate::{mail::Mail, smtp:... |
use anyhow::{anyhow, ensure, Context, Result};
use fancy_garbling::{Fancy, FancyInput};
use itertools::Itertools;
use super::output::OutputBuilder;
use crate::byte_array::{ByteArray, BytesBundle, BytesGadgets};
use crate::consts::{INDEX_BYTES, LOCATION_BYTES};
use crate::encoded::{self, LazilyEncodedRow, LazilyEncoded... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Bits 24-31 of `TIMER0_LOAD`. Load value when Timer is (re-)enabled.In One-Shot mode, the value written to this register specify the Timer's duration in clock cycles."]
pub load3: LOAD3,
_reserved1: [u8; 3usize],
#[doc = "0x... |
use crate::{key::PublicKey, private::SubjectPublicKeyInfo, signature::SignatureHashType};
use base64::DecodeError;
use serde::{Deserialize, Serialize};
use snafu::Snafu;
// === error type === //
#[derive(Debug, Snafu)]
pub enum JwkError {
/// Json error
#[snafu(display("JSON error: {}", source))]
Json { s... |
use openssl::symm::{decrypt, Cipher};
use std::collections::HashSet;
use setcommon::io;
/// Set 1, Challenge 1. Converts hexadecimals to bytes and encodes the result to base64
///
/// # Arguments
///
/// * `hex_str` - Hexadecimal string
///
/// # Example
///
/// ```
/// let base64_encoded_value = hex_to_base64("49276d... |
#[macro_use]
extern crate arrayref;
extern crate lazycell;
extern crate libc;
#[macro_use]
extern crate log;
extern crate mio;
extern crate pnet;
extern crate protobuf;
extern crate rand;
extern crate time;
extern crate tuntap;
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::fs::File;
use st... |
//! # SLA Module
//! Based on the [specification](https://interlay.gitlab.io/polkabtc-spec/spec/sla.html).
#![deny(warnings)]
#![cfg_attr(test, feature(proc_macro_hygiene))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
#[cfg(test)]
extern crate mocktopus;
#[cfg(test)]
u... |
// Enabled for the `repr_bound!` macro.
#![feature(trait_alias)]
#![feature(async_closure)]
use std::{error::Error, marker, marker::PhantomData, mem::ManuallyDrop, thread, time::Duration};
use tokio::time::timeout as timeout_after;
// Type aliases so we don't have to update these in so many places if we switch the im... |
use std::lazy::SyncLazy;
use chrono::TimeZone;
use chrono_tz::US::Eastern;
use crate::calendars::calendar::DaySet;
use crate::date::{Date, Day};
use crate::iter::DateIter;
use crate::op::DOp;
#[allow(clippy::unnecessary_wraps)]
fn sun_to_mon(d: Date) -> Option<Date> {
Some(if d.weekday() == Day::Sun { d.add_days... |
use std::convert::TryFrom;
use super::errors::{Error, Result};
// https://de.wikipedia.org/wiki/American_Standard_Code_for_Information_Interchange#ASCII-Tabelle
static BACKSPACE: u8 = 0x08; // BS
static FORMFEED: u8 = 0x0C; // FF
static LINEFEED: u8 = 0x0A; // LF
static CARRIAGE_RETURN: u8 = 0x0D; // CR
static HORIZO... |
use crate::model::*;
use crate::texture::*;
use nom::*;
use nom::number::complete::*;
#[derive(Debug)]
pub enum TextureFormat {
I4,
I8,
A4,
A8,
IA4,
IA8,
RG8,
RGB565,
RGB8,
RGB5A1,
RGBA4,
RGBA8,
}
impl TextureFormat {
fn from_code(code: u8) -> Option<TextureFormat> ... |
use crate::{graphics::Rect, View, ViewId};
use slotmap::HopSlotMap;
// the dimensions are recomputed on window resize/tree change.
//
#[derive(Debug)]
pub struct Tree {
root: ViewId,
// (container, index inside the container)
pub focus: ViewId,
// fullscreen: bool,
area: Rect,
nodes: HopSlotMa... |
//! 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 amethyst::{
core::math::{Point2, RealField, Rotation2, Vector2},
core::timing::Time,
derive::SystemDesc,
ecs::{world::Builder, Component, Entities, LazyUpdate, Read, ReadStorage, System, SystemData},
prelude::*,
};
use log::debug;
use std::time::Duration;
use crate::{
components::{
... |
use crate::{
AreaSlider, Autocomplete, Checkbox, Color, Dropdown, EventCtx, GfxCtx, HorizontalAlignment,
Menu, Outcome, PersistentSplit, ScreenDims, ScreenPt, ScreenRectangle, Slider, Spinner,
TextBox, VerticalAlignment, Widget, WidgetImpl, WidgetOutput,
};
use geom::{Percent, Polygon};
use std::collections... |
/// Video annotation request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnotateVideoRequest {
/// Input video location. Currently, only
/// [Google Cloud Storage](<https://cloud.google.com/storage/>) URIs are
/// supported, which must be specified in the following format:
/// `gs://bucke... |
use anyhow::{bail, Context, Result};
use bitcoin::{
consensus::{deserialize, serialize},
hashes::hex::{FromHex, ToHex},
BlockHash, Txid,
};
use crossbeam_channel::Receiver;
use rayon::prelude::*;
use serde_derive::Deserialize;
use serde_json::{self, json, Value};
use std::collections::{hash_map::Entry, Has... |
// Copyright 2015 <NAME>. See the COPYRIGHT
// file at the top-level directory of this distribution.
// Note since x86 and Amd64 have basically the same ABI, this implementation
// is written to largely erase the details of the two wherever possible,
// so that it can be copied between the two with minimal changes. It... |
//! Audio and image sample format definitions.
//!
//! NihAV does not have a fixed list of supported formats but rather accepts format definitions both for audio and video.
//! In result exotic formats like YUV410+alpha plane that is used by Indeo 4 are supported without any additional case handing.
//! Some common for... |
use crate::common::{
lock::PyRwLock,
rc::{PyRc, PyWeak},
};
use crate::{
builtins::{PyBaseExceptionRef, PyDictRef, PyTypeRef},
IdProtocol, PyObjectPayload, TypeProtocol, VirtualMachine,
};
use std::any::TypeId;
use std::fmt;
use std::marker::PhantomData;
use std::mem::ManuallyDrop;
use std::ops::Deref;
... |
use crate::auth::Scope;
use crate::command;
use crate::currency::Currency;
use crate::irc;
use crate::module;
use crate::player;
use crate::player::{AddTrackError, Item, PlayThemeError, Player};
use crate::prelude::*;
use crate::settings;
use crate::utils::{self, Cooldown, Duration};
use anyhow::Result;
use std::sync::... |
use crate::base;
use crate::base::convolve;
use crate::time::TimeDelta;
use std::cmp;
use std::collections::BTreeMap;
use std::f32::consts::PI;
use std::sync::Arc;
const NUM_SUB_INTERVALS: usize = 32;
#[derive(Clone)]
struct QuadFunction {
a: f32,
b: f32,
c: f32,
}
impl QuadFunction {
pub fn new(at0:... |
#![deny(clippy::all)]
#![feature(test)]
#![feature(drain_filter)]
extern crate test;
use std::{
cmp::Ordering,
fs::read_to_string,
hash::Hash,
ops::{AddAssign, Sub, SubAssign},
path::Path,
sync::{mpsc, Arc, Mutex},
thread,
};
#[derive(Debug, PartialEq, PartialOrd, Default, Clone)]
pub stru... |
use std::collections::BTreeMap;
use std::collections::HashMap;
use std::error::Error;
use std::io::Write;
use bitflags::bitflags;
use memmap;
use object::{Object, ObjectSection};
use regex::Regex;
use scroll::Pread;
use std::mem::size_of;
use structopt::StructOpt;
use btf::c_dumper;
use btf::relocator::{Relocator, Re... |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Keylime Authors
use openssl::{
asn1::Asn1Time,
encrypt::Decrypter,
hash::MessageDigest,
memcmp,
nid::Nid,
pkcs5,
pkey::{Id, PKey, PKeyRef, Private, Public},
rsa::{Padding, Rsa},
sign::{Signer, Verifier},
ssl::{SslAcceptor,... |
pub use super::{
A, AAAA, AFSDB, APL, CAA, CNAME, DNAME, DNSKEY, DS, EID, EUI48, EUI64, GPOS, HINFO, ISDN, KX,
L32, L64, LOC, LP, MB, MD, MF, MG, MINFO, MR, MX, NID, NIMLOC, NS, NSAP, NULL, OPT, PTR, PX,
RP, RT, SOA, SRV, SSHFP, TXT, URI, WKS, X25,
};
use crate::rr::draft_ietf_dnsop_svcb_https::ServiceBindi... |
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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 lat... |
use std::fmt;
use std::fmt::{Debug, Display, Formatter};
/// # There are 2 types of error handling in Rust: panic and Results.
///
/// Ordinary errors are handled using Results. These are typically caused by things outside the
/// program, like erroneous input, a network outage, or a permissions problem. That such
/// ... |
//! Module with alias analysis — allows telling what identifiers are used and introduced by each
//! node in the graph.
use crate::prelude::*;
use crate::definition::DefinitionInfo;
use crate::definition::ScopeKind;
use crate::identifier::LocatedName;
use crate::identifier::NormalizedName;
use ast::crumbs::Crumb;
us... |
use crate::codegen::arch::machine::register::{RegisterClassKind as RC, GR64};
use crate::codegen::arch::{dag::node::MemKind, machine::inst::MachineOpcode as MO};
use crate::codegen::common::{
dag::{
function::DAGFunction,
module::DAGModule,
node::{IRNode, IROpcode, ImmediateKind, MINode, Nod... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
//! JWT SVID types.
use std::str::FromStr;
use chrono::{DateTime, TimeZone, Utc};
use jsonwebtoken::{dangerous_insecure_decode, Algorithm};
use serde::{de, Deserialize, Deserializer, Serialize};
use thiserror::Error;
use zeroize::Zeroize;
use crate::bundle::jwt::{JwtAuthority, JwtBundle};
use crate::bundle::BundleRe... |
use super::args::{
self, AccountArgs, AddressArgs, ContactArgs, ProofArgs, SeedArgs, SendCommandType,
};
use super::display::{self, InitialPromptOption};
use crate::api::listener::ListenerInterface;
use crate::common::motd::get_motd;
use crate::common::{Arc, ErrorKind, Keychain, Mutex};
use crate::contacts::Address;
u... |
pub type shmatt_t = ::c_ulong;
pub type msgqnum_t = ::c_ulong;
pub type msglen_t = ::c_ulong;
pub type regoff_t = ::c_int;
s! {
pub struct statvfs { // Different than GNU!
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
... |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Keylime Authors
use crate::crypto;
use crate::{
common::{
JsonWrapper, KeySet, SymmKey, AES_BLOCK_SIZE, AGENT_UUID_LEN,
AUTH_TAG_LEN,
},
Error, QuoteData, Result,
};
use actix_web::{web, HttpRequest, HttpResponse, Responder};
use log:... |
use crate::{
assert_empty,
data_structures::Rectangle,
date::Date,
error::{ParseError, PdfResult},
objects::{Dictionary, Object, Reference},
optional_content::OptionalContent,
pdf_enum,
resources::graphics_state_parameters::LineDashPattern,
Resolve,
};
use subtype::{AnnotationSubTyp... |
extern crate image;
use std::cmp::Ordering;
use image::{GenericImageView, DynamicImage};
use image::imageops::FilterType;
use image::io::Reader;
use std::fs;
use crate::image_error::MyImageError;
#[derive(Clone)]
pub struct ImagePath {
pub fpath: String, //The path to a valid image file
pub is_compare_dir : bool,... |
use assert_size_attribute::assert_eq_size;
use azerust_game::{accounts::ConnectToken, realms};
use azerust_protocol::auth::{AuthCommand, ReturnCode};
use bincode::Options;
use serde::{ser::SerializeStruct, Deserialize, Serialize};
use thiserror::Error;
use wow_srp::Salt;
use crate::wow_bincode::wow_bincode;
pub const... |
use std::{
collections::HashMap,
env,
fs::{self, File},
io,
io::{BufRead, BufReader},
path::{Path, PathBuf},
str::FromStr,
};
use anyhow::Context;
use lazy_static::lazy_static;
use regex::Regex;
use semver::{Version, VersionReq};
use thiserror::Error;
use crate::{
constants::{EXECUTABL... |
use crate::err::{Error, Result};
use crate::impl_serialize_for_bitflags;
use log::{trace, warn};
use winstructs::ntfs::mft_reference::MftReference;
use byteorder::{LittleEndian, ReadBytesExt};
use bitflags::bitflags;
use serde::ser::{self, SerializeStruct, Serializer};
use serde::Serialize;
use crate::attribute::h... |
//! A tool that functionaries can use to create link metadata about a step.
use path_clean::clean;
use std::collections::{BTreeMap, HashSet};
use std::fs::{canonicalize as canonicalize_path, symlink_metadata, File};
use std::io::{self, BufReader, Write};
use std::process::Command;
use walkdir::WalkDir;
use crate::cry... |
use crossbeam_channel::Sender;
use druid::widget::{Flex, Scroll};
use druid::{
theme, BoxConstraints, Command, Data, Env, Event, EventCtx, ExtEventSink, KbKey, KeyEvent,
LayoutCtx, LifeCycle, LifeCycleCtx, PaintCtx, SingleUse, Size, TimerToken, UpdateCtx, Widget,
WidgetExt, WidgetId, WindowId,
};
use std::p... |
/*
* Copyright 2019 <NAME>
* Copyright 2020 BDK 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 applic... |
//! UART peripheral control
//!
//! Controls the 3 uart peripherals (UART0, UART1, UART2).
//!
//! # Example
//!
//! Creation of the serial peripheral and writing formatted info.
//! ```
//! let serial: Serial<_, _, _> = Serial::new(
//! dp.UART0,
//! esp32_hal::serial::Pins {
//! tx: gpios.gpio1,
//! ... |
//! # Overview
//!
//! BudouX-rs is a rust port of [BudouX](https://github.com/google/budoux) (machine learning powered line break organizer tool).
//!
//! Note:
//! This project contains the deliverables of the [BudouX](https://github.com/google/budoux) project.
//!
//! Note:
//! BudouX-rs supported plain text only, n... |
//! The FeInt virtual machine. When it's created, it's initialized and
//! then, implicitly, goes idle until it's passed some instructions to
//! execute. After instructions are executed, it goes back into idle
//! mode.
use std::fmt;
use std::rc::Rc;
use crate::ast;
use crate::compiler::compile;
use crate::parser::{s... |
use data::*;
use buffer::*;
use util::*;
use std::cmp;
use std::mem;
pub struct Renderer<'a> {
pub textures: Vec<&'a [u8]>,
pub buffer: Buffer,
pub width: usize,
pub height: usize,
pub t: f32,
pub ambient: [u8; 3],
viewport: (f32, f32),
p_z: f32,
}
impl<'a> Renderer<'a> {
pub fn new(width: usize, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.