text stringlengths 9.08k 47.9k |
|---|
/*!
Application ([`FFI`])
[`FFI`]: rokol_ffi::app
[`Rokol::run`](crate::glue::sapp::Rokol::run) runs an implementation of [`RApp`].
*/
use std::{
ffi::{c_void, CStr, CString},
os::raw::c_char,
};
use {bitflags::bitflags, rokol_ffi::app as ffi};
// -----------------------------------------------------------... |
use std::process::Stdio;
use std::sync::Arc;
use std::{collections::HashMap, hash::Hash};
use failure::Fail;
use futures::FutureExt;
use ghub::v3::branch::DeleteBranchInput;
use ghub::v3::client::GithubClient;
use ghub::v3::pull_request as github_pull_request;
use ghub::v3::pull_request::GithubMergeMethod;
use phab_li... |
#[derive(Debug)]
pub enum Currency {
AED, // United Arab Emirates dirham
AFN, // Afghan afghani
ALL, // Albanian lek
AMD, // Armenian dram
ANG, // Netherlands Antillean guilder
AOA, // Angolan kwanza
ARS, // Argentine peso
AUD, // Australian dollar
AWG, // Aruban florin
AZN, // A... |
// TODO
// - Test difference between blake2-rfc and blake2
// The Structure
// Basic Idea of Generation: PK (Hex) --> [Blake2b] Hash (Hex) --> ID (BASE32) | Sign with Private Key
// Recomendations
// It is recomended that you use SPHINCS+ for code-signing. It is highly secure with good security assumptions but is sl... |
// Copyright 2018 The proptest 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 a... |
//
// Copyright (c) 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, dis... |
//! Helpers for making [`AdminRequest`]s to the admin api.
//!
//! This module is designed for use in a CLI so it is more simplified
//! then calling the [`CmdRunner`] directly.
//! For simple calls like [`AdminRequest::ListSafs`] this is probably easier
//! but if you want more control use [`CmdRunner::command`].
use ... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Start HFCLK crystal oscillator"]
pub tasks_hfclkstart: TASKS_HFCLKSTART,
#[doc = "0x04 - Stop HFCLK crystal oscillator"]
pub tasks_hfclkstop: TASKS_HFCLKSTOP,
#[doc = "0x08 - Start LFCLK source"]
pub tasks_lfclkstar... |
/// コンピューター将棋 通信部 USIプロトコル Rustフレームワーク
use std::fmt;
/// Fileは筋、Rankは段。1~9を使用。
pub const FILE0: i8 = 0; // 0筋は投了フラグとしても使用。
pub const FILE9: i8 = 9;
pub const FILE10: i8 = 10;
pub const RANK0: i8 = 0;
pub const RANK1: i8 = 1;
pub const RANK10: i8 = 10;
/// 1~9段を a~i段に変換。
pub fn num_to_lower_case(num:i8)->&'static str{
... |
use serde::Serialize;
use spacetraders::{shared, responses};
use sqlx::postgres::{PgPoolOptions, PgRow};
use sqlx::{Row, PgPool};
use chrono::{Utc, DateTime};
use std::cmp::Ordering::Equal;
use spacetraders::shared::Good;
use std::collections::HashMap;
use spacetraders::errors::SpaceTradersClientError;
use crate::ship_... |
/// Contains functions, structs, and enums for storing and manipulating the quantum state.
use crate::errors::CircuitError;
use crate::iterators::*;
use crate::pipeline::Representation;
use crate::rayon_helper::*;
use crate::utils::*;
use crate::{Complex, Precision};
use num::One;
use std::cmp::{max, min};
use std::fmt... |
// Copyright 2021 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//! Implement the driver side of virtio queue handling.
//! The virtqueue struct is expected to be used in userspace VFIO virtio drivers.
use std::mem... |
use hardware::apu::AudioBuffer;
use hardware::handler_holder::Key;
pub use hardware::opcodes::OpCode;
use hardware::ppu::ScreenBuffer;
use hardware::timer_controller::TimerController;
use std::cell::RefCell;
#[cfg(feature = "debugger")]
use std::collections::HashSet;
pub const CYCLES_PER_STEP: usize = 2;
#[derive(D... |
//! Texture creation and modification.
//!
//! "Texture" is an overloaded term. In gfx-rs, a texture consists of two
//! separate pieces of information: an image storage description (which is
//! immutable for a single texture object), and image data. To actually use a
//! texture, a "sampler" is needed, which provides... |
// Copyright 2019. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclai... |
use crate::tokens::Token;
use lazy_regex::{regex, regex_captures};
fn err_message<T>(file_name: &str, line_num: usize, message: &str) -> Result<T, String> {
Err(format!(
"File: {}, Line: {}: {}",
file_name,
line_num + 1,
message
))
}
pub fn remove_comments(contents: String) -> ... |
// Copyright 2017-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) a... |
// PACKET PROCESSING ENGINE
//
// This module implements configuration and execution of the packet processing
// engine.
//
// EngineStats - struct containing global engine statistics
// stats() -> EngineStats - get engine statistics
// EngineState - struct representing engine state
// state() -> &'static Engin... |
//! 3x3x3 Rubik's cube.
use cgmath::{Deg, EuclideanSpace, Matrix4, Point3, Transform, Vector3, Zero};
use rand::Rng;
use std::fmt;
use std::ops::{Add, Index, IndexMut, Mul, Neg};
use super::{
traits::*, LayerMask, PieceType, PuzzleType, Sign, StickerGeometry, StickerGeometryParams,
TwistDirection2D, TwistMetr... |
use core;
#[repr(C)]
#[derive(Debug,Clone,Copy, PartialEq)]
#[no_mangle]
pub enum BroCatliResult {
Success = 0,
NeedsMoreInput = 1,
NeedsMoreOutput = 2,
BrotliFileNotCraftedForAppend = 124,
InvalidWindowSize = 125,
WindowSizeLargerThanPreviousFile = 126,
BrotliFileNotCraftedForConcatenation = 127,
}
con... |
//! Configuration for the gui portion of the terminal
use crate::create_user_owned_dirs;
use crate::font::locator::FontLocatorSelection;
use crate::font::rasterizer::FontRasterizerSelection;
use crate::font::shaper::FontShaperSelection;
use crate::frontend::FrontEndSelection;
use crate::keyassignment::{KeyAssignment, ... |
use nom::{le_u8, le_u16, le_u32, le_u64, le_i8, IResult, Err, ErrorKind};
use num::FromPrimitive;
use bytes::{BytesMut, BufMut};
use ::api::{BDAddr, AddressType};
use bluez::constants::*;
use bluez::protocol::*;
#[cfg(test)]
mod tests {
use ::api::BDAddr;
use nom::IResult;
use super::*;
use super::L... |
//! A rust library for parsing date/time strings from various formats
//! and normalising to a standard fixed offset format (rfc3339).
//! Parsed date will be returned `DateTime<FixedOffset>`
//!
use chrono::{
DateTime, Datelike, FixedOffset, Local, NaiveDate, NaiveDateTime, NaiveTime, ParseError,
TimeZone,
};... |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use crate::{
defer_stream::DEFER_STREAM_CONSTANTS,
feature_flags::FeatureFlags,
inline_data_fragment::INLINE_DATA_CONST... |
// Copyright (c) 2018-2020 MobileCoin Inc.
//! A demo client for interacting with the MobileCoin test network using mobilecoind.
use chrono::Local;
use dialoguer::{theme::ColorfulTheme, Input, Select, Validator};
use grpcio::{ChannelBuilder, ChannelCredentialsBuilder};
use indicatif::{ProgressBar, ProgressStyle};
use... |
use std::mem;
use libc::c_int;
use std::slice;
use std::num::FromPrimitive;
use std::ffi::CStr;
use std::str;
pub mod ll {
#![allow(non_camel_case_types)]
use std::mem;
use libc::{c_void, c_int, c_uint, c_uchar, uint8_t, uint16_t, int16_t};
use libc::types::os::arch::c95::c_schar;
pub type SDLKey... |
#![allow(clippy::upper_case_acronyms)]
/*
TODO: This isn't all that efficient. We could gain some efficiencies using a generated lexer.
TODO: Proper lookahead.
*/
use regex::Regex;
use rust_decimal::Decimal;
use std::fmt;
use std::iter::FromIterator;
use self::context::*;
// TODO: Add in some sort of message or reas... |
use std::collections::HashMap;
use std::io::Read;
use std::io::{self, Cursor};
use std::iter::Iterator;
use std::sync::Mutex;
use anyhow::{ensure, Context, Result};
use lazy_static::lazy_static;
use log::info;
use storage_proofs::hasher::{HashFunction, Hasher};
use storage_proofs::util::NODE_SIZE;
use crate::constant... |
// This file has been modified for use in the `rote ` project.
mod builder;
pub use self::builder::*;
use super::*;
use full_rusttype::gpu_cache::{Cache, CachedBy};
use log::error;
use macros::d;
use std::{
borrow::Cow,
fmt,
hash::{BuildHasher, Hash, Hasher},
i32, mem,
};
/// A hash of `Section` data... |
use crate::channel::CONNECTION_FROM_BASE;
use crate::data::*;
use crate::internal::*;
use crate::LocalOrNot;
use crate::{Tagged, Tagger};
use async_bincode::{AsyncBincodeStream, AsyncDestination};
use futures_util::{
future, future::TryFutureExt, ready, stream::futures_unordered::FuturesUnordered,
stream::TrySt... |
//! Windows is sufficiently different that it gets its own file. The code here
//! is heavily based off the generic x86_64 version, so you should read that
//! and fully understand it first.
//!
//! On x86_64, Windows differs from other platforms in a few ways:
//! - Information about the current stack is stored in the... |
use std::cell::RefCell;
pub const DEBUG_MODE: bool = false;
pub const IGNORE_TRAPS_IN: &'static str = "dlmalloc";
pub fn get_lfence() -> &'static [u8] {
&[0x0f, 0xae, 0xe8]
}
pub fn get_endbranch() -> &'static [u8] {
&[0xf3, 0x0f, 0x1e, 0xfa]
}
pub const R_RAX: u16 = 16;
pub const R_RCX: u16 = 17;
pub const... |
use super::abi::AbiBuilderMethods;
use super::asm::AsmBuilderMethods;
use super::consts::ConstMethods;
use super::coverageinfo::CoverageInfoBuilderMethods;
use super::debuginfo::DebugInfoBuilderMethods;
use super::intrinsic::IntrinsicCallMethods;
use super::misc::MiscMethods;
use super::type_::{ArgAbiMethods, BaseTypeM... |
//! ssh-keys
//!
//! this library provides pure-rust parsing, manipulation, and some basic
//! validation of ssh keys. it provides a struct for encapsulation of ssh keys
//! in projects.
//!
//! ssh-keys doesn't have the ability to generate ssh-keys. however, it does
//! allow you to construct rsa and dsa keys from the... |
// DO NOT EDIT -- generated code
use byteorder::{
ByteOrder,
ReadBytesExt
};
use serde::Serialize;
use crate::profile::enums::MesgNum;
use crate::fields::FieldDefinition;
use crate::message::GenericMessage;
mod accelerometer_data;
mod activity;
mod ant_channel_id;
mod ant_rx;
mod ant_tx;
mod aviation_attitu... |
use std::collections::HashMap;
use fraction::ToPrimitive;
use crate::{io::*, gp::*, key_signature::*, enums::*};
#[derive(Debug,Clone,PartialEq)]
pub struct Version {
pub data: String,
pub number: (u8, u8, u8),
pub clipboard: bool
}
#[derive(Debug,Clone)]
pub struct Clipboard {
pub start_measure: i3... |
#![deny(missing_docs)]
//! A thread-safe shared type-indexed map for "global" resources.
//!
//! This module provides types which implement [`Resources`](Resources), a trait
//! which allows by-type access to singletons both local to a space
//! (for example an [ECS world](crate::ecs::World)) and global
//! context ty... |
use crate::config::Config;
use crate::jet::candidate::CandidateState;
use crate::jet::TransportType;
use crate::jet_client::JetAssociationsMap;
use crate::token::{ApplicationProtocol, CurrentJrl, TokenCache};
use crate::utils::association::remove_jet_association;
use crate::utils::TargetAddr;
use crate::{ConnectionMode... |
use super::operand::{OperandRef, OperandValue};
use super::place::PlaceRef;
use super::{FunctionCx, LocalRef};
use crate::base;
use crate::common::{self, IntPredicate};
use crate::traits::*;
use crate::MemFlags;
use rustc_middle::mir;
use rustc_middle::ty::cast::{CastTy, IntTy};
use rustc_middle::ty::layout::{HasTyCt... |
#.
//!
//! The purpose of this pass is to serve as the answer to the question, "when do we generate an
//! error about this?" Ideally, all errors that can be classified as type errors are reported
//! to the u... |
/*!
This is the main algorithm implementation.
At it's heart it's simply:
1 - for each regular cell, extract its geometry with marching cubes
2 - for each transition face in the request, extract each transition cell of the face
Both extractions are similar:
- get densities for all the 8 or 9 voxels of the cell
- c... |
// Copyright (c) 2017-2018 ETH Zurich
// <NAME> <<EMAIL>>
//! A dependency resolver.
#![deny(missing_docs)]
use std::collections::{HashMap, HashSet};
use std::fmt;
use std::mem;
use futures::future::join_all;
use futures::Future;
use tokio_core::reactor::Core;
extern crate itertools;
use self::itertools::Itertools... |
//!
//! `ovr dev` SubCommand
//!
//! - make sure all names and ports are unique
//! - keep a meta file in ${ENV_BASE_DIR}
//! - write ports to the running-dir of every env
//!
use nix::{
sys::socket::{
bind, setsockopt, socket, sockopt, AddressFamily, InetAddr, IpAddr, SockAddr,
SockFlag, SockT... |
// Copyright (c) SimpleStaking and Tezedge Contributors
// SPDX-License-Identifier: MIT
//! Manages connected peers.
use std::cmp;
use std::collections::{HashMap, HashSet};
use std::iter::FromIterator;
use std::net::{IpAddr, SocketAddr};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::time... |
use super::config;
use super::server_pool::Protocol;
use super::server_pool::ServerId;
use super::server_pool::ServerPool;
use anyhow::bail;
use anyhow::Context;
use apply::{Also, Apply};
use config::OptimizationLevel;
use core::fmt;
use io::{Read, Write};
use json_comments::StripComments;
use log::debug;
use rayon::pr... |
//! Functions for handling page server configuration options
//!
//! Configuration options can be set in the pageserver.toml configuration
//! file, or on the command line.
//! See also `settings.md` for better description on every parameter.
use anyhow::{anyhow, bail, ensure, Context, Result};
use remote_storage::{Re... |
//! API Bindings for the MLB Play by Play API hosted at http://statsapi.mlb.com/api/v1/game/{game_pk}/playByPlay.<br/>
//! All data are subject to MLB Advanced Media copyright
//!
//! There are differences with respect to MLB-level data as compared to Minor League data. This means that for fields that are MLB specific... |
/// D2 Game Server Message Identifiers
/// I've merged infos from several sources on this:
/// blizzhackers: https://github.com/blizzhackers/Diablo2PacketsData/blob/main/src/data/1.14d/gs2client.json
/// MephisTools: https://github.com/MephisTools/diablo2-protocol/blob/master/data/1.14/d2gs.json
/// ServerMessage (Serv... |
use std::fmt;
use std::ops;
/// Trait for an additive (abelian) group of scalar values.
pub trait Additive: Copy + ops::Add<Self, Output = Self> + ops::Sub<Self, Output = Self> {}
impl<T: Copy + ops::Add<Self, Output = Self> + ops::Sub<Self, Output = Self>> Additive for T {}
#[derive(Debug, Clone, Copy, PartialEq, E... |
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
use super::client::Client;
use super::config::ConfigSnapshot;
use super::documents::Documents;
use super::lsp_custom;
use super::registries::ModuleRegistry;
use super::tsc;
use crate::fs_util::is_supported_ext;
use crate::fs_util::specifier_to... |
//! Error reporting machinery for lifetime errors.
use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_infer::infer::{
error_reporting::nice_region_error::NiceRegionError,
error_reporting::unexpected_hidden_region_diagnostic, NllRegionVariableOrigin,
};
use rustc_middle::mir::{ConstraintCategory, R... |
use std::collections::{BTreeMap, BTreeSet, HashSet};
use std::ffi::OsStr;
use std::fs::create_dir_all;
use std::io::Write;
use std::ops::Neg;
use std::os::unix::{
fs::{symlink, OpenOptionsExt},
process::ExitStatusExt,
};
use std::path::{Path, PathBuf};
use std::process::Stdio;
use std::str;
use std::sync::Arc;
use ... |
// 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 according to those terms.
// This file implem... |
// Copyright 2020 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 w... |
use super::*;
use crate::actors::ActorHost;
use crate::auth::Authorizer;
use crate::capability::extras::ExtrasCapabilityProvider;
use crate::capability::native_host::NativeCapabilityHost;
use crate::dispatch::Invocation;
use crate::hlreg::HostLocalSystemService;
use crate::messagebus::{GetClaims, LatticeCacheClient, Me... |
#![allow(clippy::needless_doctest_main)]
//!`system-deps` lets you write system dependencies in `Cargo.toml` metadata,
//! rather than programmatically in `build.rs`. This makes those dependencies
//! declarative, so other tools can read them as well.
//!
//! # Usage
//! In your `Cargo.toml`:
//!
//! ```toml
//! [build... |
use std::collections::{btree_map::Entry, BTreeMap};
use mio_extras::{channel as mio_channel, channel::TrySendError};
use log::{debug, info, trace, warn};
use bytes::Bytes;
use crate::{
dds::reader::Reader,
messages::{
protocol_version::ProtocolVersion,
submessages::submessages::{EntitySubmessage, *},
... |
/*!
A `Matcher` holds the state of the matching algorithm as it walks the
expression tree looking for a match. Most importantly, it keeps track of the
substitutions that are currently active.
In terms of Dundua, `Matcher` keeps track of $S$ and $\Gamma$. The set $S$ is the
set of active `MatchGenerator`s. Since futur... |
use crate::asserts::{assert_activate_status, assert_withdraw_amount};
use crate::querier::query_collateral_whitelist_info;
use crate::state::{
pop_bid_idx, read_bid, read_bid_pool, read_bids_by_user, read_collateral_info, read_config,
read_epoch_scale_sum, read_or_create_bid_pool, read_total_bids, remove_bid, s... |
// This file is part of Substrate.
// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// ht... |
#[cfg(feature = "tmux_2_0")]
use super::create_insert_vec;
use crate::{Error, SetOption, ShowOptions, Switch};
use std::fmt;
use std::str::FromStr;
const ON: &str = "on";
const OFF: &str = "off";
#[cfg(feature = "tmux_2_6")]
const EXTERNAL: &str = "external";
//set-clipboard [on | external | off]
#[derive(PartialEq, ... |
//!
//! Functionality for representing Cortex Exceptions.
//!
//!
use crate::bus::Bus;
use crate::core::bits::Bits;
use crate::core::fault::Fault;
use crate::core::register::{BaseReg, Ipsr, Reg};
use crate::core::reset::Reset;
use crate::peripheral::nvic::NVIC;
use crate::Processor;
use crate::ProcessorMode;
#[derive... |
// Copyright (C) 2022 Alibaba Cloud. All rights reserved.
//
// SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause)
//! Handler to cooperate with Linux fscache subsystem for blob cache.
use std::cmp;
use std::collections::hash_map::Entry::Vacant;
use std::collections::HashMap;
use std::convert::TryFrom;
use std::f... |
#![no_std]
mod conf;
mod register;
use core::fmt::Debug;
use embedded_hal as hal;
use hal::blocking::spi;
use hal::digital::v2::OutputPin;
pub use accelerometer::{Accelerometer, RawAccelerometer, error, Error, vector::{I32x3, F32x3}};
pub use conf::*;
use register::Register;
use crate::OutputDataRate::{ODR_3200_H... |
use parcelable_derive::Parcelable;
use crate::{Error, Parcelable, parcel::Parcel};
use nix::{
fcntl::{
OFlag,
open,
},
ioctl_readwrite,
ioctl_write_int,
ioctl_write_ptr,
sys::{
mman::{
MapFlags,
mmap,
ProtFlags,
},
stat... |
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(clippy::upper_case_acronyms)]
/// Length of config word sector in words
pub const CONFIG_SECTOR_LENGTH: usize = 4;
type USERID = u16;
/// Alternate I/O Select for I2C1
pub enum AI2C1 {
/// I2C1 uses the ASDA1/ASCL1 pins
ON = 0x1,
/// I2C1... |
use crate::constants::*;
use crate::errors::VcsrError;
use clap::arg_enum;
use image;
use serde::Deserialize;
use std::{
error::Error,
fmt, io,
path::Path,
process::{Command, Stdio},
str,
str::FromStr,
};
use structopt::StructOpt;
use rustfft::{num_complex::Complex, num_traits::Zero, FFTplanner... |
//! Utility types and functions related to farming.
use crate::{
config::FarmingHerbsConfig,
utils::{
diary::AchievementDiaryLevel, fmt, item, item::WIKI_ITEM_CLIENT,
magic::Spell,
},
};
use derive_more::Display;
use serde::{Deserialize, Serialize};
use std::fmt::Display;
use strum::EnumIte... |
// Copyright (c) Facebook, Inc. and its affiliates.
//
// 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 applicabl... |
#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case,
non_upper_case_globals, unused_assignments, unused_mut)]
use std::{
collections::HashMap,
io,
ffi::OsStr,
mem::forget,
os::unix::{
ffi::OsStrExt,
io::FromRawFd,
},
pin::Pin,
rc::Rc,
};... |
// Copyright 2014 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 ... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
// Transformation which injects specifications (Move function spec blocks) into the bytecode.
use itertools::Itertools;
use move_model::{
ast,
ast::{Exp, TempIndex, Value},
model::{FunId, FunctionEnv, GlobalEnv, Loc, Modul... |
use crate::{
collector,
content_length::ContentLength,
message::Message,
metrics::{FUTURE_STARTED, REQUEST_STARTING},
plan::{EngineCall, Plan},
stats::Fact,
RequestType,
};
use backoff::backoff::Backoff;
use ic_canister_client::{update_path, Agent, HttpClientConfig, Sender as AgentSender};
u... |
use crate::abi::Size;
use crate::spec::Target;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_macros::HashStable_Generic;
use rustc_span::Symbol;
use std::fmt;
use std::str::FromStr;
macro_rules! def_reg_class {
($arch:ident $arch_regclass:ident {
$(
$class:ident,
)*
... |
use crate::{
errors::HWKeyError,
ledger::{
apdu::ApduBuilder,
manager::{LedgerKey, CHUNK_SIZE},
comm::{sendrecv}
}
};
use std::convert::TryFrom;
use std::str::{from_utf8};
use bitcoin::{
Transaction,
Script,
Address,
Network,
VarInt,
PublicKey,
SigHashType... |
// 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 std::{
collections::{BTreeMap, BTreeSet},
io::{self, stderr, Write},
path::Path,
rc::Rc,
};
use lalr1plus::{self, Parser};
use lexan;
use crate::state::{GrammarItemKey, GrammarItemSet, ParserState, Production, ProductionTail};
use crate::symbols::{format_as_macro_call, FirstsData, Symbol, SymbolTa... |
//! Functions for scanning the chain and extracting relevant information.
use ff::PrimeField;
use protobuf::parse_from_bytes;
use rusqlite::{types::ToSql, Connection, NO_PARAMS};
use std::path::Path;
use zcash_client_backend::{
decrypt_transaction, encoding::decode_extended_full_viewing_key,
proto::compact_for... |
#![allow(unused_imports)]
#![no_std]
use thermite::*;
use thermite_complex::Complex;
mod pd;
mod ps;
pub trait SimdVectorizedSpecialFunctionsPolicied<S: Simd>: SimdFloatVector<S> {
fn hermite_p<P: Policy>(self, n: u32) -> Self;
fn hermitev_p<P: Policy>(self, n: S::Vu32) -> Self;
fn jacobi_p<P: Policy>(s... |
// Copyright (c) 2021 Quark Container 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 required by applicable law ... |
//! This module provides an abstraction over the search parameters provided by
//! `scryfall`. For a complete documentation, refer to the
//! [official site](https://scryfall.com/docs/syntax).
//!
//! The main struct of this module is the [`SearchBuilder`], this represents
//! a search compatible with `scryfall` search... |
use rand::distributions::WeightedIndex;
use rand::prelude::*;
use std::cell::RefCell;
use std::cmp::{min, Ordering};
use std::collections::BinaryHeap;
use std::rc::Rc;
type NodeRef = Rc<RefCell<Node>>;
type HypothesisRef = Rc<RefCell<Hypothesis>>;
type Agenda = BinaryHeap<Hypothesis>;
struct Hypothesis {
node_ref... |
use crate::*;
/// Checks if the geometry Self intersects the geometry Rhs.
/// More formally, either boundary or interior of Self has
/// non-empty (set-theoretic) intersection with the boundary
/// or interior of Rhs. In other words, the [DE-9IM]
/// intersection matrix for (Self, Rhs) is _not_ `FF*FF****`.
///
/// T... |
//! # NFT Pallet
//!
//! The NFT pallet provides supports for non fungible assets on Litentry
//!
//! ## Overview
//!
//! The NFT pallet enables third parties to issue (mainly identity related) non fungible assets.
//! Currently there are 3 types (check `ClassType`) of non fungible assets:
//! 1. Each instance is direc... |
use crate::constants::*;
use crate::util::*;
use gdnative::api::*;
use gdnative::prelude::*;
use std::{cell::RefCell, fs::File, io::prelude::*, path::Path};
const USER_ID: &str = "000000000000000000000001";
enum SkillTree {
Adventurer,
Producer,
}
enum Confirmation {
Load,
Quit,
}
#[derive(NativeClass)]
#[i... |
use std::fs::{self, rename};
use std::fs::{File, OpenOptions};
use std::io::{Read, Seek, SeekFrom, Write};
use std::{collections::HashMap, path::PathBuf};
use log::info;
use nom::AsBytes;
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use bytes::{BufMut, BytesMut};
use serde_json::json;
use crate::c... |
// Copyright © 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
// Ignore dead and unused code in this arch when linking this with `unix`
// platform (for unit tests / clippy)
#![cfg_attr(not(target_os = "none"), allow(unused, dead_code))]
//! Contains initialization code for x86-6... |
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
mod backend;
mod protocol;
use std::cell::RefCell;
use std::collections::VecDeque;
use std::i64;
use std::mem::size_of;
use std::os::unix::io::{AsRawF... |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
extern crate rustc_serialize;
use std::cmp::{min, Eq, PartialEq, Reverse};
use std::collections::hash_map::DefaultHasher;
use std::... |
// 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 fidl_fuchsia_hardware_audio::*;
use fuchsia_async as fasync;
use fuchsia_zircon::{self as zx, DurationNum, HandleBased};
use futures::task::{Context, P... |
use std::error::Error;
use std::sync::Mutex;
use std::time::{Duration, Instant};
use std::{mem, str};
use cgmath::{Matrix4, Point3, Vector3, Vector4};
use imgui::{im_str, ImGuiCond, ImGuiInputTextFlags, StyleVar};
use imgui_ext::prelude::*;
use imgui_opengl_renderer::Renderer as ImGuiRenderer;
use imgui_sdl2::ImguiSd... |
/*!
# Lightweight embedded database
## Features
* Processing documents which implements `Serialize` and `Deserialize` traits from [serde](https://serde.rs/).
* Identifying documents using auto-incrementing integer primary keys.
* Indexing any fields of documents using unique or duplicated keys.
* Searching and order... |
// 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::log_if_err;
use crate::message::{Message, MessageReturn};
use crate::node::Node;
use crate::shutdown_request::{RebootReason, ShutdownRequest};
u... |
// Copyright (c) 2019 Chaintope Inc.
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
use std::str::FromStr;
use crate::signer_node::ROUND_INTERVAL_DEFAULT_SECS;
use bitcoin::{Address, PublicKey};
use clap::{App, Arg};
use log;
... |
use failure::{Error, Fail};
use glib::object::ObjectExt;
use gstreamer::*;
use gstreamer_sdp as gst_sdp;
use gstreamer_webrtc as gst_webrtc;
use lazy_static::lazy_static;
use rand::Rng;
use serde_derive::{Deserialize, Serialize};
use serde_json;
use std::sync::{Arc, Mutex, Weak};
use tokio::{sync::mpsc};
use tokio_exec... |
use crate::ast::ParsedDateTime;
use crate::parser::{DateTimeField, ParserError};
pub(crate) fn tokenize_interval(value: &str) -> Result<Vec<IntervalToken>, ParserError> {
let mut toks = vec![];
let mut num_buf = String::with_capacity(4);
fn parse_num(n: &str, idx: usize) -> Result<IntervalToken, ParserErro... |
// Copyright (c) The Starcoin Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::helper::{get_unix_ts, is_global};
use crate::message_processor::{MessageFuture, MessageProcessor};
use crate::net::{build_network_service, SNetworkService};
use crate::network_metrics::NetworkMetrics;
use crate::{NetworkM... |
// Copyright 2020-2021 <NAME> <<EMAIL>> and collaborators
// Licensed under the MIT License.
//! Cargo (Rust) projects.
//!
//! If we detect a Cargo.toml in the repo root, we use `cargo metadata` to slurp
//! information about all of the crates and their interdependencies.
use anyhow::{anyhow, Context};
use cargo_met... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.