text stringlengths 7.05k 33.9k |
|---|
use std::collections::HashMap;
use std::fmt::{self, Display};
use containers::Scope;
use mir::{self, Mir, TypeError};
use parse::{ItemVariant, Parser, ParserError, ParserErrorVariant, Spanned};
// user defined types will be strings
#[derive(Clone, Debug)]
pub enum StringlyType {
UserDefinedType(String),
Unit,... |
#![cfg_attr(not(feature = "std"), no_std)]
/// A runtime module template with necessary imports
/// Feel free to remove or edit this file as needed.
/// If you change the name of this file, make sure to update its references in runtime/src/lib.rs
/// If you remove this file, you can remove those references
/// For m... |
use chrono::{DateTime, Duration, Utc};
use futures::executor::block_on;
use log::LevelFilter;
use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard};
use rand::{rngs::OsRng, Rng};
use rocket::{
fairing::{self, Fairing, Info},
http::{Cookie, Status},
outcome::{try_outcome, Outcome},
request::{FromRe... |
mod liquidity_verify;
mod swap_verify;
mod utils;
use alloc::vec::Vec;
use core::result::Result;
// Import CKB syscalls and structures
// https://nervosnetwork.github.io/ckb-std/riscv64imac-unknown-none-elf/doc/ckb_std/index.html
use share::cell::{InfoCellData, SUDTAmountData};
use share::ckb_std::{
ckb_constants... |
use nom::error::ErrorKind;
use nom::{Err, IResult};
use nom::bytes::complete::take;
use nom::multi::count;
use nom::number::complete::{le_u16, le_u8};
use std::fmt::{Display, Formatter, Result};
use std::string::FromUtf8Error;
/// Different file types
#[derive(Clone, Copy, Debug)]
pub enum FileType {
/// Text fi... |
use super::TermInfo;
use crate::common::{BinarySerializable, VInt};
use crate::common::{CompositeWrite, CountingWriter};
use crate::core::Segment;
use crate::directory::WritePtr;
use crate::fieldnorm::FieldNormReader;
use crate::positions::PositionSerializer;
use crate::postings::compression::{BlockEncoder, VIntEncoder... |
extern crate gfx;
use graphics::{ Context, DrawState, Graphics, Viewport };
use graphics::BACK_END_MAX_VERTEX_COUNT as BUFFER_SIZE;
use graphics::draw_state;
use graphics::color::gamma_srgb_to_linear;
use Texture;
use gfx::format::{DepthStencil, Srgba8};
use gfx::pso::PipelineState;
use shader_version::{ OpenGL, Shade... |
use std::borrow::Cow;
use std::collections::BTreeMap;
use std::path::{Path, PathBuf};
use rustc_ast::ast;
use rustc_ast::visit::Visitor;
use rustc_span::symbol::{self, sym, Symbol};
use rustc_span::Span;
use thiserror::Error;
use crate::attr::MetaVisitor;
use crate::config::FileName;
use crate::items::is_mod_decl;
us... |
use std::default::Default;
use std::sync::mpsc::{SyncSender, Sender, Receiver, RecvTimeoutError, sync_channel};
use std::time::{SystemTime, Duration};
use std::io::Cursor;
use std::thread;
use std::cmp::min;
use bytes::{Buf};
use byteorder::{LittleEndian};
use ccsds_primary_header::primary_header::*;
use c... |
//! # nkeys
//!
//! The `nkeys` is a Rust port of the official NATS [Go](https://github.com/nats-io/nkeys) nkeys implementation.
//!
//! Nkeys provides library functions to create ed25519 keys using the special prefix encoding system used by
//! NATS 2.0+ security.
//!
//! # Examples
//! ```
//! use nkeys::KeyPair;
//!... |
// Copyright 2018 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 agreed t... |
use std::{
fmt::Display,
io::{self, Read},
path::PathBuf,
sync::Arc,
thread,
time::Duration,
};
use druid::{
im::Vector,
image::{self, ImageFormat},
Data, ImageBuf,
};
use itertools::Itertools;
use once_cell::sync::OnceCell;
use parking_lot::Mutex;
use psst_core::{
session::{acc... |
use super::events::{ConfigType, Event, EventBody, EventProvider, Result, WordWrapMode};
use crate::config::Config;
use crate::icons::*;
use chrono::prelude::*;
use git2::{Commit, Repository};
use regex::Regex;
use std::collections::{HashMap, HashSet};
// git2 revwalk
// https://github.com/rust-lang/git2-rs/blob/master... |
use crate::utils::Bits;
use crate::cpu::STAT_INTERUPT;
use crate::cpu::V_BLANK_INTERUPT;
pub const CONTROL_REGISTER: u16 = 0xFF40;
pub const STATUS_REGISTER: u16 = 0xFF41;
// Memory address storing the current scanline
pub const LY_REGISTER: u16 = 0xFF44;
pub const LYC_REGISTER: u16 = 0xFF45;
// Palette to fetch co... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Version ID Register"]
pub verid: crate::Reg<verid::VERID_SPEC>,
#[doc = "0x04 - Parameter Register"]
pub param: crate::Reg<param::PARAM_SPEC>,
_reserved2: [u8; 0x08],
#[doc = "0x10 - ADC Control Register"]
pub c... |
// 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.
//! Socket features exposed by netstack3.
pub(crate) mod udp;
use std::convert::{TryFrom, TryInto};
use std::num::NonZeroU16;
use fidl::endpoints::{Clie... |
//! A renderer for Conrod primitives.
use crate::context::{Context, Texture};
use crate::resource::{AllocationType, BufferType, Effect, GPUVec, ShaderAttribute, ShaderUniform};
use crate::text::Font;
use conrod::position::Rect;
use conrod::text::GlyphCache;
use conrod::{render::PrimitiveKind, Ui};
use na::{Point2, Poi... |
//! The main end-user interface to the meta-tracing system.
#[cfg(feature = "c_testing")]
use std::env;
use std::{
cell::Cell,
cmp,
collections::VecDeque,
ffi::c_void,
marker::PhantomData,
mem::forget,
ptr,
sync::{
atomic::{AtomicU32, AtomicUsize, Ordering},
Arc,
},
... |
#![doc = include_str!("../doc/intro.md")]
//!
//! ### Types
//!
//! | min | max | type | notes |
//! | ----------:| ----------:| ------------------------------------------- | ----- |
//! | 0 | 0xFFFF | [`ErrorCode`]
//! | 0 | 0x7FFFFFFF | [`HRes... |
//! Bounds-checking for SPIR-V output.
use super::{selection::Selection, Block, BlockContext, Error, IdGenerator, Instruction, Word};
use crate::{arena::Handle, back::BoundsCheckPolicy};
/// The results of emitting code for a left-hand-side expression.
///
/// On success, `write_expression_pointer` returns one of the... |
use serde::{Deserialize, Serialize};
use type_uuid::*;
use crate::{
AssetManager, DefaultAssetTypeHandler, DefaultAssetTypeLoadHandler, ImageAsset, ShaderAsset,
};
use distill::loader::handle::Handle;
use fnv::FnvHashMap;
use rafx_api::{
RafxBlendState, RafxBlendStateRenderTarget, RafxCompareOp, RafxCullMode, ... |
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
use std::path::{PathBuf, Path};
use std::collections::{HashSet, VecDeque};
use std::net::SocketAddr;
use std::sync::{Mutex, Arc, RwLock};
use std::sync::atomic::{Ordering, AtomicU64};
use std::ops::Deref;
use tokio::io::{AsyncReadExt, AsyncWriteExt, ErrorKind};
use tokio::net::TcpStream;
use tokio::sync::mpsc;
use se... |
use actix_web::{AsyncResponder, Error, HttpRequest, HttpResponse, HttpMessage, error::ErrorBadRequest,
error::ErrorForbidden, error::ErrorInternalServerError, error::ErrorNotFound,
http::header, Responder};
use rusoto_s3::*;
use futures::{future, stream, Future, Stream};
use bytes::Bytes... |
use crate::{
pem::{to_pem, Pem},
private::{private_key_info::PrivateKeyValue, PrivateKeyInfo, SubjectPublicKeyInfo},
};
use picky_asn1::wrapper::{IntegerAsn1, OctetStringAsn1Container};
use picky_asn1_der::Asn1DerError;
use snafu::{ResultExt, Snafu};
#[derive(Debug, Snafu)]
pub enum KeyError {
/// asn1 ser... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved0: [u8; 120usize],
#[doc = "0x78 - Enable Constant Latency mode"]
pub tasks_constlat: TASKS_CONSTLAT,
#[doc = "0x7c - Enable Low-power mode (variable latency)"]
pub tasks_lowpwr: TASKS_LOWPWR,
_reserved2: [u8; 136usize],
... |
// 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>.
//! Player-character stuff.
use cgmath::{
Deg, ElementWise as _, EuclideanSpace as _, InnerSpace as _, Matrix3, Matrix4, Point3, Vector3,
};
use num_traits::... |
use crate::cdsl::instructions::{InstSpec, Instruction, InstructionPredicate};
use crate::cdsl::operands::{OperandKind, OperandKindFields};
use crate::cdsl::types::ValueType;
use crate::cdsl::typevar::{TypeSetBuilder, TypeVar};
use cranelift_entity::{entity_impl, PrimaryMap, SparseMap, SparseMapValue};
use std::fmt;
u... |
use crate::primitives::*;
use crate::rules::{
payoutdecider::*, rulesbettel::*, rulesramsch::*, rulesrufspiel::*, rulessolo::*, *,
};
use crate::util::*;
use std::{fs::File, io::prelude::*, path::Path};
#[derive(Debug, Clone)]
pub struct SRuleGroup {
pub str_name : String,
pub vecorules : Vec<Option<Box<dy... |
use crate::logic::{ModifierId, MODIFIERS};
use crate::{collection, info_timed, Cache};
use dashmap::DashMap;
use itertools::Itertools;
use log::{info, warn};
use once_cell::sync::Lazy;
use opencv::core::{min_max_loc, Point, Scalar, CV_32F, CV_8U};
use opencv::imgcodecs::IMREAD_COLOR;
use opencv::imgproc::{cvt_color, CO... |
extern crate pancurses;
use std::fs::File;
use std::io::Read;
use pancurses::*;
use std::env;
use std::cmp;
mod data;
use data::*;
mod helpers;
use helpers::*;
mod render;
use render::*;
fn main() {
let window = initscr();
start_color();
use_default_colors();
noecho();
window.keypad(true);
init_pair(... |
use anyhow::{Result};
use devtimer::DevTime;
use indxvec::{printing::*, Indices, Vecops,Printing};
use rstats::{i64tof64, Med, Stats, VecVec, VecVecg, Vecf64, Vecg, Vecu8};
use ran::{*,generators::{set_seeds,ranvu8,ranvvu8,ranvvf64}};
pub const EPS: f64 = 1e-10;
#[cfg(test)]
#[test]
fn u8() -> Result<()> {
let v... |
//! FROST keys, keygen, key shares
use std::{
collections::HashMap,
convert::TryFrom,
default::Default,
fmt::{self, Debug},
};
use hex::FromHex;
use rand_core::{CryptoRng, RngCore};
use zeroize::{DefaultIsZeroes, Zeroize};
use crate::{frost::Identifier, Ciphersuite, Error, Field, Group, Scalar, Verif... |
use std::collections::BTreeMap;
use std::path::{Path, PathBuf};
use std::str::FromStr;
use anyhow::{anyhow, Context, Result};
use serde::Deserialize;
use financial_planning_lib::asset::{
Asset, AssetName, Category, CategoryBound, CategoryName, Money, Rate,
};
use financial_planning_lib::events::{BuildFlows, Event... |
//
// Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Pravega vi... |
//! Implementation of event enum and event content enum macros.
use proc_macro2::{Span, TokenStream};
use quote::quote;
use syn::{
parse::{self, Parse, ParseStream},
Attribute, Expr, ExprLit, Ident, Lit, LitStr, Token,
};
use crate::event_names::{
ANY_BASIC_EVENT, ANY_EPHEMERAL_EVENT, ANY_MESSAGE_EVENT, A... |
use glib::prelude::*;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
use std::ffi::CString;
use std::os::raw::c_char;
use std::sync::Mutex;
pub use gstreamer_rtp::rtp_buffer::compare_seqnum;
pub use gstreamer_rtp::rtp_buffer::RTPBuffer;
pub use gstreamer_rtp::rtp_buffer::RTPBuffer... |
use std::thread::sleep;
use std::time::{Duration, SystemTime, SystemTimeError, UNIX_EPOCH};
pub type SequenceGeneratorSystemTimeError = SystemTimeError;
fn timestamp_from_custom_epoch(
custom_epoch: SystemTime,
micros_ten_power: u8,
) -> Result<u64, SequenceGeneratorSystemTimeError> {
let timestamp;
l... |
// Copyright 2017 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.
#![allow(non_camel_case_types,non_snake_case)]
#![deny(warnings)]
extern crate fuchsia_zircon as zircon;
use zircon::sys as sys;
use std::os::raw::c_char... |
// Copyright 2019 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
pub use crate::imp::browser_type::{RecordHar, RecordVideo};
use crate::{
api::{browser::Browser, browser_context::BrowserContext, playwright::DeviceDescriptor},
imp::{
browser_type::{
BrowserType as Impl, ConnectOverCdpArgs, LaunchArgs, LaunchPersistentContextArgs
},
core::*,... |
use serde::{Deserialize, Serialize};
use crate::{layouts::Layout, Window, Workspace};
use super::TagId;
/// Wrapper struct holding all the tags.
/// This wrapper provides convenience methods to change the tag-list
/// during its lifetime, while ensuring that all tags are in correct order
/// and numbered accordingly... |
use crate::{
aead::{Aead, AeadTag, AesGcm128, AesGcm256, ChaCha20Poly1305, ExportOnlyAead},
kdf::{HkdfSha256, HkdfSha384, HkdfSha512, Kdf as KdfTrait},
kem::{encap_with_eph, DhP256HkdfSha256, EncappedKey, Kem as KemTrait, X25519HkdfSha256},
kex::{Deserializable, KeyExchange, Serializable},
op_mode::... |
use super::events::*;
use super::glutin_thread::*;
use super::render_window::*;
use super::window_properties::*;
use super::glutin_thread_event::*;
use flo_canvas::*;
use flo_stream::*;
use flo_binding::*;
use flo_render::*;
use flo_render_canvas::*;
use ::desync::*;
use futures::prelude::*;
use futures::task::{Poll... |
#![cfg_attr(not(feature = "std"), no_std)]
/// Learn more about FRAME and the core library of Substrate FRAME pallets:
/// https://substrate.dev/docs/en/knowledgebase/runtime/frame
use codec::{Encode, Decode};
use frame_support::{decl_module, decl_storage, decl_error, decl_event, ensure, StorageValue, StorageMap, Para... |
use crate::{
FinishedMapEvent, GameState, Location, Map, MapElement, MapStyle, Materials, OnMap, Stairs,
Tile, WinSize,
};
use array2d::Array2D;
use bevy::prelude::*;
use rand::{thread_rng, Rng};
pub struct MapPlugin;
#[derive(Clone, Default)]
struct Room {
id: u32,
dummy: bool,
left: u32,
wid... |
// Copyright 2020 The Evcxr 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
use super::lve_device::*;
use ash::extensions::khr::Swapchain;
use ash::{vk, Device};
use std::rc::Rc;
pub const MAX_FRAMES_IN_FLIGHT: usize = 2;
pub struct LveSwapchain {
lve_device: Rc<LveDevice>,
swapchain: Swapchain,
pub swapchain_khr: vk::SwapchainKHR,
swapchain_image_format: vk::Format,
sw... |
use std::{
collections::{BTreeMap, VecDeque},
sync::Arc,
time::Duration,
};
use instant::Instant;
use log::{debug, info, warn};
use comn::util::{diff::Diff, stats, GameTimeEstimation, LossEstimation, PingEstimation};
use crate::{prediction::Prediction, webrtc};
pub struct ReceivedState {
pub game: c... |
use crate::transaction::{ClientInvTsx, ClientTsx, ServerInvTsx, ServerTsx, TsxKey};
use crate::transaction::{Transactions, TsxMessage};
use crate::transport::{
Direction, Factory, OutgoingParts, OutgoingRequest, OutgoingResponse, ReceivedMessage,
TpHandle, Transport, Transports, TransportsBuilder,
};
use crate:... |
use core::future::Future;
use core::pin::Pin;
use core::task::{Context, Poll};
use lpc11xx::i2c::RegisterBlock;
use lpc11xx::I2C as I2CDevice;
/// A possible error condition on the I2C bus.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Error {
/// No slave on the bus acknowledged this address.
AddressN... |
#![allow(dead_code)]
use std::collections::HashMap;
use std::fmt;
use std::hash::Hash;
use rand::Rng;
use colored::{Colorize};
use sdl2::pixels::{Color};
use sdl2::rect::Point;
use sdl2::render::{Canvas};
use sdl2::rect::Rect;
// use sdl2::surface::Surface;
use sdl2::video::{Window};
// TODO; have a struct for points... |
#![cfg_attr(not(feature = "std"), no_std)]
//! Schnorr protocol to prove knowledge of 1 or more discrete logs in zero knowledge.
//! Refer [this](https://crypto.stanford.edu/cs355/19sp/lec5.pdf) for more details of Schnorr protocol.
//!
//! We outline the steps here for your convenience, and to make this documentation... |
use std::{
ffi::CStr,
fs, mem,
os::raw::{c_uint, c_ulonglong},
panic,
path::Path,
time::Duration,
};
use std::{
ffi::CString,
os::raw::{c_char, c_longlong},
};
use anyhow::{anyhow, Context};
use identicon::{make_base64_identicon, IdenticonInput};
use mcping_common::{Player, Players, Pro... |
//! Contains methods and structs that support settings up the NNS.
use crate::util::{block_on, create_agent, get_random_application_node_endpoint, runtime_from_url};
use candid::CandidType;
use canister_test::{Canister, RemoteTestRuntime, Runtime};
use cycles_minting_canister::SetAuthorizedSubnetworkListArgs;
use dfn_c... |
// crimp - Higher-level Rust cURL API
//
// Copyright (C) 2019 <NAME>
//
// This program 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 later vers... |
use web_sys::CanvasRenderingContext2d;
use super::renderer::Renderer;
use crate::rom::{Rom, Timing};
use crate::emulator::ppu::mirroring::{Mirroring, select_mirroring};
use crate::emulator::ppu::registers::{PPUControl, PPUMask, PPUStatus, PPUScroll, PPUAddress};
use crate::emulator::ppu::palette::Palette;
use crate::in... |
// Copyright 2018 The Grin Developers
// Modifications Copyright 2019 The Gotts 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... |
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
use std::time::{Duration, Instant};
use rand::Rng;
use winit::{
dpi::LogicalSize,
event::{ElementState, Event, VirtualKeyCode, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
use crate::display;
const SCALE_FACTOR: u32 = 10;
const WIDTH: u32 = 64;
const HEIGHT: u32 = 32;
const W... |
mod codegen;
use crate::blocks::{
Block, BlockDirection, BlockEntity, BlockFace, BlockPos, ButtonFace, LeverFace,
};
use crate::plot::Plot;
use crate::world::{TickEntry, World};
use codegen::{JITBackend, JITResetData};
use log::{error, warn};
use std::collections::{HashMap, VecDeque};
fn is_wire(world: &dyn World... |
// Copyright Materialize, Inc. 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 the Apache License... |
// Copyright 2018-2020 Parity Technologies (UK) Ltd.
// This file is part of Tetcoin.
// Tetcoin 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 l... |
use chrono::Utc;
use config::Config;
use std::fs::OpenOptions;
use std::io;
use std::io::Write;
use crossterm::{
event::{self, Event, KeyCode},
execute,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
};
use std::cmp::max;
use std::error::Error;
use std::path::Pat... |
// Copyright (c) 2019 Blacknon. All rights reserved.
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.
// module
use ncurses::*;
use regex::bytes::{Matches, Regex};
use std::str;
// const
#[allow(dead_code)]
pub const IS_BOLD: i32 = 1;
#[allow(dead_code)]
pub const IS_... |
/// Status used for both invocation attempt and overall build completion.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuildStatus {
/// The end result.
#[prost(enumeration = "build_status::Result", tag = "1")]
pub result: i32,
/// Final invocation ID of the build, if there was one.
/// ... |
// 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 {
anyhow::{format_err, Context, Error},
fidl::endpoints::{create_proxy, ServerEnd},
fidl_fuchsia_component_runner as fcrunner, fidl_fuchsia... |
use crate::backend::input::KeyState;
use crate::wayland::Serial;
use std::{
cell::RefCell,
default::Default,
fmt,
io::{Error as IoError, Write},
ops::Deref as _,
os::unix::io::AsRawFd,
rc::Rc,
};
use tempfile::tempfile;
use thiserror::Error;
use wayland_server::{
protocol::{
wl_k... |
use crate::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use crate::hir;
use rustc_ast as ast;
use rustc_ast::NodeId;
use rustc_macros::HashStable_Generic;
use rustc_span::hygiene::MacroKind;
use rustc_span::Symbol;
use std::array::IntoIter;
use std::fmt::Debug;
/// Encodes if a `DefKind::Ctor` is the constructor o... |
use super::{
super::OrderedVocabIter, Cache, Error, Pair, WithFirstLastIterator, Word,
DEFAULT_CACHE_CAPACITY,
};
use crate::tokenizer::{Model, Offsets, Result, Token};
use serde_json::Value;
use std::{
collections::HashMap,
fs::File,
io::prelude::*,
io::{BufRead, BufReader},
path::{Path, Pa... |
// Copyright (c) 2017 <NAME> <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except acco... |
use std::sync::Arc;
use super::prelude::*;
use super::Categorical;
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "snake_case")]
#[serde(deny_unknown_fields)]
pub enum StringContent {
Pattern(RegexContent),
Faker(FakerContent),
DateTime(DateTimeContent),
Categorical(Ca... |
// Copyright 2020 Parity Technologies (UK) Ltd.
//
// 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, mer... |
use std::collections::{HashMap,HashSet};
use rand;
use rand::Rng;
use rand::distributions::{IndependentSample,Range};
use common::*;
use items;
struct EncryptionOracleDisclosure {
ciphertext: Vec<u8>,
is_ecb: bool
}
fn disclosing_encryption_oracle(plaintext: &[u8])
-> EncryptionOracleDisclosure {
... |
// This file is part of Substrate.
// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the F... |
// Copyright (c) 2021 <NAME>
// SPDX-License-Identifier: MIT
use super::{cpuid, _AX};
use core::arch::x86_64::{CpuidResult, __cpuid_count};
#[macro_export]
macro_rules! bitflag {
($x: expr, $pos: expr) => {
(($x >> $pos) & 1) == 1
};
}
pub struct Bmi {
pub has_popcnt: bool,
pub has_lzcnt: b... |
use super::dep_cache::RegistryQueryer;
use super::errors::ActivateResult;
use super::types::{ConflictMap, ConflictReason, FeaturesSet, ResolveOpts};
use super::RequestedFeatures;
use crate::core::{Dependency, PackageId, SourceId, Summary};
use crate::util::interning::InternedString;
use crate::util::Graph;
use anyhow::... |
// 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 {
bt_avctp::AvcCommandType,
fidl_fuchsia_bluetooth_avrcp as fidl_avrcp,
packet_encoding::{pub_decodable_enum, Decodable, Encodable},
st... |
use cranelift::prelude::*;
use std::ops::{Deref, DerefMut};
#[derive(Clone, Copy, PartialEq, Eq)]
#[allow(non_camel_case_types)]
#[repr(C)]
pub enum Op {
/// Removes an item from the top of the stack. It is undefined what happens if
/// the stack is empty.
///
/// `( a -- )`
OP_DROP = 0,
/// Du... |
//! A source processing node.
//!
//! The only supported source type is created with a URI. In the future
//! generators could also be supported, for example to display a countdown.
//!
//! The main complexity for this node is the [`starting`](State::Starting)
//! feature: when the node is scheduled to play in the futu... |
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//! This module contains a thread-local run-loop.
//!
//! The run-loop may have handles and handlers pre-registers
//! (and in fact, must) in order to kee... |
//! The shared module contains all common structs and enums used in the API
use serde::{Serialize, Deserialize};
use std::fmt;
use std::fmt::Formatter;
use std::error::Error;
use chrono::{DateTime, Utc};
/// The various loan types
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq)]
#[cfg_attr(debug_assert... |
use bytes::{Buf, BufMut, Bytes, BytesMut};
use onnx_pb::tensor_shape_proto::dimension::Value::{DimParam, DimValue};
use onnx_pb::type_proto::Value::{MapType, SequenceType, TensorType};
use onnx_pb::AttributeProto;
use std::io::Cursor;
use tensor_rs::tensor::Tensor;
#[macro_use]
extern crate derive_builder;
// https:/... |
use self::codecs::*;
use super::subs::ChunkStream;
use crate::config::get_config;
use crate::error::{bail, Result};
use collection::TimeSpan;
use futures::prelude::*;
use mime::Mime;
use std::borrow::Cow;
use std::ffi::OsStr;
use std::fmt::Debug;
#[cfg(feature = "transcoding-cache")]
use std::pin::Pin;
use std::process... |
//! Mockchain ledger. Ledger exists in order to update the
//! current state and verify transactions.
use crate::block::{ChainLength, ConsensusVersion, HeaderHash};
use crate::config::{self, ConfigParam};
use crate::fee::LinearFee;
use crate::message::Message;
use crate::stake::{DelegationError, DelegationState, Stake... |
// Copyright 2022 pyke.io
// 2019-2021 Tauri Programme within The Commons Conservancy
// [https://tauri.studio/]
//
// 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... |
use std::ops::{Index, IndexMut};
use std::{cmp, fmt, mem, slice};
#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug, Hash, Deserialize, Serialize)]
/// A node identifier within a particular `Arena`
pub struct NodeId {
index: usize,
}
#[derive(PartialEq, Clone, Debug, Deserialize, Serialize)]
/// A node wi... |
//! The [AXP209](http://dl.linux-sunxi.org/AXP/AXP209_Datasheet_v1.0en.pdf)
//! is a power management chip made by X-Powers for use mainly
//! in Allwinner ARM system-on-a-chip reference designs. It can be found
//! in quite a few systems, so if you've got a strange need to control
//! it from a supported Rust target, ... |
//! Functions and types for reading and writing to standalone bindles
use std::collections::HashMap;
use std::convert::TryInto;
use std::path::{Path, PathBuf};
use tokio::fs::File;
use tokio::io::{AsyncRead, AsyncWriteExt};
use tokio_stream::{Stream, StreamExt};
use tokio_util::codec::{BytesCodec, FramedRead};
use tra... |
// Fix usage of intern and resolve
// In some places, we do intern, however in others we are resolving and interning
// Ideally, I want to separate the interning and resolving abstractly
// so separate functions, but combine them naturally
// This could be possible, if lowering, is given a mutable map/scope as a parame... |
use crate::agent_store::AgentInfoSigned;
use crate::types::gossip::*;
use crate::types::*;
use ghost_actor::dependencies::tracing;
use kitsune_p2p_types::config::*;
use kitsune_p2p_types::metrics::*;
use kitsune_p2p_types::tx2::tx2_api::*;
use kitsune_p2p_types::tx2::tx2_utils::*;
use kitsune_p2p_types::*;
use std::col... |
//TODO: Serde Support
//TODO: Clean up docs
//TODO: Build instructions
//! Bindings to [gitstatusd](https://github.com/romkatv/gitstatus)
//!
//! *gitstatusd* is a c++ binary that provides extreamly fast alternative
//! to `git status`. This project is a library that make comunicating with
//! that binary easier.
//!... |
/*
* Copyright 2019 Comcast Cable Communications Management, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... |
// Copyright (c) 2019 <NAME> <<EMAIL>>,
// <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 righ... |
use core::convert::TryInto;
use bit_field::BitField;
use libvmm_macros::*;
use x86::{bits64::vmx, vmx::Result as VmResult};
use super::definitions::{VmxExitReason, VmxInstructionError};
use super::flags::{EPTPointer, InterruptInfo, InvEptType};
/// B.1.1 16-Bit Control Fields
#[vmcs_access(16, "RW")]
#[derive(Debug,... |
use crate::device::{EventStream, HardwareDevice, InputHardwareDevice};
use crate::device_core::{DeviceReadCore, SynchronizedDeviceReadCore};
use crate::{dht22_lib, poll, prom, Result};
use alloy::config::{InputValue, InputValueType};
use embedded_hal as hal;
use failure::err_msg;
use prometheus::core::{AtomicI64, Gener... |
use gui_node;
use build;
use commands::{Command, CommandGroup, CreateConnectionCommand, CreateNodeCommand,
DeleteNodeCommand, DisconnectCommand, UndoStack};
use params::{CommandLine, CreateState, InteractionMode, Params};
use Node;
use NodeUI;
use NodeUIData;
use widgets;
use commandline;
use std::rc::R... |
use crate::robot_modules::robot_configuration_module::RobotConfigurationModule;
use crate::robot_modules::robot_dof_module::RobotDOFModule;
use crate::utils::utils_files_and_strings::robot_folder_utils::*;
use crate::utils::utils_parsing::yaml_parsing_utils::get_yaml_obj;
use crate::utils::utils_files_and_strings::file... |
#[cfg(unix)]
use std::os::unix::io::RawFd;
#[cfg(windows)]
use winapi::{
shared::{
minwindef::{DWORD, FALSE},
ntdef::NULL,
},
um::{
consoleapi::{GetConsoleMode, ReadConsoleInputW, SetConsoleMode},
fileapi::GetFileType,
handleapi::INVALID_HANDLE_VALUE,
process... |
use rls::actions::hover::tooltip;
use rls::actions::{ActionContext, InitActionContext};
use rls::config;
use rls::lsp_data::MarkedString;
use rls::lsp_data::{ClientCapabilities, InitializationOptions};
use rls::lsp_data::{Position, TextDocumentIdentifier, TextDocumentPositionParams};
use rls::server::{Output, RequestId... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.