text stringlengths 3.35k 22.8k |
|---|
// Copyright 2020 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::fragment_io::{new_fragment_io, FragmentReader, FragmentWriter};
use crate::lossy_text::LossyText;
use anyhow::{format_err, Context as _, Error};... |
#![allow(clippy::integer_arithmetic)]
extern crate byte_unit;
use {
byte_unit::Byte,
clap::{crate_description, crate_name, value_t_or_exit, App, Arg, ArgMatches, SubCommand},
serde::{Deserialize, Serialize},
std::{collections::HashMap, fs, ops::Sub, path::PathBuf},
};
#[derive(Deserialize, Serialize, ... |
// 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 ... |
// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
use std::ops::Deref;
use engine_traits::{ReadOptions, CF_DEFAULT, CF_WRITE};
use tikv::storage::{Cursor, CursorBuilder, ScanMode, Snapshot as EngineSnapshot, Statistics};
use tikv_util::{lru::LruCache, time::Instant};
use txn_types::{Key, MutationType... |
use std::cmp::{max, min};
use std::collections::HashMap;
use std::hash::Hash;
use geo_types::{Coordinate, Rect};
use log::debug;
use ndarray::{parallel::prelude::*, ArrayView2, Axis};
use h3ron::{collections::CompactedCellVec, polyfill, ToCoordinate};
use crate::resolution::{nearest_h3_resolution, ResolutionSearchMo... |
extern crate systemstat;
use std::io::stdout;
use std::error::Error;
use std::process;
use std::thread;
use std::time::Duration;
use std::sync::{Arc, Mutex};
use ctrlc;
use futures::executor::block_on;
use systemstat::{saturating_sub_bytes, Platform, System};
use crossterm::style::{Color, ResetColor, SetBackgroundC... |
pub mod core;
use self::core::WindowsCore;
mod error;
pub use error::WinError;
mod images;
pub use images::{
Bitmap,
Icon,
};
#[cfg(feature="opengl")]
mod opengl;
#[cfg(feature="opengl")]
pub use opengl::{
OpenGraphicsLibrary,
OpenGLRenderContext,
OpenGLRenderContextAttributes,
};
mod event;
pub... |
//! An asynchronous channel for Inter-Task Communication (ITC) with an internal queue for buffering messages.
//!
//! This crate offers an asynchronous channel that allows multiple tasks
//! to exchange messages through the use of a bounded-capacity intermediate buffer.
//! Unlike the `rendezvous` channel, the sender ... |
use crate::{qjs, Ctx, Error, Loaded, Module, Result, Script};
use relative_path::RelativePath;
use std::{ffi::CStr, ptr};
mod file_resolver;
pub use file_resolver::FileResolver;
mod script_loader;
pub use script_loader::ScriptLoader;
#[cfg(feature = "dyn-load")]
mod native_loader;
#[cfg(feature = "dyn-load")]
pub us... |
use vk;
use crate::ownage::check_errors;
use crate::Instance;
use crate::Device;
use crate::vkenums::{PresentMode, CompositeAlpha, ComponentSwizzle, ImageAspect,
ImageViewType, SharingMode};
use crate::Logs;
use std::ptr;
use std::mem;
use std::sync::Arc;
pub struct Swapchain {
swa... |
// 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.
//! Tools to download a Fuchsia package from from a TUF repository.
//! See
//! - [Package](https://fuchsia.dev/fuchsia-src/concepts/packages/package?hl=en... |
use std::{env, slice, str, str::FromStr};
use super::*;
use crate::platform_impl::x11::xdisplay::Screen;
use crate::{dpi::validate_scale_factor, platform_impl::platform::x11::VideoMode};
/// Represents values of `WINIT_HIDPI_FACTOR`.
pub enum EnvVarDPI {
Randr,
Scale(f64),
NotSet,
}
pub fn calc_dpi_facto... |
//! X.509 objects
//!
//! Based on RFC5280
//!
use std::fmt;
use num_bigint::BigUint;
use time::Tm;
use der_parser::ber::BitStringObject;
use der_parser::der::DerObject;
use der_parser::oid::Oid;
use objects::{oid2nid,nid2sn};
use error::X509Error;
use x509_parser::parse_ext_basicconstraints;
#[derive(Debug, Parti... |
use crate::assets::audio::sounds::{AudioBoard, Fx};
use crate::assets::config::MobsDefault;
use crate::entity::bullet::BulletEntity;
use crate::entity::cannon::CannonEntity;
use crate::entity::entity_drawable::DrawableEntity;
use crate::entity::goomba::GoombaEntity;
use crate::entity::koopa::KoopaEntity;
use crate::ent... |
// Copyright 2014 The html5ever 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>,... |
mod args;
mod colormap;
mod dataflow;
mod logging;
mod replay_loading;
mod report;
mod status;
mod ui;
use crate::{
args::Args,
colormap::{select_color, Color},
dataflow::{
utils::{HumanDuration, XXHasher},
Channel, DataflowSenders, Summation,
},
replay_loading::{connect_to_sources,... |
//! Filesystem-backed store implementation.
use std::path::{Path, PathBuf};
use anyhow::{anyhow, Context};
use filetime::FileTime;
use super::{install, Backend, Objects, Packages};
use crate::{
Blob, ContentAddressable, Entry, Object, ObjectExt, ObjectId, ObjectKind, Package, Tree,
};
const OBJECTS_SUBDIR: &str... |
use crate::utils::{
has_drop, in_macro, is_copy, match_def_path, match_type, paths, snippet_opt, span_lint_node,
span_lint_node_and_then, walk_ptrs_ty_depth,
};
use if_chain::if_chain;
use matches::matches;
use rustc::hir::intravisit::FnKind;
use rustc::hir::{def_id, Body, FnDecl, HirId};
use rustc::lint::{Late... |
use crate::{
item::{Item, ItemFactory, ItemFactoryError},
time::ParseTimeError,
};
use std::{
error::Error,
fmt,
io::{BufRead, Error as IoError, Lines},
num::ParseIntError,
};
const UTF8_BOM: &str = "\u{feff}";
const TIME_DELIMITER: &str = "-->";
/// Subtitles parser
pub struct Parser<B> {
... |
//! RPC Client.
//! Contains all client methods to connect to RPC server.
use {
super::{
connection,
connection::{RPCConn, Websocket},
constants,
error::RpcClientError,
infrastructure, notify,
},
crate::dcrjson::{result_types, result_types::JsonResponse},
futures... |
//! Universal Asynchronous Receiver/Transmitter (UART)
use crate::dma;
use crate::usci::{self, UsciARegisters};
use core::cell::Cell;
use kernel::common::cells::OptionalCell;
use kernel::common::registers::{ReadOnly, ReadWrite};
use kernel::common::StaticRef;
use kernel::hil;
use kernel::ReturnCode;
pub static mut UA... |
use crate::{
config::{
BITFINEX_URL, COINGECKO_URL, COINMARKETCAP_URL, INITIAL_RETRY_INTERVAL, LIVECOINWATCH_URL,
MAX_RETRIES,
},
prometheus,
};
use anyhow::anyhow;
use num_rational::BigRational;
use reqwest::Url;
use serde::Deserialize as SerdeDeserialize;
use serde_json::json;
use std::{
... |
use sp_std::{collections::btree_map::BTreeMap, prelude::*};
use frame_support::{
dispatch::DispatchResultWithPostInfo, pallet_prelude::*, weights::GetDispatchInfo, Hashable,
};
use deip_transaction_ctx::{TransactionCtxId, TransactionCtxT};
use crate::storage::{StorageOps, StorageOpsT};
use super::{Config, Error... |
// This file is part of Basilisk-node.
// Copyright (C) 2020-2021 Intergalactic, Limited (GIB).
// 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
//
/... |
use {
crossbeam_channel::Sender,
futures_util::stream::StreamExt,
pem::Pem,
pkcs8::{der::Document, AlgorithmIdentifier, ObjectIdentifier},
quinn::{Endpoint, EndpointConfig, ServerConfig},
rcgen::{CertificateParams, DistinguishedName, DnType, SanType},
solana_perf::packet::PacketBatch,
so... |
use crate::gles2::{BufferId, RafxDeviceContextGles2, NONE_BUFFER};
use crate::{RafxBufferDef, RafxMemoryUsage, RafxResourceType, RafxResult};
use crate::gles2::gles2_bindings;
use crate::gles2::gles2_bindings::types::GLenum;
use rafx_base::trust_cell::TrustCell;
use std::sync::atomic::AtomicU32;
use std::sync::atomic:... |
//! Demonstrates how to implement a (very) basic asynchronous rust executor and
//! timer. The goal of this file is to provide some context into how the various
//! building blocks fit together.
use std::cell::RefCell;
use std::future::Future;
use std::pin::Pin;
use std::sync::{Arc, Mutex};
use std::task::{Context, Po... |
//! Encode a BinJS, then decode it, ensure that we obtain the same AST.
extern crate binjs;
extern crate env_logger;
extern crate glob;
#[macro_use]
extern crate log;
use binjs::generic::*;
use binjs::io::bytes::compress::*;
use binjs::io::multipart::*;
use binjs::io::*;
use binjs::source::*;
use binjs::specialized::... |
use chrono::prelude::*;
use ::responses::raw;
use error::*;
use responses::user::User;
use try_from::TryFrom;
use super::channel::*;
use super::chat::*;
pub use self::raw::message::{Animation,
Audio,
Contact,
Document,
... |
// SPDX-License-Identifier: Apache-2.0
//! Provides a mapping of the shim physical addresses to the hypervisor host virtual addresses,
//! needed for proxying syscalls.
//!
//! With the mapping the shim can construct a syscall for the kernel with the address
//! space of the host/hypervisor. Otherwise the hypervisor w... |
use crate::config::{ConfigColor, ConfigColorByTheme, ConfigColumnStyle, ConfigStyle, ConfigTheme};
use ansi_term::{
ANSIGenericString,
Color::{self, Fixed},
Style,
};
use lazy_static::lazy_static;
lazy_static! {
static ref BRIGHT_BLACK: Style = Fixed(8).normal();
static ref BRIGHT_RED: Style = Fixe... |
use tera::{Context, Error, Tera};
/// Types used by templatings methods
pub mod motif {
/// Vector of (name, code_id, doc)
pub type ErrorCodeRows = Vec<(String, String, String)>;
/// Vector of (name, key_id)
pub type ApiKeyRows = Vec<(String, String)>;
/// Vector of (name, rust_type, doc)
pub... |
//! Information about varying calling conventions.
use crate::il;
use std::collections::HashSet;
/// Available type of calling conventions
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum CallingConventionType {
Amd64SystemV,
Cdecl,
MipsSystemV,
MipselSystemV,
PpcSystemV,
}
/// The return type for... |
use super::buttontext::ButtonText;
use super::fuielement::FUiElement;
use super::scrollabletext::ScrollableText;
use super::uistates::UiStates;
use alloc::boxed::Box;
use alloc::collections::btree_map::BTreeMap;
use alloc::string::String;
use alloc::vec::Vec;
use stm32f7_discovery::lcd::Color;
use stm32f7_discovery::lc... |
use crate::packet::ControlTypes::*;
use crate::protocol::connection::{Connection, ConnectionAction};
use crate::protocol::handshake::Handshake;
use crate::protocol::receiver::{Receiver, ReceiverAlgorithmAction};
use crate::protocol::sender::{Sender, SenderAlgorithmAction};
use crate::protocol::TimeBase;
use crate::Pac... |
use crate::custom_code_block::Custom;
use crate::maybe::Maybe;
use heck::*;
use proc_macro2::{TokenStream, Span};
use quote::{quote, ToTokens};
use syn::parse::{Parse, ParseStream, Result};
use syn::punctuated::Punctuated;
use syn::{braced, parenthesized, parse_macro_input, token, Ident, Path, TypePath, PathAr... |
/// Templates: Base strings, into which nouns can be inserted.
pub const TEMPLATES: &[&str] = &[
"\x1F",
"\x1F...",
"might be \x1F",
"hm. so it's a \x1F",
"which means...\x1F",
"\x1F you say...",
"\x1F...!",
"ought to be \x1F...",
"surely not \x1F...",
"what is a \x1F...?",
"... |
use serde::{Deserialize, Serialize};
use std::collections::{HashSet, HashMap};
use std::time::Duration;
use yew::{Callback, worker::*};
//use yew::prelude::*;
use yew::format::Binary;
use yew::services::{
websocket::{WebSocketService, WebSocketTask, WebSocketStatus},
timeout::{TimeoutService, TimeoutTask},
... |
use crate::case::to_snake;
use crate::tables::{AttributeArg, MethodDef, TypeDef};
use crate::types::TypeName;
use crate::types::{Param, RequiredInterface, TypeKind};
use crate::TypeReader;
use crate::*;
use proc_macro2::TokenStream;
use quote::quote;
use std::iter::FromIterator;
#[derive(Debug)]
pub struct Method {
... |
#[cfg(target_os = "windows")]
extern crate winapi;
use std::fs;
use std::path::PathBuf;
use std::io::BufWriter;
#[cfg(not(target_os = "windows"))]
use std::os::unix::io::AsRawFd;
use lightning::util::ser::Writeable;
#[cfg(target_os = "windows")]
use {
std::ffi::OsStr,
std::os::windows::ffi::OsStrExt
};
#[cfg(tar... |
use crate::connui::ConnectionUI;
use crate::localtab::LocalTab;
use crate::mux::domain::{alloc_domain_id, Domain, DomainId, DomainState};
use crate::mux::tab::Tab;
use crate::mux::window::WindowId;
use crate::mux::Mux;
use anyhow::{anyhow, bail, Context, Error};
use async_trait::async_trait;
use portable_pty::cmdbuilde... |
//! AVM2 methods
use crate::avm2::activation::Activation;
use crate::avm2::names::Multiname;
use crate::avm2::object::Object;
use crate::avm2::script::TranslationUnit;
use crate::avm2::value::{abc_default_value, Value};
use crate::avm2::Error;
use crate::string::AvmString;
use gc_arena::{Collect, CollectionContext, Gc... |
use crate::config::CrateDependencySource;
use crate::cpp_code_generator;
use crate::cpp_code_generator::generate_cpp_type_size_requester;
use crate::database::CRATE_DB_FILE_NAME;
use crate::processor::ProcessorData;
use crate::rust_code_generator;
use ritual_common::errors::Result;
use ritual_common::file_utils::{
... |
/// Advent of Code 2019, day 24
/// https://adventofcode.com/2019/day/24
use std::collections::HashSet;
use std::str::{from_utf8, FromStr};
const WIDTH: u32 = 5;
const END: u32 = WIDTH - 1;
const HALF: u32 = WIDTH / 2;
const SIZE: u32 = WIDTH * WIDTH;
const CENTRE: u32 = SIZE / 2;
const fn as_coords(i: u32) -> (u32, ... |
// 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 {
super::{
util::{get_declarations, is_table_or_bits, name_buffer, name_size, to_c_name, Decl},
Backend,
},
crate::fidl::*,... |
use std::{
fs,
path::{Path, PathBuf},
};
use crate::irust::Result;
pub fn split_args(s: String) -> Vec<String> {
let mut args = vec![];
let mut tmp = String::new();
let mut quote = false;
for c in s.chars() {
match c {
' ' => {
if !quote && !tmp.is_empty() ... |
use crate::{
actor::Actor, actor::ActorContainer, message::Message, projectile::ProjectileKind, GameTime,
};
use rg3d::{
core::{
algebra::{Matrix3, Vector3},
color::Color,
math::{ray::Ray, Matrix4Ext, Vector3Ext},
pool::{Handle, Pool, PoolIteratorMut},
visitor::{Visit, Vi... |
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use crate::core::{Action, Error, Method, PeriodType, Source, ValueType, OHLCV};
use crate::core::{IndicatorConfig, IndicatorInstance, IndicatorResult};
use crate::methods::{Change, Cross, LinearVolatility, StDev};
/// Kaufman Adaptive Moving Average (KAMA... |
use std::{cmp::Ordering, convert::TryFrom};
use wayland_protocols::wlr::unstable::layer_shell::v1::server::{zwlr_layer_shell_v1, zwlr_layer_surface_v1};
/// Available layers for surfaces
///
/// These values indicate which layers a surface can be rendered in.
/// They are ordered by z depth, bottom-most first.
/// Tr... |
use open::open;
use std::{
cell::RefCell,
fmt::Debug,
ops::{Add, AddAssign, Range, RangeBounds, Sub, SubAssign},
};
#[derive(Debug, Clone, PartialEq)]
pub struct Segbeats<T> {
len: usize,
lg: u32,
table: RefCell<Vec<Node<T>>>,
}
impl<T: Elm> Segbeats<T> {
pub fn new(src: &[T]) -> Self {
... |
use crate::{AnyError, Byml, NodeType, U24};
use binread::{BinRead, BinReaderExt, Endian, NullString};
use byteorder::ByteOrder;
use std::io::{Cursor, Read, Seek, SeekFrom};
type BymlResult = Result<Byml, AnyError>;
impl From<u8> for NodeType {
fn from(val: u8) -> NodeType {
match val {
0xA0 =>... |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
//! Utilities to sign Event Stream messages.
//!
//! # Example: Signing an event stream message
//!
//! ```rust
//! use aws_sigv4::event_stream::{sign_message, SigningParams};
//! use aws_smithy_eventst... |
//! "ZLIB Compressed Data Format Specification" <https://www.ietf.org/rfc/rfc1950.txt>
mod u4mod;
pub use self::u4mod::u4;
pub use self::u4mod::ZeroToRangeIter as u4ZeroToRangeIter;
mod bits;
use self::bits::Bits;
mod deflate;
/// A u2 representing a hint indicating the algorithm used when compressing
#[derive(Copy, ... |
// Copyright (c) 2018 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::future::Future;
use std::io;
use std::net::SocketAddr;
use std::pin::Pin;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::task::{Context, Poll};
use std::time::Duration;
use crate::client::Client;
use crate::message::{
Client as MsgClient, Coalition, GameMessage, Message, MsgTy... |
use gltf::accessor::{DataType, Dimensions};
use xecs::entity::EntityId;
pub struct Mesh {
// An id refer to MeshResource in world
mesh_resource: EntityId
}
impl Mesh {
pub fn from_resource(mesh_resource_id : EntityId) -> Self {
Mesh {
mesh_resource: mesh_resource_id,
}
}
... |
use std::io::Write;
use inflector::Inflector;
use regex::{Captures, Regex};
use hyper::status::StatusCode;
use botocore::{Member, Operation, Service, Shape};
use super::{GenerateProtocol, error_type_name, FileWriter, IoResult};
pub struct RestJsonGenerator;
impl GenerateProtocol for RestJsonGenerator {
fn generat... |
extern crate alloc;
use alloc::{format, string::String, vec::Vec};
use serde::Serialize;
use serde_json::{json, Value};
const MAX_STRING_LEN: usize = 150;
/// Represents the information about a substring found in a string.
#[derive(Debug)]
struct SubstringSpec {
/// Index of the first character.
start_index... |
use crate::models::bearer::BearerToken;
use crate::TwitterAPI;
use anyhow::Result;
use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION, CONTENT_TYPE};
/// A `ClientBuilder` can help construct a [`TwitterAPI`] instance with your configuration.
/// Before calling [`build`] method, you must set four values:
///
/... |
//! The `banking_stage` processes Transaction messages. It is intended to be used
//! to contruct a software pipeline. The stage uses all available CPU cores and
//! can do its processing in parallel with signature verification on the GPU.
use bank::Bank;
use bincode::deserialize;
use compute_leader_finality_service::... |
// 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 super::*;
use super::config;
use super::process::elf_file::{ElfFile, ProgramHeaderExt};
use super::user_space_vm::{UserSpaceVMManager, UserSpaceVMRange, USER_SPACE_VM_MANAGER};
use super::vm_manager::{
VMInitializer, VMManager, VMMapAddr, VMMapOptions, VMMapOptionsBuilder, VMRemapOptions,
};
#[derive(Debug)]
... |
use pkg_config;
use std::ffi::OsString;
use std::path::{Path, PathBuf};
use std::process::{self, Command};
use super::env;
pub fn get_openssl(target: &str) -> (PathBuf, PathBuf) {
let lib_dir = env("OPENSSL_LIB_DIR").map(PathBuf::from);
let include_dir = env("OPENSSL_INCLUDE_DIR").map(PathBuf::from);
mat... |
use std::io;
use std::time::Duration;
use crate::error::Result;
/// Minimal serial port trait.
///
/// The Sabertooth interfaces will rely on this trait for low level
/// communications.
/// In most cases there is no need to handle this trait or its implementors
/// manually, it is better to use an interface construc... |
use async_std::sync::{Arc, Condvar, Mutex};
use flume::{Receiver, Sender};
use futures::prelude::*;
use futures::select;
use serde::{Deserialize, Serialize};
use std::collections::HashSet;
use std::time::Duration;
use zenoh::net::queryable::EVAL;
use zenoh::net::{ConsolidationMode, QueryConsolidation, QueryTarget, Samp... |
use anchor_lang::prelude::*;
use anchor_lang::AccountsClose;
declare_id!("DbwyCYv83xm4TvTNtUFp8LwtKFtwaKK4P1HcDjAktoLb");
#[program]
pub mod todo {
use anchor_lang::solana_program::{program::invoke, system_instruction::transfer};
use super::*;
pub fn new_list(
ctx: Context<NewList>,
name:... |
use super::device::Device;
use anyhow::{Context, Result};
use ash::vk;
use derive_builder::Builder;
use gpu_allocator::{AllocationCreateDesc, MemoryLocation};
use parking_lot::Mutex;
use std::collections::HashMap;
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
pub enum ImageType {
Tex1d = 0,
Tex1dArray = 1... |
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless ... |
use common::{Get, Index};
use diagnostic::{Diagnostic, InputId, Span};
use syntax::{Identifier, Syntax};
use crate::{
error::Error,
internal::{ConstantPool, FunctionBuilder},
Capture, Constant, Function, Local, Module, ModuleDebug, Op,
};
pub struct ModuleBuilder {
/// The input that was used to produ... |
//! `crypto_scalarmult_curve25519` specified in
//! [Cryptography in NaCl](http://nacl.cr.yp.to/valid.html), Sections 2, 3, and 4.
//! This function is conjectured to be strong. For background see Bernstein,
//! "Curve25519: new Diffie-Hellman speed records," Lecture Notes in Computer
//! Science 3958 (2006), 207–228, ... |
/*! Standard Portable Intermediate Representation (SPIR-V) backend
!*/
mod helpers;
mod index;
mod instructions;
mod layout;
mod writer;
pub use spirv::Capability;
use crate::{arena::Handle, back::IndexBoundsCheckPolicy};
use spirv::Word;
use std::ops;
use thiserror::Error;
struct PhysicalLayout {
magic_number... |
use crate::common::{Color, Rect};
use crate::frame::Frame;
use crate::stage::{BackgroundType, Stage, StageTexturePaths};
use crate::{graphics, Context, GameResult, SharedGameState};
pub struct Background {
pub tick: usize,
pub prev_tick: usize,
}
impl Background {
pub fn new() -> Self {
Background... |
use std::cmp::Ordering;
use std::convert::TryFrom;
use std::fmt;
use std::ops;
use phf::phf_map;
use super::error::{Error, Result};
use super::tables::{
TRIT2_TO_AND, TRIT2_TO_CMP, TRIT2_TO_OR, TRIT2_TO_PRODUCT, TRIT3_TO_SUM_AND_CARRY,
};
pub const BITMASK: u16 = 0b11;
pub const BIN_ZERO: u16 = 0b00;
pub const ... |
use crate::hd_wallet::KeyChain;
use crate::hd_wallet::{ChainPath, DefaultKeyChain, ExtendedPrivKey};
use crate::service::hw_key_service::HardwareWalletAction;
use crate::{HDSeed, Mnemonic};
use client_common::{
Error, ErrorKind, PrivateKey, PrivateKeyAction, PublicKey, Result, ResultExt, Transaction,
};
use protoco... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
use super::network::Network;
use crate::errors::NetworkError;
#[allow(unused_imports)]
use crate::log;
use std::boxed::Box;
use std::collections::{HashMap, HashSet};
use std::fs::File;
use std::io::{BufReader, Read};
type NodeWeightResolver =... |
use druid::widget::{Click, ControllerHost, Label, LabelText};
use druid::{theme, Affine, Data, Insets};
use druid::{widget::prelude::*, Color, Key};
use tracing::{instrument, trace};
// the minimum padding added to a button.
// NOTE: these values are chosen to match the existing look of TextBox; these
// should be ree... |
use ::nom;
use ::yaml_rust;
use ::yaml_rust::Yaml;
use ::errors::*;
const KEYCHARS: &str = "<KEY>";
#[derive(Debug, Clone, PartialEq)]
pub enum YamlPathElem {
Down(String),
Up,
Root
}
pub type YamlPath = Vec<YamlPathElem>;
/*pub fn path_str(p: &YamlPath) -> String { // TODO Surely this can be done more cleanly (... |
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
mod combine;
use std::iter;
use std::ops::Range;
use combine::{Combine, Cut, Difference, Intersection, SymmetricDifference, Union};
use crate::range::RangeSize;
/// A trait for iterators over `Range<u64>`.
///
/// Requirements:
//... |
use std::{convert::TryInto, fmt};
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;
use yaserde_derive::{YaDeserialize, YaSerialize};
use crate::{
Attribution, ConfidenceLevel, EnumAsString, EvidenceReference, Fact, Id, Identifier, Lang,
Note, Person, ResourceReference, Result, Sourc... |
use std::ops::{Deref, DerefMut};
use bytes::{Bytes, BytesMut};
use sqlx_rt::TcpStream;
use crate::error::Error;
use crate::ext::ustr::UStr;
use crate::io::{BufStream, Encode};
use crate::mssql::protocol::col_meta_data::ColMetaData;
use crate::mssql::protocol::done::{Done, Status as DoneStatus};
use crate::mssql::prot... |
use itertools::Itertools;
use std::collections::HashMap;
use crate::card::{Card, PRIMES};
const MAX_STRAIGHT_FLUSH: i32 = 10;
const MAX_FOUR_OF_A_KIND: i32 = 166;
const MAX_FULL_HOUSE: i32 = 322;
const MAX_FLUSH: i32 = 1599;
const MAX_STRAIGHT: i32 = 1609;
const MAX_THREE_OF_A_KIND: i32 = 2467;
const MAX_TWO_PAIR: i... |
use crate::core::ribosome::CallContext;
use crate::core::ribosome::HostFnAccess;
use crate::core::ribosome::RibosomeError;
use crate::core::ribosome::RibosomeT;
use futures::StreamExt;
use holochain_cascade::Cascade;
use holochain_p2p::actor::GetLinksOptions;
use holochain_types::prelude::*;
use holochain_wasmer_host::... |
use super::Path;
use quote::ToTokens;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use syn::Attribute;
#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug, Default)]
pub struct Docs(String, Option<RustLink>);
impl Docs {
pub fn from_attrs(attrs: &[Attribute]) -> Self {
... |
#![warn(clippy::all, clippy::nursery)]
#[macro_use]
extern crate log;
#[macro_use]
extern crate serde_json;
use actix_web::http::StatusCode;
use actix_web::{
guard, middleware, web, App, Error, HttpRequest, HttpResponse, HttpServer, Result,
};
use futures::{Future, Stream};
use handlebars::Handlebars;
//use ser... |
//! Test application for JWTs.
#![no_std]
#![no_main]
#![feature(default_alloc_error_handler)]
extern crate alloc;
use alloc_cortex_m::CortexMHeap;
use anyhow::anyhow;
use chrono::{DateTime, Duration, TimeZone, Utc};
use cortex_m_rt::entry;
use cortex_m_semihosting::{debug, hprintln, syscall};
use panic_halt as _;
u... |
use std::{
process,
sync::atomic::{AtomicUsize, Ordering},
};
use lazy_static::lazy_static;
use serde::Serialize;
use crate::logging::log_level::*;
static mut LOG_SETTINGS_PROVIDER: &'static dyn LogSettingsProvider = &NopLogSettingsProvider;
static LOG_SETTINGS_STATE: AtomicUsize = AtomicUsize::new(0);
#[d... |
use {
crate::{ConstantIndex, ConstantIndexTryFromOutOfRange},
std::{
collections::{hash_map::DefaultHasher, HashMap},
convert::TryFrom,
fmt,
hash::{Hash, Hasher},
ops::Range,
sync::Arc,
},
};
// An entry in the list of constants contained in a [ConstantPool]
... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control"]
pub ctl: CTL,
#[doc = "0x04 - Status"]
pub stat: STAT,
#[doc = "0x08 - Result Result of last TDC conversion."]
pub result: RESULT,
#[doc = "0x0c - Saturation Configuration"]
pub satcfg: SATCFG,
... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control Register"]
pub dacc_cr: DACC_CR,
#[doc = "0x04 - Mode Register"]
pub dacc_mr: DACC_MR,
#[doc = "0x08 - Trigger Register"]
pub dacc_trigr: DACC_TRIGR,
_reserved3: [u8; 4usize],
#[doc = "0x10 - Channel... |
use crate::{
lang::{
name::{Name, NameType},
Gender,
},
polytope::r#abstract::rank::Rank,
};
use super::{GreekPrefix, Language, Options, Position, Prefix};
/// The Spanish language.
pub struct Es;
impl GreekPrefix for Es {
const UNITS: [&'static str; 10] = [
"", "hena", "di", ... |
// Copyright 2019-2020 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) a... |
use common::{divide, alternate_divide, divide_f, RD};
use common::cycles_of_days::{nth_kday as base_nth_kday};
// gregorian 1/1/1
pub const EPOCH: RD = 1;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Gregorian {
pub year: i32,
pub month: i32,
pub day: i32
}
/// every 4th year besides every 100... |
// Keep in mind that Rust is a statically typed language,
// which means that it must know the types of all
// variables at compile time
fn main() {
println!("\nvariables()");
variables();
println!("\ndata_types()");
data_types();
println!("\nfunctions()");
functions();
println!("\ncon... |
#[macro_use]
extern crate serde_derive;
use crate::pes::PES;
use crate::pes::Gaussian;
use crate::image::{Image, ImageConfig};
use crate::chain::{Chain, ChainConfig};
use crate::point::Point;
use std::time::SystemTime;
use std::{fs, env};
use std::process::exit;
mod point;
mod pes;
mod image;
mod chain;
#[derive(Deb... |
mod audio;
use std::rc::Rc;
use euclid::{point2, vec2};
use wasm_bindgen::{closure::Closure, JsCast};
use web_sys::{HtmlElement, KeyboardEvent, MouseEvent, WheelEvent};
use crate::{
gl,
input::{InputEvent, Key, MouseButton},
};
pub use audio::start_audio_playback;
pub fn run<F, U>(title: &str, size: (u32, ... |
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
to_binary, Addr, CosmosMsg, Decimal, Deps, DepsMut, Env, MessageInfo, Reply, ReplyOn, Response,
StdError, SubMsg, Uint128, WasmMsg,
};
use cw2::{get_contract_version, set_contract_version, ContractVersion};
use protobuf::Messag... |
use crate::{addr::Endpoint, auth::*, core::*, error::*, *};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
/// A `Server` socket is a socket used for advanced request-reply messaging.
///
/// A `Server` socket talks to a set of [`Client`] sockets. The [`Client`] must
/// first initiate the conversation, wh... |
use super::internal::Header;
use super::{
Error, PropertyValue, RawNodeConstructor, RawPropertyConstructor, Reader, Result,
SerializedBuffer, StringsBlock, StructItem, TOKEN_SIZE,
};
use as_slice::AsSlice;
use core::convert::TryInto;
pub fn make_new_strings_block_with<'a, const M: usize>(
name_list: &'a [&... |
use gpt;
use gpt::disk;
use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::io::{Seek, SeekFrom, Write};
use std::path;
use tempfile::NamedTempFile;
#[test]
fn test_gptconfig_empty() {
let tempdisk = NamedTempFile::new().expect("failed to create tempfile disk");
let cfg = {
let c1 = gp... |
use super::{StreamTy, TypeConstraint, ValueTy};
use ena::unify::{
EqUnifyValue, InPlace, InPlaceUnificationTable, Snapshot, UnificationStore, UnificationTable, UnifyKey, UnifyValue,
};
use log::{debug, trace};
/// Main data structure for the type unfication.
/// Implemented using a union-find data structure where ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.