text stringlengths 7.05k 33.9k |
|---|
use crate::{
compilation::{compile_validators, context::CompilationContext, JSONSchema, DEFAULT_SCOPE},
content_encoding::{
ContentEncodingCheckType, ContentEncodingConverterType,
DEFAULT_CONTENT_ENCODING_CHECKS_AND_CONVERTERS,
},
content_media_type::{ContentMediaTypeCheckType, DEFAULT_C... |
// 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
// dis... |
#[derive(Clone)]
pub struct FeatureLayer {
bias: Vec<i8>,
weight: Vec<i8>,
}
#[derive(Clone)]
pub struct AffineLayer {
bias: Vec<i16>,
weight: Vec<i8>,
}
#[derive(Clone)]
pub struct EvalValueNnueHalfKP {
feature: FeatureLayer,
affine: Vec<AffineLayer>,
}
#[derive(Clone)]
pub struct EvalValueN... |
extern crate base64;
extern crate dogstatsd;
extern crate futures;
extern crate hyper;
extern crate serde_json;
extern crate serde;
extern crate time;
extern crate tokio_core;
extern crate ring;
extern crate uuid;
use super::*;
use std::cell::RefCell;
use std::fmt::Formatter;
use std::borrow::Cow;
use std::str::FromSt... |
use crate::util::errors::internal;
use std::collections::hash_map::Entry::Occupied;
use std::collections::hash_map::Entry::Vacant;
use std::str::FromStr;
use std::fmt;
use std::mem;
use std::env;
use std::io::Read;
use std::fs::{self, File};
use std::collections::{HashSet, HashMap};
use std::path::{Path, PathBuf};
use ... |
//! Unified Tegra X1 Memory Address Map constants.
//!
//! See Chapter 2 in the Tegra X1 Technical Reference Manual for details.
/// Memory mappings of the PCIe Controller.
pub mod pcie {
/// Base address of the PCIe registers.
pub const BASE: u32 = 0x0100_0000;
/// Start address of the PCIe A1 register b... |
// Copyright (c) 2018-2021 The MobileCoin Foundation
//! SGX Quote wrapper
use alloc::{format, vec};
use crate::{
basename::{Basename, BASENAME_SIZE},
epid_group_id::{EpidGroupId, EPID_GROUP_ID_SIZE},
quote_sign::QuoteSign,
};
use alloc::{alloc::Layout, string::ToString, vec::Vec};
#[cfg(feature = "use_p... |
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
use super::gas_block_store::GasBlockStore;
use super::gas_syscalls::GasSyscalls;
use super::gas_tracker::{price_list_by_epoch, GasTracker, PriceList};
use super::ChainRand;
use actor::{
self, account, ACCOUNT_ACTOR_CODE_ID, CRON_ACTOR_... |
/*
Cryptmon
Copyright 2022 <NAME>.
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwar... |
use ::libc;
extern "C" {
#[no_mangle]
fn memset(_: *mut libc::c_void, _: libc::c_int, _: libc::c_ulong) -> *mut libc::c_void;
#[no_mangle]
fn memcpy(_: *mut libc::c_void, _: *const libc::c_void, _: libc::c_ulong) -> *mut libc::c_void;
#[no_mangle]
fn ntohl(__netlong: uint32_t) -> uint32_t;
#... |
// Copyright 2018-2020, Wayfair GmbH
//
// 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... |
use super::model_viewer::{ModelViewer, MaterialTextureBinding};
use db::{Database, ModelId, AnimationId, PatternId};
use connection::Connection;
use glium::Display;
use glium::glutin::ElementState;
use glium::{Frame, Surface};
use glium::glutin::VirtualKeyCode;
use nitro::{Model, Animation, Pattern};
use primitives::{P... |
use std::mem;
use std::path::Path;
use std::sync::Arc;
use anyhow::{anyhow, Error, Result};
use crossbeam::channel::{self, RecvTimeoutError};
use crossbeam::queue::SegQueue;
use hashbrown::HashMap;
use serde::{Deserialize, Serialize};
use sysinfo::SystemExt;
use tantivy::schema::{Field, Schema};
use tantivy::{IndexWri... |
#![deny(warnings, missing_docs, clippy::pedantic)]
#![warn(rust_2018_idioms)]
#![cfg(target_family = "unix")]
//! Yet Another Daemonizer is a daemonizing crate to easily, simply, and **correctly** create legacy
//! daemons.
//!
//! This crate focuses on manually creating a background process which is not managed by a
... |
#[macro_use]
extern crate log;
extern crate byteorder;
extern crate chrono;
extern crate lstsq;
extern crate nalgebra as na;
extern crate serde;
extern crate serialport;
extern crate thread_control;
mod datetime_conversion;
mod arduino_udev;
use crate::arduino_udev::serial_handshake;
use anyhow::{Context, Result};
u... |
// Copyright 2017 CoreOS, Inc.
//
// 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... |
//! S-Expression Parser
use crate::perr::*;
use crate::tok::*;
use crate::ast::*;
use crate::error::Source;
use crate::r8vm::R8VM;
use crate::sym_db::SymDB;
use std::io;
use fnv::FnvHashMap;
pub fn string_parse(tok: &Token) -> PResult<String> {
let mut out = String::new();
let mut it = tok.text.chars();
w... |
#![allow(non_upper_case_globals)]
use crate::{error::ModError, model::GameMode, OsuError};
use std::{
convert::{Into, TryFrom},
fmt,
str::FromStr,
};
bitflags! {
/// Enum for all game modifications.
/// Implemented as [bitflags](https://crates.io/crates/bitflags).
///
/// # Example
//... |
use crate::error::TypecheckError;
use crate::type_info_provider::TypeInfoProvider;
use crate::type_store::TypeStore;
use siko_ir::data_type_info::AdtTypeInfo;
use siko_ir::expr::Expr;
use siko_ir::expr::ExprId;
use siko_ir::function::FunctionId;
use siko_ir::pattern::Pattern;
use siko_ir::pattern::PatternId;
use siko_i... |
use super::NaiveTime;
use crate::oldtime::Duration;
use crate::Timelike;
use std::u32;
#[test]
fn test_time_from_hms_milli() {
assert_eq!(
NaiveTime::from_hms_milli_opt(3, 5, 7, 0),
Some(NaiveTime::from_hms_nano(3, 5, 7, 0))
);
assert_eq!(
NaiveTime::from_hms_milli_opt(3, 5, 7, 777)... |
use std::io::{Read, BufReader, SeekFrom, Seek};
use std::fs::File;
use std::io;
use std::mem;
use byteorder::{ReadBytesExt, BigEndian};
use crate::MidiError::UnsupportedMetaEvent;
use std::string::FromUtf8Error;
use std::convert::TryFrom;
#[derive(Debug)]
enum MidiError {
Io(io::Error),
InvalidVariableLengthQu... |
use fawkes_crypto::native::{
ecc::{EdwardsPoint, JubJubParams},
eddsaposeidon::{eddsaposeidon_sign, eddsaposeidon_verify},
num::Num,
poseidon::{poseidon_with_salt, MerkleProof, PoseidonParams},
};
use fawkes_crypto::core::{
field::{Field, PrimeField},
sizedvec::SizedVec,
};
use num::bigint::Sig... |
/*
Portions Copyright 2020-2021 ZomboDB, LLC.
Portions Copyright 2021-2022 Technology Concepts & Design, Inc. <<EMAIL>>
All rights reserved.
Use of this source code is governed by the PostgreSQL license that can be found in the LICENSE.md file.
*/
use crate::gucs;
use pgx::pg_sys::heap_tuple_get_struct;
use pgx::*;
... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - PWM Clock Register"]
pub pwm_clk: crate::Reg<pwm_clk::PWM_CLK_SPEC>,
#[doc = "0x04 - PWM Enable Register"]
pub pwm_ena: crate::Reg<pwm_ena::PWM_ENA_SPEC>,
#[doc = "0x08 - PWM Disable Register"]
pub pwm_dis: crate::R... |
use std::{
fmt::{self, Write as _},
io::{self, stdout, Write as _},
sync::atomic::{AtomicUsize, Ordering::Relaxed},
sync::RwLock,
time::{Duration, Instant},
};
// ============================================================================================== //
// [General configuration] ... |
//! HCI Layer (where most the magic happens). Implements a Bluetooth Adapter for any controller
//! supporting HCI streams.
//! (HCI Layer is Little Endian).
pub mod adapter;
pub mod adapters;
pub mod baseband;
#[cfg(all(unix, feature = "bluez_socket"))]
pub mod bluez_socket;
pub mod command;
pub mod event;
pub mod le;... |
use crate::channel_with_error::{
channel as channel_with_error, Receiver as ReceiverWithError, SendError,
Sender as SenderWithError,
};
use crate::error::*;
use crate::ffi;
use crate::swappable_stream::SwappableStream;
use picoquic_sys::picoquic::{
self, picoquic_call_back_event_t, picoquic_mark_active_stre... |
// MIT License
//
// Copyright (c) 2019-2021 <NAME> <<EMAIL>>
// Copyright (c) 2019-2021 Tangram Technologies S.R.L. <https://tngrm.io>
//
// 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 w... |
use crate::context::StaticContext;
use crate::runtime::CompiledExpr;
use crate::types::{Item, KindTest, SchemaType};
use crate::types::{Occurrence, SequenceType};
use crate::xdm::*;
use itertools::Itertools;
use rust_decimal::Decimal;
use smop_xmltree::nod::{NodeKind, QName};
use smop_xmltree::option_ext::OptionExt;
us... |
use std::sync::Arc;
use anyhow::anyhow;
use tokio::select;
use tokio::sync::mpsc::channel;
use tokio::sync::RwLock;
use tokio::time::{timeout, timeout_at, Duration, Instant};
use tokio_util::sync::CancellationToken;
use super::*;
use crate::dsync::Dsync;
use crate::trace;
use crate::utils::{rng_seed_now, sleep, sleep... |
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "std")]
use serde::{Serialize, Deserialize};
use frame_system::{
self as system, ensure_signed,
offchain::{
AppCrypto, CreateSignedTransaction,
}
};
use frame_support::{
debug, decl_module, decl_storage, decl_event,
dispatch::DispatchResult,
traits::G... |
// 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 {
crate::{
builtin::{
arguments::Arguments as BootArguments,
capability::BuiltinCapability,
kernel_stat... |
//! Utility functions
use std::{
collections::HashSet,
path::{Component, Path, PathBuf},
};
use crate::{error::SolcError, SolcIoError};
use once_cell::sync::Lazy;
use regex::{Match, Regex};
use semver::Version;
use serde::de::DeserializeOwned;
use tiny_keccak::{Hasher, Keccak};
use walkdir::WalkDir;
/// A re... |
#![feature(core_intrinsics, generators, generator_trait, is_sorted)]
use std::arch::x86_64::*;
use std::io::Write;
use std::ops::Generator;
fn main() {
println!("{:?}", std::env::args().collect::<Vec<_>>());
let mutex = std::sync::Mutex::new(());
let _guard = mutex.lock().unwrap();
let _ = ::std::it... |
/*
Copyright 2020 <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, distribute, sublicense,
... |
mod converters;
mod winit_config;
mod winit_windows;
use bevy_input::{
keyboard::KeyboardInput,
mouse::{MouseButtonInput, MouseMotion, MouseScrollUnit, MouseWheel},
touch::TouchInput,
};
pub use winit_config::*;
pub use winit_windows::*;
use bevy_app::{prelude::*, AppExit, ManualEventReader};
use bevy_ecs... |
// Copyright 2021. 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... |
extern crate ping;
extern crate pnet;
use self::pnet::packet::icmp::destination_unreachable::DestinationUnreachable;
use self::pnet::packet::icmp::echo_reply::EchoReply;
use self::pnet::packet::icmp::time_exceeded::TimeExceeded;
pub use self::ping::PingMethod;
use self::ping::{IcmpResponce, PingHandler, PingHandlerBu... |
//! MMU exporter, which produces `.mmu` ASCII proof files from an
//! [`Environment`](crate::Environment) object.
use std::collections::HashMap;
use std::io::{self, Write};
use std::mem;
use crate::{Type, Expr, Proof, AtomId, SortId, TermKind, ThmKind,
ExprNode, ProofNode, StmtTrace, DeclKey, Modifiers, FrozenEnv};
... |
//! Typed pixel formats.
//! More information on these can be found [here](https://vulkan.lunarg.com/doc/view/1.0.30.0/linux/vkspec.chunked/ch31s03.html#VkFormat)
//!
/// Normalized unsigned integer representation
#[derive(Clone, Copy, Debug, Default)]
pub struct Unorm;
/// Normalized signed integer representation
#[... |
use crate::utils::*;
use std::f64::consts::{FRAC_PI_2, PI, TAU};
/// Calculates the AABB of a arc.
pub fn arc_rect(x: f64, y: f64, radius: f64, start_angle: f64, end_angle: f64) -> Rectangle {
// Lazy calculate the AABB of its ends.
let (a_y, a_x) = f64::sin_cos(start_angle);
let (b_y, b_x) = f64::sin_cos(... |
// 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.
/// The functions in this module convert the untyped pest Pair syntax nodes to typed Definitions.
/// The next_* functions take a Pairs, an iterator over a... |
use cgmath::{vec2, Vector2};
use ndarray::{Array, Array2, ArrayViewMut2, Zip};
use std::f64::consts::PI;
mod linear;
/// 2D MAC grid
#[derive(Clone, Debug)]
pub struct MacGrid {
/// Horizontal components
u: Array2<f64>,
/// Vertical components
v: Array2<f64>,
}
#[allow(clippy::many_single_char_names)... |
use actix_web::{web, HttpResponse, Responder};
use serde::{Deserialize, Serialize};
use std::collections::{HashMap, HashSet};
use std::convert::TryFrom;
use std::io::{self, ErrorKind};
use std::path::Path;
mod converters;
pub mod descriptions;
pub mod echoinfo;
pub mod hex;
pub mod line_driver;
mod lineproto;
use con... |
// SPDX-License-Identifier: Apache-2.0
// This file is part of Frontier.
//
// Copyright (c) 2020 Parity Technologies (UK) Ltd.
//
// 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... |
//! # SDA REST server library
//!
//! This create is the server side HTTP binding for SDA. It is a library that
//! exposes the SDA service (provided by the `sda_server`) crate as a REST
//! interface.
//!
//! `sda_client_http` crate provides the reverse feature, reconstructing a SDA
//! service API on top of an HTTP ... |
use std::collections::HashMap;
use std::ffi::OsStr;
use std::fs::{File, OpenOptions};
use std::io::{BufWriter, Read, Seek, SeekFrom, Write};
use std::path::{Path, PathBuf};
use std::sync::{
atomic::{AtomicU64, Ordering},
Arc, Mutex, RwLock,
};
use bytes::ByteOrder;
use serde_json::Deserializer;
use crate::err... |
use lyon::extra::rust_logo::build_logo_path;
use lyon::path::builder::*;
use lyon::path::Path;
use lyon::math::*;
use lyon::tessellation::geometry_builder::{VertexConstructor, VertexBuffers, BuffersBuilder};
use lyon::tessellation::basic_shapes::*;
use lyon::tessellation::{FillTessellator, FillOptions};
use lyon::tesse... |
//! This module contains contains methods and a position weight matrix
//! implementation useful for detecting translataion initiation sites.
extern crate ndarray;
use ndarray::{Array2};
extern crate serde_json;
extern crate serde_derive;
use serde_derive::{Deserialize, Serialize};
use std::collections::HashMap;
u... |
use mem_map::*;
use device::Device;
use interrupt::{Irq, Interrupt};
#[allow(dead_code)] // TODO - remove when the rendering is written
const COLOUR_MAP: [u32; 4] = [0xff7e8429, 0xff527a4b, 0xff315d4b, 0xff29473e];
const WIDTH: usize = 160;
const HEIGHT: usize = 144;
pub struct Gpu {
vram: Box<[u8]>, // VRAM - ma... |
//! Rust implementation of [Constant Quark Database](http://www.chokkan.org/software/cqdb/):
//! a database library specialized for serialization and retrieval of static associations between strings and integer identifiers
use std::{
fmt,
io::{self, Seek, SeekFrom, Write},
mem,
};
use bitflags::bitflags;
u... |
use std::collections::VecDeque;
use std::marker::PhantomData;
use std::ops::Range;
use crate::error::Error;
use crate::hash::{Hash, Merge};
use crate::mmr::peaks::PeakIterator;
use crate::mmr::position::{leaf_number_to_index, Position};
use crate::mmr::proof::RangeProof;
use crate::mmr::utils::bagging;
use crate::mmr:... |
use crate::{
credentials::{
adult_prove::CredentialAdultProve, personal_identity::CredentialPersonalIdentity,
VerifiableCredential as VC,
},
error::{Error, Result},
model::{CreateVcIssuerData, UpdateVcIssuerData, VcIssuer},
service::{
chain::{ChainCredentialType, CONTRACT_CRE... |
// SPDX-License-Identifier: Apache-2.0
//! API for the hypervisor-microkernel boundary
//!
//! `sallyport` is a protocol crate for proxying service requests (such as syscalls) from an Enarx Keep
//! to the host. A [sally port](https://en.wikipedia.org/wiki/Sally_port) is a secure gateway through
//! which a defending ... |
//! 2D Affine Transformation Matrix.
//!
//! See the actual struct documentation for more information.
use super::point::Point;
use super::vec2::Vec2;
use std::f64::EPSILON;
use std::ops::Mul;
/// The 2D affine identity matrix.
pub const IDENTITY: Matrix = Matrix::IDENTITY;
/// 2D Affine Transformation Matrix.
///
... |
//! Types used for protocol request inputs (arguments) and outputs. Types
//! specific to a single protocol request will live within the respetitive
//! module. For example `protocol::place_order`.
use crate::errors::{ProtocolError, Result};
use bigdecimal::BigDecimal;
use std::str::FromStr;
use chrono::{DateTime, Utc... |
use serenity::client::Context;
use serenity::framework::standard::CommandError;
use serenity::model::id::UserId;
use serenity::model::channel::Message;
use serde_json::value::Value;
use regex::Regex;
use std::collections::HashMap;
use utils;
use utils::user::*;
use utils::config::*;
use utils::html::escape_html;
us... |
use crate::cpu::AddressingMode;
use std::collections::HashMap;
use lazy_static::lazy_static;
pub struct OpCode {
pub code: u8,
pub mnemonic: &'static str,
pub len: u8,
pub cycles: u8,
pub mode: AddressingMode,
}
impl OpCode {
fn new(code: u8, mnemonic: &'static str, len: u8, cycles: u8, mode: ... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
use compiled_stdlib::{transaction_scripts::StdlibScript, StdLibOptions};
use libra_types::{
access_path::AccessPath,
account_address::AccountAddress,
block_metadata::BlockMetadata,
on_chain_conf... |
use crate::{
communication::{self, Division},
info::Info,
model::{
board::RoadIndex,
common::{
AbsoluteDirection, AxisDirection, CarIndex,
InOutDirection::{self, Out},
LaneDirection, LaneIndex, RelativeDirection, TurnRule,
},
stateful::{sel... |
//! A simple abstraction around a single Ether Dream DAC.
pub mod stream;
pub use self::stream::Stream;
use crate::protocol::{self, command, Command as CommandTrait, ReadFromBytes, WriteToBytes};
use byteorder;
use std::error::Error;
use std::{fmt, io, ops};
/// A DAC along with its broadcasted MAC address.
///
/// ... |
#![cfg_attr(feature = "clippy", feature(plugin))]
#![cfg_attr(feature = "clippy", plugin(clippy))]
use heck::ToSnakeCase;
use std::collections::{HashMap, HashSet};
use std::env;
use std::fs::{self, File};
use std::io::{BufReader, BufWriter, Write};
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
... |
//! # UI - terminal user interface to visualize tree exploration for PUCT
//!
//! Usage: `cargo run --release --bin ui -- -c breakthrough -m alpha`
//!
//! Keyboard and mouse can be used to play the game step by step while
//! inspecting the tree search.
#![allow(non_snake_case)]
use ggpf::game::breakthrough::{ui::IB... |
use byteorder::{BigEndian, ByteOrder};
use log::error;
use memmap::{MmapMut, MmapOptions};
use parking_lot::Mutex;
use std::cmp::{self, Ord, Ordering};
use std::fmt;
use std::fs::{File, OpenOptions};
use std::marker::PhantomData;
use std::mem;
use std::path::{Path, PathBuf};
use std::result::{Result as StdResult};
use ... |
mod git_repo;
use crate::{
misc_helpers::*,
test_api::{Apply, Infer},
};
use anyhow::Context;
use futures::{future::Ready, FutureExt, TryFutureExt};
use git_repo::GitRepo;
use migration_connector::{Migration, MigrationConnector};
use migration_core::{api::MigrationApi, commands::MigrationStepsResultOutput};
us... |
use ansi_term::Colour;
use atty;
use config;
use config::Tag;
use config::{Config, Project, Settings};
use crossbeam::queue::MsQueue;
use errors::*;
use git2;
use git2::build::RepoBuilder;
use git2::{AutotagOption, Branch, Direction, FetchOptions, MergeAnalysis, RemoteCallbacks, Repository};
use indicatif::{MultiProgre... |
use super::{
ast::*,
context::Context,
error::{Error, ErrorKind},
Parser, Result, Span,
};
use crate::{
AddressSpace, Binding, Block, BuiltIn, Constant, Expression, GlobalVariable, Handle,
Interpolation, LocalVariable, ResourceBinding, ScalarKind, ShaderStage, SwizzleComponent, Type,
TypeInn... |
use crate::{check_for_stun_message_header, StunAttribute, StunMessage};
/// Utility function to test sample payloads
fn check_sample_integrity(sample_bytes: &[u8], integrity_key: Option<&str>) {
// Decode the message
// This checks the message validity, fingerprint, integrity.
let decoded_msg = StunMessage... |
use std::collections::{HashMap, HashSet};
use rand::prelude::*;
use itertools::iproduct;
use petgraph::graph::{DiGraph, NodeIndex};
use crate::synthesis::LookUpTableInput;
use crate::implementation::{ImplGraph, ImplGraphNode, ImplGraphEdge};
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, H... |
use std::{
fs::File,
io::{Cursor, Read},
path::Path,
sync::Arc,
time::Instant,
};
use crate::{
app::App,
cgm::{Mat4, Vec2, Vec3, Vertex},
vulkan::{
VkBuffer, VkCommandPool, VkContext, VkDescriptorPool, VkDescriptorSetLayout, VkDevice,
VkImage, VkPipeline, VkRenderPass, V... |
use crate::{
commands::{MyCommand, MyCommandOption},
embeds::{EmbedData, MatchCostEmbed},
util::{
constants::{common_literals::MAP, OSU_API_ISSUE},
matcher, ApplicationCommandExt, MessageExt,
},
Args, BotResult, CommandData, Context, Error, MessageBuilder,
};
use hashbrown::{HashMap... |
use super::{block, OptionsState};
use crate::common::*;
use crate::draw::{add_padding, PaddingDirection};
use crate::service::{self, Service};
use crate::{ENABLE_PRE_POST, HIDE_PREV_CLOSE, HIDE_TOGGLE, SHOW_X_LABELS, TIME_FRAME, TRUNC_PRE};
use api::model::{ChartMeta, CompanyData};
use tui::buffer::Buffer;
use tui::la... |
/*!
# Hardware monitoring in Linux based on LM Sensors
`lm-sensors` provides user-space support for the hardware monitoring drivers
in Linux.
This crate is Linux-specific. Building it for non-Linux platforms, or for
the Linux kernel, results in an empty crate.
## Listing all available sensors
```rust
// Import all ... |
use super::packets::{
Bytes, ExitBroadcast, JoinBroadcast, JoinRequest, JoinResponse, LagStamp, PlayerPose,
PoseBroadcast, PoseRequest, RawJoinResponse, TalkBroadcast, TalkRequest,
};
use super::utils::RuntimeError;
use std::{
ffi::CString, future::Future, mem::swap, pin::Pin, sync::Arc, thread::sleep, tim... |
//! Bindings auto generated from SEGGER RTOS Plug-in SDK V1.10
//!
//! The plug-in client API definitions (the `RTOS_*` functions) and the
//! GDB Server API definitions are compatible with the SEGGER GDBServer
//! RTOS Plug-in SDK API definitions.
//!
//! All IP rights, title and interest in the GDBServer RTOS Plug... |
//! A [`Task`] is a collection of [`Step`]s and [`Variable`]s, wrapped in
//! one package, containing a descriptive name and optional documentation.
//!
//! Each task is pre-configured for usage, after which it can be
//! "triggered".
//!
//! Before a task can be triggered, the person wanting to trigger the
//! task ne... |
//! A compiler for the Monkey programming language from
//! <https://compilerbook.com/>.
use std::{cell::RefCell, fmt, mem, rc::Rc};
use super::{
error::{Error, ErrorKind, Result},
symbol::*,
};
use crate::{
ast,
code::{self, BinaryOpcode::*, CompositeOpcode::*, ControlOpcode::*, Opcode, UnaryOpcode:... |
// Copyright 2018 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::host_device::{self, HostDevice};
use crate::services;
use crate::store::stash::Stash;
use crate::util;
use failure::Error;
use fidl;
use fidl::e... |
use std::{thread, time};
use nix::unistd::Uid;
use termion::{color, style};
use crate::display::print_turbo_animation;
use super::config::Config;
use super::cpu::{Speed, CPU};
use super::debug;
use super::graph::{Graph, Grapher};
use super::logger;
use super::logger::Interface;
use super::power::{has_battery, read_b... |
#![allow(unused)]
use std::cmp::{max, min};
use std::fs::File;
use std::io::prelude::*;
use std::io::BufReader;
use std::path::{Path, PathBuf};
use chrono::Local;
use crossterm::{execute, style::Color, style::SetBackgroundColor, style::SetForegroundColor};
use syntect::{
easy::HighlightLines,
highlighting::{C... |
use std::iter;
use super::super::automaton::Automaton;
use super::super::mapping::{Mapping, Marker, SpannerEnumerator};
use super::super::progress::Progress;
use super::jump::Jump;
use bit_set::BitSet;
use serde::{Deserialize, Serialize};
use std::time::{Duration, Instant};
// ___ _ _ ___... |
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct OrderMassActionReport {
/// MsgType = BZ
#[serde(flatten)]
pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'B', 'Z'>,
/// ClOrdID provided on the Order Mass... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
use crate::{common, ninja::get_ninja_exe, pkg, spinner::Spinner, version::Version};
use clap::{Arg, ArgMatches, Command};
use console::Style;
use ditto_config::{read_config, Config, PackageName, CONFIG_FILE_NAME};
use ditto_make::{self as make, BuildNinja, GetWarnings, PackageSources, Sources};
use fs2::FileExt;
use lo... |
// 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 {
crate::{
builtin::runner::BuiltinRunnerFactory,
config::ScopedPolicyChecker,
model::{
binding::Binder,
... |
use std::collections::{HashMap, HashSet};
use std::str;
use std::str::FromStr;
use rustc_data_structures::sync::Lrc;
use rustc::hir::def_id::DefId;
use syntax::ast::*;
use syntax::attr;
use syntax::source_map::DUMMY_SP;
use syntax::ptr::P;
use syntax::parse::token::{Token, Nonterminal};
use syntax::tokenstream::TokenTr... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Version ID Register"]
pub verid: VERID,
#[doc = "0x04 - Parameter Register"]
pub param: PARAM,
#[doc = "0x08 - Module Control Register"]
pub mcr: MCR,
#[doc = "0x0c - Module Status Register"]
pub msr: MSR,
... |
pub mod salmon_types;
mod util;
use std::collections::HashMap;
use std::fs::*;
use std::io::Write;
use std::io::{self, BufRead, BufReader};
use std::process;
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
use ndarray::prelude::*;
use num_format::{Locale, ToFormattedString};
use petgraph as pg;
use petgrap... |
// 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::update::{paver, BuildInfo},
anyhow::{anyhow, Error},
epoch::EpochFile,
fidl_fuchsia_mem::Buffer,
fidl_fuchsia_paver::{Asse... |
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use serde::Serialize;
use serde::Serializer;
use std::fmt;
use std::path::Path;
use std::path::PathBuf;
#[cfg(feature = "module_specifier")]
pub type ModuleSpecifier = url::Url;
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pu... |
//! Implementation of the AESA peripheral on the SAM4L.
//!
//! Authors:
//!
//! - <NAME> <<EMAIL>>
//! - <NAME> <<EMAIL>>
//! - <NAME> <<EMAIL>>
//!
//! Converted to new register abstraction by <NAME> <<EMAIL>>
use core::cell::Cell;
use kernel::common::cells::{OptionalCell, TakeCell};
use kernel::common::registers::... |
//! A Bricklink Wanted List
//!
//! These types are all based on the Bricklink
//! XML schema as described here: https://www.bricklink.com/help.asp?helpID=207
//!
//! So what's going on here? The quick_xml library has relatively limited support
//! for complex types, and Rust doesn't have good support for a serializabl... |
//! This crate reads and writes [VCD (Value Change Dump)][wp] files, a common format used with
//! logic analyzers, HDL simulators, and other EDA tools.
//!
//! [wp]: https://en.wikipedia.org/wiki/Value_change_dump
//!
//! ## Example
//!
//! ```
//! use std::io;
//! use std::io::ErrorKind::InvalidInput;
//! use vcd::{ ... |
//! `frame` module contains general Frame functionality.
use crate::frame::frame_response::ResponseBody;
use crate::types::to_n_bytes;
use crate::uuid::Uuid;
/// Number of stream bytes in accordance to protocol.
pub const STREAM_LEN: usize = 2;
/// Number of body length bytes in accordance to protocol.
pub const LENGT... |
/*
* Copyright (c) 2012-2020 MIRACL UK Ltd.
*
* This file is part of MIRACL Core
* (see https://github.com/miracl/core).
*
* 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... |
// Copyright 2020 Ant Financial. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
//
// A container image Registry Acceleration File System.
//! RAFS: a readonly FUSE file system designed for Cloud Native.
use std::any::Any;
use std::ffi::CStr;
use std::ffi::OsStr;
use std::fmt;
use std::io::Result;
use... |
fn zipper_merge_and_add(v1: u64, v0: u64, add1: u64, add0: u64) -> (u64, u64) {
let new_add1 = add1.wrapping_add(
(v1 & 0xff000000u64 | v0 & 0xff00000000u64) >> 24
| v1 & 0xff0000u64
| (v1 & 0xff0000000000u64) >> 16
| (v1 & 0xff00u64) << 24
| (v0 & 0xff0000000... |
pub mod utils;
pub mod banner;
pub mod client;
pub mod config;
pub mod extractor;
pub mod filters;
pub mod heuristics;
pub mod logger;
pub mod parser;
pub mod progress;
pub mod reporter;
pub mod scan_manager;
pub mod scanner;
pub mod statistics;
use crate::utils::{get_url_path_length, status_colorizer};
use console::{... |
use crate::{
accumulator::Accumulator,
config::store::Store,
experiment::Experiment,
net::Config as NetConfig,
protocols::{
wrapper::{ChannelKeyWrapper, ProtocolWrapper},
Protocol,
},
services::{
discovery::{register, Node},
health::{wait_for_health, AllGoodHe... |
// Copyright (c) Microsoft. All rights reserved.
#![deny(rust_2018_idioms)]
#![warn(clippy::all, clippy::pedantic)]
#![allow(
clippy::default_trait_access,
clippy::let_and_return,
clippy::let_unit_value,
clippy::missing_errors_doc,
clippy::similar_names,
clippy::too_many_lines
)]
mod error;
mo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.