text stringlengths 7.05k 33.9k |
|---|
//! This crate adds a middleware for [`actix-web`](https://actix.rs/) that captures errors and
//! report them to `Sentry`.
//!
//! To use this middleware just configure Sentry and then add it to your actix web app as a
//! middleware. Because actix is generally working with non sendable objects and highly concurrent
... |
#![crate_name = "rboy"]
extern crate clap;
extern crate cpal;
extern crate glium;
extern crate rboy;
use rboy::device::Device;
use std::sync::mpsc::{self, Receiver, SyncSender, TryRecvError, TrySendError};
use std::thread;
use std::error::Error;
const EXITCODE_SUCCESS : i32 = 0;
const EXITCODE_CPULOADFAILS : i32 = 2... |
// Copyright 2020 Ant Financial. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
use std::collections::HashMap;
use std::fs::{self, File, OpenOptions};
use std::io::{ErrorKind, Result, Seek, SeekFrom};
use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
use std::sync::{Arc, Mutex, RwLock};
use std::thre... |
use crate::glyf::component::{Component, ComponentFlags};
use crate::glyf::point::Point;
use bitflags::bitflags;
use itertools::izip;
use otspec::types::*;
use otspec::{deserialize_visitor, read_field, read_field_counted};
use otspec_macros::tables;
use serde::de::{SeqAccess, Visitor};
use serde::ser::SerializeSeq;
use ... |
// 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
// disclaim... |
//! HTTP Proxy client server
use std::{
convert::Infallible,
future::Future,
io::{self, ErrorKind},
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr},
pin::Pin,
str::FromStr,
sync::Arc,
task::{self, Poll},
};
use futures::{
future,
future::{BoxFuture, Either},
FutureExt,
};
use... |
use bevy::{
core::FloatOrd,
core_pipeline::Transparent2d,
ecs::system::lifetimeless::{Read, SQuery, SRes},
ecs::system::SystemParamItem,
prelude::*,
reflect::TypeUuid,
render::{
mesh::Indices,
render_asset::RenderAssets,
render_component::{ComponentUniforms, DynamicUn... |
//! Ethereum watcher polls the Ethereum node for new events
//! such as PriorityQueue events or NewToken events.
//! New events are accepted to the zkSync network once they have the sufficient amount of confirmations.
//!
//! Poll interval is configured using the `ETH_POLL_INTERVAL` constant.
//! Number of confirmation... |
use crate::{
config,
daemon_response::DaemonResponseSender,
display_backend, error_handling_ctx, eww_state,
gtk::prelude::{ContainerExt, CssProviderExt, GtkWindowExt, StyleContextExt, WidgetExt},
script_var_handler::*,
EwwPaths,
};
use anyhow::*;
use debug_stub_derive::*;
use eww_shared_util::Va... |
//! This module is responsible for the loading of DKG transcripts and DKG key
//! removals. It is invoked by the consensus and decides on every run if
//! there is something to do. On high-level, it's responsible of spawning
//! threads triggering long-running CSP operation and book-keeping of
//! thread-handles.
use c... |
#![allow(clippy::module_inception)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::ptr_arg)]
#![allow(clippy::large_enum_variant)]
#![doc = "generated by AutoRust 0.1.0"]
#[cfg(feature = "package-2021-09")]
pub mod package_2021_09;
#[cfg(all(feature = "package-2021-09", not(feature = "no-default-version")))]
pu... |
use automerge_protocol as amp;
use automerge_protocol::{ActorId, ChangeHash, ObjectId, Op, OpId, Patch};
mod error;
mod mutation;
mod path;
mod state_tree;
mod value;
use std::{collections::HashMap, convert::TryFrom, error::Error, fmt::Debug};
pub use error::{
AutomergeFrontendError, InvalidChangeRequest, Invali... |
// Copyright 2017 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.
use std::collections::VecDeque;
use std::io::{self, Write};
use std::sync::atomic::{AtomicU8, Ordering};
use std::sync::mpsc::{channel, Receiver, TryRe... |
use core::cell::Cell;
use core::cmp;
use core::mem;
use dma::DMAChannel;
use dma::DMAClient;
use dma::DMAPeripheral;
use kernel::common::volatile_cell::VolatileCell;
use kernel::hil::spi;
use kernel::hil::spi::ClockPhase;
use kernel::hil::spi::ClockPolarity;
use kernel::hil::spi::SpiMasterClient;
use pm;
/// Implem... |
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of Open Ethereum.
// Open Ethereum 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 o... |
use alloc::boxed::Box;
use alloc::string::String;
use alloc::vec::Vec;
use core::any::Any;
use crate::rsp::rsp::RSP;
use crate::rsp::rsp_assembler::{E, GPR, RSPAssembler, VR};
use crate::rsp::spmem::SPMEM;
use crate::tests::{Level, Test};
use crate::tests::soft_asserts::soft_assert_eq;
// Load some data via LQV and s... |
/* origin: FreeBSD /usr/src/lib/msun/src/e_lgammaf_r.c */
/*
* Conversion to float by <NAME>, Cygnus Support, <EMAIL>.
*/
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Per... |
//
// Copyright 2018-2019 <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 w... |
//! Zebra mempool.
//!
//! A zebrad application component that manages the active collection, reception,
//! gossip, verification, in-memory storage, eviction, and rejection of unmined Zcash
//! transactions (those that have not been confirmed in a mined block on the
//! blockchain).
//!
//! Major parts of the mempool ... |
use std::collections::{HashMap, HashSet};
use std::collections::hash_map::Entry;
use std::net::SocketAddr;
use log::{debug, warn};
use bincode;
use super::message::request::{CoAPRequest, Method};
use super::message::response::Status;
use super::message::packet::{Packet};
use super::message::options::{ObserveOption};
u... |
/*
Copyright © 2013 Free Software Foundation, Inc
See licensing in LICENSE file
File: constants.rs
Author: Jesse 'Jeaye' Wilkerson
Description:
Constants that follow the
ncurses library for use with
the safe wrappers.
*/
use libc::{ c_char, c_int };
use super::ll::*;
mod wrapped... |
use std::ops::Range;
use crate::diagnostic::{Diagnostic, LabelStyle};
use crate::files::{Files, Location};
use crate::term::renderer::{Locus, MultiLabel, Renderer, SingleLabel};
use crate::term::{Config, RenderError};
/// Count the number of decimal digits in `n`.
fn count_digits(mut n: usize) -> usize {
let mut ... |
use crate::draw::*;
use crate::path::*;
use flo_curves::bezier::*;
use flo_curves::bezier::path::*;
use flo_stream::*;
use futures::prelude::*;
use std::iter;
///
/// Converts a bezier path to a set of paths by a dash patter
///
pub fn path_to_dashed_lines<PathIn, PathOut, DashPattern>(path_in: &PathIn, dash_pattern... |
use std::fs::File;
use std::io::{BufReader, Read, Seek, SeekFrom, Write};
use flate2::write::ZlibDecoder;
use ripemd128::{Digest, Ripemd128};
use crate::checksum::adler32_checksum;
use crate::number::{NumberBytes, read_number};
use crate::unpack::{Endian, unpack_u16, unpack_u32, unpack_u64};
use super::header::{Head... |
use alloc::{
boxed::Box, collections::BTreeMap, collections::VecDeque, string::String, sync::Arc,
sync::Weak, vec::Vec,
};
use core::fmt;
use core::str;
use log::*;
use rcore_memory::{Page, PAGE_SIZE};
use rcore_thread::Tid;
use spin::RwLock;
use xmas_elf::{
header,
program::{Flags, SegmentData, Type},... |
//! The module contains some common utilities for `solicit::http` tests.
use std::io;
use std::rc::Rc;
use std::cell::{RefCell, Cell};
use std::borrow::Cow;
use std::io::{Cursor, Read, Write};
use http::{HttpResult, HttpScheme, StreamId, Header, OwnedHeader, ErrorCode};
use http::frame::{RawFrame, FrameIR, FrameHeade... |
use anyhow::{anyhow, Result};
use byteorder::{LittleEndian, ReadBytesExt};
use std::{collections::HashMap, convert::TryFrom, fmt, io::Cursor, str::from_utf8};
use crate::{bitmask, validate_sram};
pub enum Z3RStat {
Meta(Option<String>),
Number(u32),
Fraction(String),
Time(String),
}
impl Z3RStat {
... |
use truck_base::cgmath64::*;
use truck_meshalgo::prelude::*;
#[derive(Debug, Clone)]
pub struct IntersectionCurve<S> {
surface0: S,
surface1: S,
polyline: PolylineCurve<Point3>,
params0: PolylineCurve<Point2>,
params1: PolylineCurve<Point2>,
tol: f64,
}
pub fn double_projection<S>(
surface0: &S,
hint0: Option... |
// Copyright (c) 2016 <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... |
// 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::{
app::MessageInternal,
canvas::{Canvas, MappingPixelSink},
geometry::{IntSize, UintSize},
message::Message,
view::{
... |
use std::ffi::OsStr;
use std::path::{Path, PathBuf};
use std::str;
use crate::code_move::new_module;
use crate::collector::global_collect;
use crate::entry_strategy::EntryPolicy;
use crate::transform::{Hook, HookTransform, ThreadSafeTransformContext};
use crate::utils::{CodeHighlight, Diagnostic, DiagnosticSeverity, S... |
use arcstr::ArcStr;
use arrayvec::ArrayVec;
use ascii::AsciiString;
use color_eyre::eyre::{eyre, Context};
use eio::ReadExt;
use std::{fmt::Display, io::BufRead, iter};
/// An ABI list parsed from a consolidated `abilists` data generated by [`glibc-abi-tool`].
///
/// [`glibc-abi-tool`]: https://github.com/ziglang/gli... |
//! Analysis pass which builds the name to definition index.
//!
//! This is an analysis pass and should not be invoked directly; it is intended
//! to be instantiated through `Database`. It is not considered a stable API,
//! although a stable wrapper may be added in `Database`.
//!
//! Scope check needs the ability ... |
use chunk::{Chunk, Op};
use broom::Heap;
use gc::value::Value;
use gc::object::{Object, LoxFunction, LoxFunctionBuilder};
use parser::ast::*;
pub struct Compiler<'g> {
heap: &'g mut Heap<Object>,
states: Vec<CompileState>,
}
#[derive(Debug)]
struct Local {
pub name: String,
pub depth: usize,
pu... |
// Copyright 2017 <NAME>
//
// This file is part of the PulseAudio Rust language binding.
//
// Licensed under the MIT license or the Apache license (version 2.0), at your option. You may not
// copy, modify, or distribute this file except in compliance with said license. You can find copies
// of these licenses either... |
use crate::{
engine::{engine_actor::GhostEngineParentWrapper, CanAdvertise, GhostEngine},
error::*,
track::Tracker,
};
use std::convert::TryInto;
use detach::Detach;
use holochain_tracing::Span;
use lib3h_ghost_actor::*;
use lib3h_protocol::{
data_types::{ConnectedData, GenericResultData, Opaque},
... |
use crate::rayt::*;
use rand::prelude::*;
use std::iter::FromIterator;
/// A 3-element array that is represented by double precision floating point components
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct Float3([f64; 3]);
/// A 3-element color that is represented by r,g,b components
pub type Color = Float3;
/... |
use crate::printer::print_table;
use std::{error::Error, file, line, ops::DerefMut, stringify, time::Instant};
use clap::Parser;
use indoc::indoc;
use point_mass_ballistics::{
output::Measurements,
projectiles::{self as bc, Projectile, ProjectileImpl},
simulation::{Simulation, SimulationBuilder},
unit... |
use std::convert::TryFrom;
use std::sync::Arc;
use atomic_refcell::AtomicRefCell;
use nix::errno::Errno;
use crate::cshadow as c;
use crate::host::descriptor::shared_buf::SharedBuf;
use crate::host::descriptor::socket::abstract_unix_ns::AbstractUnixNamespace;
use crate::host::descriptor::{
FileMode, FileState, Fi... |
use super::role::{CanDeposit, Deposit, DepositCode, Movable, Role};
use crate::creep::find_tower;
use crate::storage::CreepTarget;
use log::*;
use screeps::{
find, game, prelude::*, Creep, ObjectId, Resource, ResourceType, ReturnCode,
RoomObjectProperties, SharedCreepProperties, StructureExtension, StructureObj... |
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
use anyhow::{bail, Result};
use std::convert::TryInto;
/// PRESENT block cipher.
///
/// Based on version 1.2 of the following Python implementation
/// https://github.... |
use std::iter;
use std::mem;
use egui;
use pollster::FutureExt;
use raw_window_handle::HasRawWindowHandle;
use crate::model::ModelIndex;
use crate::model::ModelManager;
use crate::{texture, Camera, RenderingError};
use common::{Mat3, Mat4, Transform, Vec3, Vec4};
pub mod gbuffer;
pub mod world;
use world::World;
#[... |
//! Provides mappable `Rc` and `Arc` implementations.
//!
//! This crate provides two types: [`Marc`] and [`Mrc`], corresponding to `std`'s [`Arc`] and [`Rc`]
//! types. For the most part, these types are near drop in replacements; they also provide shared
//! ownership via reference countings, many of the same methods... |
use super::boolean::Boolean;
use super::multieq::MultiEq;
use super::uint32::UInt32;
use bellman::{ConstraintSystem, SynthesisError};
use pairing::Engine;
const ROUND_CONSTANTS: [u32; 64] = [
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01,... |
use lazy_static::lazy_static;
use panelgui::{
canvas_device, composition_graphics_device, compositor, get_next_id, send_panel_event, Handle,
Panel, PanelEvent, PanelHandle,
};
use std::collections::HashMap;
use bindings::{
Microsoft::Graphics::Canvas::{
CanvasDevice,
Text::{
Can... |
#![no_std]
extern crate libc;
use libc::{c_void, c_char, c_uint, size_t, c_int};
#[derive(Clone, Copy)]
#[repr(C)]
pub struct LZ4FCompressionContext(pub *mut c_void);
unsafe impl Send for LZ4FCompressionContext {}
#[derive(Clone, Copy)]
#[repr(C)]
pub struct LZ4FDecompressionContext(pub *mut c_void);
unsafe impl Sen... |
#![allow(clippy::upper_case_acronyms, dead_code, clippy::type_complexity)]
//! helper methods for the tests
use banyan::{
index::{CompactSeq, Summarizable, VecSeq},
query::{AllQuery, AndQuery, OffsetRangeQuery, Query},
store::{BranchCache, MemStore, ReadOnlyStore},
StreamBuilder, Transaction, Tree, Tree... |
// Copyright 2020 The Tink-Rust 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 or ag... |
use hyper::{
http::header::{HeaderName, HeaderValue},
http::request::Parts,
http::uri::Scheme,
Body, Request, Response, StatusCode,
};
use serde::Deserialize;
use std::sync::{Arc, RwLock};
use std::{collections::HashMap, net::SocketAddr};
use std::{path::Path, time::Instant};
use wasi_common::virtfs::pi... |
/**
* 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 applica... |
#![deny(missing_debug_implementations, missing_docs, missing_copy_implementations, trivial_casts,
trivial_numeric_casts, unsafe_code, unused_import_braces, unused_qualifications)]
//! rebind
//! ======
//!
//! A library for binding input keys to actions, and modifying mouse behaviour. Keys can
//! be
//! bound... |
//! Inter-Integrated Circuit (I2C) bus
//!
//! A usage example of the i2c peripheral can be found at [examples/i2c_scanner.rs]
//!
//! [examples/i2c_scanner.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.1/examples/i2c_scanner.rs
use core::{convert::TryFrom, ops::Deref};
use crate::{
gpio::{gpioa, gpiob... |
use std::collections::HashMap;
use std::ops::Not;
use itertools::Itertools;
use legion::*;
use nalgebra::{Isometry2, Point, Point2, Vector2};
use ncollide2d::query::PointQuery;
use ncollide2d::shape::Ball;
use rand::prelude::StdRng;
use rand::{Rng, SeedableRng};
use uuid::Uuid;
use crate::components::{
Commodity,... |
//! Provides the handling for Access Token Requests
use std::mem;
use std::borrow::Cow;
use std::collections::HashMap;
use chrono::Utc;
use serde::{Deserialize, Serialize};
use serde_json;
use crate::code_grant::error::{AccessTokenError, AccessTokenErrorType};
use crate::primitives::authorizer::Authorizer;
use crate:... |
//! This file is the binary entry point for the Gravity client software, an easy to use cli utility that
//! allows anyone to send funds across the Gravity bridge. Currently this application only does anything
//! on the Ethereum side of the bridge since withdraw batches are incomplete.
// there are several binaries f... |
// Copyright (C) 2022 Red Hat
// SPDX-License-Identifier: Apache-2.0
//! This module provides the core utilities to use logreduce-index with Read objects.
use anyhow::Result;
use std::collections::{HashSet, VecDeque};
use std::io::Read;
use crate::{Anomaly, AnomalyContext, ChunkIndex};
use logreduce_iterator::LogLin... |
use super::*;
use indicatif::ProgressIterator;
use rand::rngs::StdRng;
use rand::seq::SliceRandom;
use rand::SeedableRng;
use rayon::prelude::*;
use std::collections::HashMap;
use vec_rand::gen_random_vec;
use vec_rand::xorshift::xorshift;
#[inline(always)]
/// Computes val % n using lemires fast method for u32.
/// h... |
use std::fs::File;
use std::io::{Cursor, Error, Write};
use std::path::{Path, PathBuf};
use std::process::Command;
use std::sync::Arc;
use std::{env, fs};
use regex::bytes::{NoExpand, Regex};
use tempdir::TempDir;
use lazy_static::lazy_static;
pub use super::super::compiler::*;
use super::super::io::memstream::MemSt... |
//
// LCD init code from
// from https://github.com/adafruit/TFTLCD-Library.git
//
// https://cdn-shop.adafruit.com/datasheets/ILI9328.pdf
//
use core::convert::{Infallible, TryFrom};
use stm32f1::stm32f107::rcc;
use stm32f1xx_hal::gpio::*;
use stm32f1xx_hal::pac::GPIOE;
use embedded_hal::blocking::delay::DelayMs;
u... |
use crate::{
doppelganger_service::DoppelgangerStatus,
duties_service::{DutiesService, Error},
};
use futures::future::join_all;
use itertools::Itertools;
use parking_lot::{MappedRwLockReadGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
use slog::{crit, debug, info, warn};
use slot_clock::SlotClock;
use std:... |
use {
anyhow::*,
hashbrown::HashMap,
nalgebra as na,
rlua::prelude::*,
serde::{de::DeserializeOwned, Deserialize, Serialize},
serde_json::{json, Number, Value},
std::{
marker::PhantomData,
path::{Path, PathBuf},
},
};
use crate::{
api::LuaComponentInterface,
asse... |
use core::intrinsics::unlikely;
use x86::{
io::outb,
segmentation::{BuildDescriptor, Descriptor, SegmentDescriptorBuilder},
};
use x86_64::{PhysAddr, VirtAddr};
use crate::{
arch::memory::phys_to_virt,
clock::Nanoseconds,
interrupt::{self, Destination},
processor,
};
static mut... |
use anyhow::{ensure, Result};
use bitvec_helpers::{bitvec_reader::BitVecReader, bitvec_writer::BitVecWriter};
#[cfg(feature = "serde_feature")]
use serde::Serialize;
use crate::st2094_10::{
ext_metadata_blocks::ExtMetadataBlock, generate::GenerateConfig, ST2094_10Meta,
};
#[derive(Debug, Default)]
#[cfg_attr(fea... |
///! This manages the discovery and management of peers.
pub(crate) mod enr;
pub mod enr_ext;
// Allow external use of the lighthouse ENR builder
pub use enr::{build_enr, CombinedKey, Keypair};
pub use enr_ext::{CombinedKeyExt, EnrExt};
use crate::metrics;
use crate::{error, Enr, NetworkConfig, NetworkGlobals};
use d... |
use std::borrow::Cow;
use crate::{
common::CodegenCx,
debuginfo::{
metadata::{
closure_saved_names_of_captured_variables,
enums::tag_base_type,
file_metadata, generator_layout_and_saved_local_names, size_and_align_of, type_di_node,
type_map::{self, Stub, ... |
#![allow(unused_variables)]
#![allow(dead_code)]
//! Software interface to the dcrypto peripheral of the Hotel chip
//! for the Tock operating system.
//!
//! dcrypto is a processor designed to offload the SC300 CPU and
//! accelerate cryptographic algorithms. The primary applications are
//! public key cryptography a... |
use async_compat::CompatExt;
use bytes::Bytes;
use futures::{
future::FusedFuture, pin_mut, stream::FuturesUnordered, Future, FutureExt, SinkExt, StreamExt,
};
use futures_channel::mpsc::{UnboundedReceiver, UnboundedSender};
use futures_util::{lock::Mutex, select};
use log::{debug, warn};
use std::{collections::Has... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Data Direction"]
pub dir0: DIR,
#[doc = "0x04 - Data Direction Clear"]
pub dirclr0: DIRCLR,
#[doc = "0x08 - Data Direction Set"]
pub dirset0: DIRSET,
#[doc = "0x0c - Data Direction Toggle"]
pub dirtgl0: DIRT... |
// Copyright 2020 Parity Technologies
//
// 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 accor... |
// 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 {
anyhow::{format_err, Context},
fidl_fuchsia_bluetooth::{self as fbt, DeviceClass},
fidl_fuchsia_bluetooth_host::{HostEvent, HostProxy},
... |
use std::collections::HashMap;
use std::collections::HashSet;
use std;
use ::fail;
use std::collections::hash_map::Entry;
use elfkit::{
Elf, Header, types, SegmentHeader, Section, SectionContent, Error,
SectionHeader, Dynamic, Symbol, Relocation, Strtab, SymbolSectionIndex};
#[derive(Clone, Debug, PartialEq, ... |
// This file is part of Sulis, a turn based RPG written in Rust.
// Copyright 2018 <NAME>
//
// Sulis 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 opt... |
use crate::machine8086::Machine8086;
use num::FromPrimitive;
use num_derive::FromPrimitive;
pub trait AnyUnsignedInt8086
: std::ops::Add
+ std::ops::AddAssign
+ std::ops::Sub
+ std::ops::SubAssign
+ std::ops::BitOr<Self, Output = Self>
+ std::ops::BitOrAssign
+ std::ops::BitAnd<Self, Output = Self>
+ std::ops... |
// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) a... |
use libc::{self, c_char};
use std::ffi::CString;
use std::fmt::{self, Display, Formatter};
use std::mem;
use crate::bindings::*;
use crate::ExifError;
use crate::bits::*;
use crate::internal::*;
/// A rational number consisting of a numerator and denominator.
///
/// A rational number is any number that can be repre... |
//! Parser for the [ktx2](https://github.khronos.org/KTX-Specification/) texture container format.
//!
//! ## Features
//! - [x] Async reading
//! - [x] Parsing
//! - [x] Validating
//! - [x] [Data format description](https://github.khronos.org/KTX-Specification/#_data_format_descriptor)
//! - [ ] [Key/value data](http... |
pub fn to_utf8(v: &[u8]) -> String {
let mut s = String::new();
for b in v {
s.push(u8_as_char(*b));
}
s
}
/// converts byte to a symbol in code page 437 ("extended ASCII"), presented as a utf8 char
/// https://en.wikipedia.org/wiki/Code_page_437
pub fn u8_as_char(b: u8) -> char {
match b {... |
// Bitcoin Dev Kit
// Written in 2020 by <NAME> <<EMAIL>>
//
// Copyright (c) 2020-2021 Bitcoin Dev Kit Developers
//
// This file is 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>... |
extern crate regex;
extern crate getopts;
#[macro_use]
extern crate lazy_static;
use std::collections::HashMap;
use std::{env, fs, io};
use std::io::prelude::*;
mod options;
use options::*;
use std::process;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::collections::hash_map::{Entry};
macro_rules... |
use std::borrow::Cow;
use inflections::Inflect;
use svd::{self, Access, EnumeratedValues, Field, Peripheral, Register, Usage};
use syn::{self, Ident};
use quote::Tokens;
use errors::*;
pub const BITS_PER_BYTE: u32 = 8;
/// List of chars that some vendors use in their peripheral/field names but
/// that are not vali... |
// Copyright 2021 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot 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 late... |
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::{Rc, Weak};
use fxhash::{FxBuildHasher, FxHashMap};
use image::GenericImageView;
use rusttype::{GlyphId, Point, Rect};
use crate::draw::Position;
use crate::draw::Scalar;
use crate::mesh::atlas::lossy_glyph_info::LossyGlyphInfo;
use crate::text::{Fon... |
extern crate base64;
extern crate hex;
#[macro_use]
extern crate log;
use std::collections::HashSet;
use crypto::aessafe;
use crypto::symmetriccipher::{BlockDecryptor, BlockEncryptor};
use rand::distributions::Standard;
use rand::{thread_rng, Rng};
pub mod dh;
pub mod md4;
pub mod mt19937;
pub mod primes;
pub mod rs... |
#[cfg(not(feature = "unchecked"))]
witx_bindgen_rust::import!("tests/host.witx");
#[cfg(feature = "unchecked")]
witx_bindgen_rust::import!({ paths: ["tests/host.witx"], unchecked });
use crate::allocator;
use host::*;
use std::alloc::{self, Layout};
use std::iter;
use std::mem;
use std::ptr;
pub fn run() {
let _... |
#![no_std]
// MIT License. See LICENSE file.
// Made by:
// <NAME>
// <EMAIL>
// Inspired by / Special thanks to:
// https://github.com/avishorp/TM1637
//! Generic GPIO driver for TM1637.
//! With this driver you can control for example the 4-digit 7-segment display from AZ-Delivery.
//! This is not dependent o... |
extern crate clap;
extern crate env_logger;
//#[macro_use]
extern crate log;
#[cfg(test)]
extern crate kernel32;
extern crate chrono;
extern crate winapi;
extern crate md5;
include!(concat!(env!("OUT_DIR"), "/version.rs"));
#[cfg(windows)]
mod acl;
mod appcontainer;
mod winffi;
mod asw;
mod privatedirectory;
use ... |
use quick_xml::events::{Event, BytesDecl};
use quick_xml::Writer;
use std::io::Cursor;
use tempdir::TempDir;
use ::structs::Spreadsheet;
use ::structs::Borders;
use ::structs::Alignment;
use super::driver::*;
use super::XlsxError;
const SUB_DIR: &'static str = "xl";
const FILE_NAME: &'static str = "styles.xml";
pub(... |
#![feature(slice_partition_dedup)]
mod single_or_vec;
mod sprite_id_with_weight;
use single_or_vec::SingleOrVec;
use sprite_id_with_weight::SpriteIdWithWeight;
use clap::{Parser, Subcommand};
use image::io::Reader as ImageReader;
use image::{DynamicImage, GenericImageView, ImageFormat, RgbaImage, SubImage};
use serd... |
pub mod base_address;
pub mod pointer_address;
pub mod enterprise_address;
pub mod reward_address;
pub mod byron_address;
pub mod stake_credential;
pub mod pointer;
pub use base_address::*;
pub use pointer_address::*;
pub use enterprise_address::*;
pub use reward_address::*;
pub use byron_address::*;
pub use stake_cre... |
//! Inter-Integrated Circuit driver for Tegra210.
//!
//! # Description
//!
//! The I²C controller (I2C) implements an I²C 3.0 specification-compliant
//! I²C master and slave controller. The I²C controller supports multiple
//! masters and slaves. It supports Standard mode (up to 100 Kbits/s),
//! Fast mode (up to 400... |
use std::cell::RefCell;
use std::fs;
use std::io::prelude::*;
use std::path::PathBuf;
use std::str;
use std::vec::Vec;
use std::result::Result;
use num::FromPrimitive;
use gb_mem::RamAddress;
#[derive(Debug)]
enum CgbFlag {
None,
Supported,
Exclusive,
}
impl CgbFlag {
fn from_u8(val: u8) -> Result<S... |
//! This file is for temporary experiments. If an experiment has long-term value, it should be
//! moved to another file and given an actual experiment number.
//!
//! Requires `setup00000`.
use clap::{clap_app, ArgMatches};
use spurs::{cmd, Execute, SshShell};
use spurs_util::escape_for_bash;
use crate::{
commo... |
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use deno_core::error::AnyError;
use deno_core::error::Context;
pub use deno_core::normalize_path;
use deno_core::ModuleSpecifier;
use deno_runtime::deno_crypto::rand;
use std::env::current_dir;
use std::fs::OpenOptions;
use std::io::{Error, Wri... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! Contains types and related functions.
use crate::{
ast::QualifiedSymbol,
env::{GlobalEnv, ModuleId, StructEnv, StructId},
symbol::SymbolPool,
};
use std::{collections::BTreeMap, fmt, fmt::Formatter};
/// Represents a ... |
#![allow(clippy::integer_arithmetic)]
use {
log::*,
serde::{Deserialize, Serialize},
solana_sdk::{
clock::{Slot, UnixTimestamp},
deserialize_utils::default_on_eof,
pubkey::Pubkey,
signature::Signature,
sysvar::is_sysvar_id,
transaction::{Transaction, Transacti... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use anyhow::{Context, Result};
use config_builder::{FullNodeConfig, SwarmConfig, ValidatorConfig};
use debug_interface::NodeDebugClient;
use libra_config::config::{NodeConfig, RoleType};
use libra_logger::prelude::*;
use libra_temppath... |
#![allow(non_snake_case)]
#![doc(include = "../docs/inner-product-protocol.md")]
use std::borrow::Borrow;
use std::iter;
use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint};
use curve25519_dalek::scalar::Scalar;
use curve25519_dalek::traits::VartimeMultiscalarMul;
use merlin::Transcript;
use error... |
use super::{get_span_of_entire_for_loop, IncrementVisitor, InitializeVisitor, MANUAL_MEMCPY};
use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::source::snippet;
use clippy_utils::sugg::Sugg;
use clippy_utils::ty::is_type_diagnostic_item;
use clippy_utils::{get_enclosing_block, higher, path_to_local, ... |
#![allow(dead_code)]
#[cfg(not(target_pointer_width = "64"))]
compile_error!("This emulator requires a 64-bit system");
// References:
// - https://github.com/riscv/riscv-isa-manual
pub mod ins;
pub mod shared {
pub const XLEN: usize = 64;
/// IALIGN (either 16/32 for instruction address alignment)
/// ILEN (m... |
use bytes::Bytes;
use futures::sync::mpsc;
use futures::Future;
use rand::{thread_rng, Rng};
use slog::Logger;
use std::collections::HashMap;
use std::error::Error;
use std::io;
use std::net::{IpAddr, SocketAddr};
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instant};
use tokio::prelude::*;
use tokio::timer::... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.