text
stringlengths
7.05k
33.9k
use std::{ convert::TryFrom, ops::{Mul, MulAssign}, }; /// An element of a dihedral group D₄. /// /// Formally, D₄ is generated by two element R and S subjecting the following relations, /// /// * R⁴ = 1, /// * S² = 1, /// * SRS = R³. /// /// Each variant of the enum `Dihedral` corresponds an element of D₄ as ...
pub const NUC_QUAD_LOOKUP: [[u8; 4]; 256] = [ [b'T', b'T', b'T', b'T'], [b'T', b'T', b'T', b'C'], [b'T', b'T', b'T', b'A'], [b'T', b'T', b'T', b'G'], [b'T', b'T', b'C', b'T'], [b'T', b'T', b'C', b'C'], [b'T', b'T', b'C', b'A'], [b'T', b'T', b'C', b'G'], [b'T', b'T', b'A', b'T'], ...
use std::cmp::Ordering; use std::collections::HashMap; // Bit flags indicating what occurs on a particular cycle const DRAW_PIXEL: u32 = 1; const SPRITE_DEC_X: u32 = 1 << 1; const SHIFT_BG_REGISTERS: u32 = 1 << 2; const FETCH_NT: u32 = 1 << 3; const FETCH_AT: u32 = 1 << 4; const FETCH_BG_LOW: u32 = 1 << 5; const FETCH...
/* TODO(JaSc): x Pixel perfect renderer x Render to offscreen buffer and blit to main screen x Static world camera x Transformation screen <-> canvas <-> world x Atlas packer x Font packer x Atlas textures and sprite/quad/line-batching x Bitmap text rendering x Worldspace/Screenspace placement...
use std::{future::Future, io, marker::PhantomData, pin::Pin, time::Duration}; use futures_core::stream::Stream; use http::{response::Parts, Request, Response}; use tokio::pin; use tracing::trace; use xitca_io::io::{AsyncIo, AsyncWrite, Interest, Ready}; use xitca_service::Service; use crate::{ body::ResponseBody,...
use std::{ collections::{HashMap, HashSet}, fmt::{self, Display, Formatter}, hash::Hash, }; use crate::{ data_filtering::{unregistered_field_error, unsupported_op_error, PartialResults, Type}, error::{invalid_state_error, RuntimeError}, events::ResultEvent, terms::*, }; use serde::Serializ...
#![allow(non_snake_case)] use core::mem; use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint}; use curve25519_dalek::scalar::Scalar; use curve25519_dalek::traits::VartimeMultiscalarMul; use merlin::Transcript; use super::{ ConstraintSystem, LinearCombination, R1CSProof, RandomizableConstraintSys...
use rand::{thread_rng, Rng}; use cryptopals::dh; use isha2::Sha2; use prime_math::InvMod; #[test] #[allow(non_snake_case)] fn challenge_thirty_three() { use num::bigint::BigUint; let mut rng = thread_rng(); let lil_p = 37_u8; let lil_g = 5_u8; let lil_a = rng.gen_range::<u8, u8, u8>(1, lil_p); ...
use std::convert::TryFrom; use std::mem::transmute; use std::{io, fmt, error}; use sys; /// Indicates that a value or event type code was out of range. #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct RangeError; impl From<RangeError> for io::Error { fn from(e: RangeError) -...
//! Program dependence graph for a function. use std::collections::{HashMap, HashSet}; use petgraph::algo::dominators; use petgraph::graph::{DiGraph, IndexType, NodeIndex}; use super::cfg::{entry, exit, Cfg}; use super::{Query, QueryInitError}; use crate::api::Api; use crate::arena::{P, S}; use crate::data::{access:...
//! In order to leverage all of Rust's type safety, this crate produces //! a set of concrete Rust types for responses from the zcashd-RPC interface. mod error; mod special_cases; mod tokenize; use error::TypegenResult; use proc_macro2::TokenStream; use quote::quote; /// Process quizface-formatted response specificat...
use super::{Concat, Error, Reader, Result}; use core::convert::TryInto; use core::ops::Add; use log::info; use nom::AsBytes; use p256::ecdsa::signature::digest::Digest; use p256::elliptic_curve::generic_array::ArrayLength; use sha2::Sha256; use crate::crypto::signatures::{verify_ecc256_signature, HDR_IMG_TYPE_AUTH}; ...
use frame_support::dispatch::DispatchResult; use pallet_utils::{SpaceId, remove_from_vec}; use super::*; impl<T: Config> Post<T> { pub fn new( id: PostId, created_by: T::AccountId, space_id_opt: Option<SpaceId>, extension: PostExtension, content: Content ) -> Self { ...
#![allow(non_snake_case)] use libc::{c_double, c_float, c_int, c_char}; use libc::{c_uint, c_ushort, c_uchar, c_void}; use std::marker; pub const FONT_INVALID: c_int = -1; pub const STB_IMAGE_INVALID: c_int = 0; pub const NVG_CCW: c_uint = 1; pub const NVG_CW: c_uint = 2; pub const NVG_SOLID: c_uint = 1; pub const ...
#![cfg_attr(not(feature = "std"), no_std)] #![allow(clippy::upper_case_acronyms)] use minterest_primitives::{Balance, CurrencyId, Interest, Operation, Price, Rate}; use sp_runtime::{DispatchError, DispatchResult}; use sp_std::{collections::btree_set::BTreeSet, result::Result, vec::Vec}; /// An abstraction of basic bo...
#![allow(non_snake_case)] use crate::files::{Downloadable, FileManager}; use crate::utils::auth::AuthConfig; use bytes::Bytes; use regex::Regex; use reqwest::{self, header, Error}; use std::str; const LIST_HOST: &str = "https://www.open.go.kr/rqestMlrd/rqestDtls/reqstDocSrchList.ajax"; const LOGIN_HOST: &str = "http...
use { super::{ bitvec as mpeg4bitvec, bitvec::Mpeg4BitVec, errors::{MpegAacError, MpegAacErrorValue}, }, bytes::BytesMut, bytesio::{bytes_reader::BytesReader, bytes_writer::BytesWriter}, }; const AAC_FREQUENCE_SIZE: usize = 13; const AAC_FREQUENCE: [u32; AAC_FREQUENCE_SIZE] = [ ...
//! Radiator valve motor sense on A0, A1 (floating or pull down input) //! //! Roll up switches A2 (pull down once in each main period if closed) //! Roll down switches A3 (pull down once in each main period if closed) //! //! Ext/Motion alarm on A4 (pull down) //! Open alarm on A5 (pull down) //! //! A6 - ADC6 valve m...
//! Subscription- and subscription management-related functionality. #[cfg(feature = "websocket-client")] pub use two_phase_router::{SubscriptionState, TwoPhaseSubscriptionRouter}; use crate::client::sync::{unbounded, ChannelRx, ChannelTx}; use crate::event::Event; use crate::query::Query; use crate::{Error, Id, Resu...
use crate::{ pipeline::{IndexFormat, PrimitiveTopology, RenderPipelines, VertexFormat}, renderer::{BufferInfo, BufferUsage, RenderResourceContext, RenderResourceId}, }; use bevy_app::prelude::{EventReader, Events}; use bevy_asset::{AssetEvent, Assets, Handle}; use bevy_core::AsBytes; use bevy_ecs::{Local, Query...
use std::str::from_utf8; use std::mem; use std::fmt; use std::slice; use std::io; use std::path::Path; use std::ptr::copy_nonoverlapping; use std::io::{Read, Write, Seek, SeekFrom}; use std::borrow::Cow; use memmap::{Mmap, Protection}; use varinteger; use sourcemap::{RawToken, SourceMap}; use brotli2::read::{BrotliEnc...
//! Bonding in the Slave Role //! //! This example demonstrates the code required to connect and bond to a device. After this device //! is bonded the master can re-connect to the slave using through the *LE Privacy* reconnection //! process. //! //! # Note //! In order to exit this example, a signal (ctrl-c) needs to ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - DMA_IntStatus."] pub dma_int_status: crate::Reg<dma_int_status::DMA_INTSTATUS_SPEC>, #[doc = "0x04 - DMA_IntTCStatus."] pub dma_int_tcstatus: crate::Reg<dma_int_tcstatus::DMA_INTTCSTATUS_SPEC>, #[doc = "0x08 - DMA_IntTC...
use crate::prelude::*; mod game; use self::game::*; use std::str; use std::time::{Duration, Instant}; use hashbrown::HashMap; use rand::prelude::*; pub const NAME: &str = "Invest"; submit! { template::Response("invest_no_credits", "you don't have any credits."); template::Response("invest_zero_number", "ze...
use crate::rolling_hash::RollingHash; const BUZHASH_SEED: u32 = 0x1032_4195; #[allow(clippy::unreadable_literal)] static BUZHASH_TABLE: &[u32] = &[ 0xa40cc360, 0xbb785af8, 0x32c790bc, 0x6c64cd34, 0x83b4aa73, 0x36b691a5, 0x4631ad79, 0x5e49d231, 0xcab22600, 0x6d45bfdf, 0xcd26dfc8, 0xf2e63bec, 0x18cb0c69, 0x8178...
/* Copyright 2018 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dis...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct MarketDataRequest { /// MsgType = V #[serde(flatten)] pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'V'>, /// Must be unique, or the ID of previous Market...
/* Timers */ /* Manual Page 965 */ use super::{common, pointer}; pub struct Timer { cr1: *mut u32, // Control Register 1 cr2: *mut u32, // Control Register 2 smcr: *mut u32, // Slave Mode Control Register dier: *mut u32, // DMA/ Interrupt Enable Regist...
#![allow(non_snake_case)] use crate::geodesic::{self, GEODESIC_ORDER}; use crate::geodesiccapability as caps; use crate::geomath; use std::collections::HashMap; #[derive(Debug)] pub struct GeodesicLine { tiny_: f64, // This should be moved to consts _A1m1: f64, _A2m1: f64, _A3c: f64, _A4: f64, ...
use std::fmt; use serde_json; use crate::error::prelude::*; use crate::libindy::utils::anoncreds; use crate::libindy::utils::payments::PaymentTxn; use crate::utils::constants::DEFAULT_SERIALIZE_VERSION; use crate::utils::serialization::ObjectWithVersion; #[derive(Clone, Deserialize, Debug, Serialize, PartialEq)] pub...
use num_derive::FromPrimitive; use crate::attribute::{Attribute, AttributeName, AttributeCommon}; use crate::character::character_common_data::CharacterCommonData; use crate::character::character_sub_stat::CharacterSubStatFamily; use crate::character::{CharacterConfig, CharacterName, CharacterStaticData}; use crate::ch...
//! Driver for 25-series SPI Flash and EEPROM chips. use crate::{utils::HexSlice, BlockDevice, Error, Read}; use bitflags::bitflags; use core::convert::TryInto; use core::fmt; use embedded_hal::blocking::delay::DelayUs; use embedded_hal::blocking::spi::Transfer; use embedded_hal::blocking::spi::Write; use embedded_hal...
use super::Scene; use crate::canvas::*; use crate::swipe::{SwipeTracker, Swipe, Trigger, Direction}; use fxhash::FxHashMap; use libremarkable::image::RgbImage; use libremarkable::input::{gpio, multitouch, multitouch::Finger, InputEvent}; use libremarkable::device::{CURRENT_DEVICE, Model}; use std::cell::RefCell; use st...
/* MIT License Copyright (c) 2021 <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, distribut...
//! Parser for the date portion of a date-time expression use logos::{Lexer, Logos}; use crate::generators::datetime_expressions::{Adjustment, error, Operation}; use crate::generators::datetime_expressions::DateBase; use crate::generators::datetime_expressions::DateOffsetType; /// Struct storing the result of a pars...
use crate::components::err_box; use crate::components::footer; use crate::components::header; use crate::components::panel; use crate::eventsnode::entry_node; use crate::nice; use crate::router::{link_eventlog, link_wallet}; use crate::screens::meta::{MetaProvider, PageMetaInfo}; use crate::state::{AppState, Epoch, OnC...
#![feature(const_panic)] mod cpu; mod device; #[cfg(test)] mod tests; mod types; use cpu::Cpu; use device::{Audio, Lcd, Memory, Uart, Vga}; use types::*; use std::collections::VecDeque; use std::io::{Stdout, Write}; use std::sync::Arc; use std::time::Duration; use crossbeam::queue::SegQueue; use crossterm::{cursor,...
use smelling_salts::{Device, Watcher}; use std::{ convert::TryInto, future::Future, mem::{size_of, MaybeUninit}, os::{ raw::{c_void, c_int, c_ulong, c_long, c_char}, unix::{fs::OpenOptionsExt, io::IntoRawFd}, }, ptr::null_mut, pin::Pin, task::{Context, Poll}, fs::{se...
// use grep::regex::{ // RegexMatcher as RustRegexMatcher, RegexMatcherBuilder as RustRegexMatcherBuilder, // }; use grep_printer::{SummaryBuilder, SummaryKind}; use grep_regex::RegexMatcherBuilder; use grep_searcher::{Sink, SinkMatch}; use itertools::Itertools; use serde::{Deserialize, Serialize}; use std::{ c...
use amethyst::{ ecs::{Entities, Join, ReadExpect, System, Write, WriteExpect, WriteStorage}, network::simulation::TransportResource, }; use gv_core::{ actions::{ player::{PlayerCastAction, PlayerWalkAction}, ClientActionUpdate, IdentifiableAction, }, ecs::{ components::NetCo...
// Copyright (c) 2021 <NAME> <<EMAIL>> // All rights reserved. // // This software and the accompanying materials are made available under // the terms of the ISC License which is available in the project root as LICENSE-ISC, AND/OR // the terms of the MIT License which is available at in the project root as LICENSE-MI...
use std::time::{Duration, Instant}; use async_compression::tokio::write::GzipEncoder; use async_trait::async_trait; use bytes::{Bytes, BytesMut}; use codecs::{ encoding::{Framer, FramingConfig, SerializerConfig}, JsonSerializerConfig, NewlineDelimitedEncoder, NewlineDelimitedEncoderConfig, TextSerializerCo...
//! Functions for initializing and bringing up other CPU cores. //! //! These functions are intended to be invoked from the main core //! (the BSP -- bootstrap core) in order to jumpstart other cores. #![no_std] #![feature(asm)] extern crate alloc; #[macro_use] extern crate log; extern crate spin; extern crate vola...
use unlambda::*; macro_rules! assert_evals_to { ($src:expr, $expect:expr $(,)?) => { assert_evals_to!($src, $expect, ""); }; ($src:expr, $expect:expr, $input:expr $(,)?) => { let e = eval_to_string($src, Input::Str($input)).unwrap_or_else(|e| { panic!("Failed to evaluate {:?}: {...
// This file is part of Substrate. // Copyright (C) 2018-2020 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...
#[derive(Debug, Clone)] pub enum Key { Space, ExclamationMark, QutationMark, NumberSign, DollarSign, PercentSign, Ampersand, Apostrophe, LeftParenthesis, RightParenthesis, Asterisk, Plus, Comma, Minus, Period, Slash, N0, N1, N2, N3, N4,...
// 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...
// Copyright 2018 <NAME>. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to thos...
/*-------------------------------------- | Roblox Inventory Scanner | | Copyright (C) 2021 tornadus | | Last Update: 2/18/2021 | --------------------------------------*/ //Imports use reqwest::Client; use futures::stream::StreamExt; use serde::{Deserialize}; use std::collections::Ha...
//! `PubSubServer` is an actor. It maintains list of connection client session. //! And manages available rooms. Peers send messages to other peers in same //! room through `PubSubServer`. use super::*; use actix_redis::{Command, RedisActor, RespValue}; use defs::*; use rand::prelude::*; use rand::{self}; use redis_as...
// Copyright 2017 The nom-lua project developers // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // e...
//! Adds a unique ID to each node on the AST (unique in the current AST). #[cfg(test)] mod test; use std::{fmt, marker::PhantomData, mem}; use rustc_hash::FxHashMap; use crate::{ diagnostics::span::{HasSpan, Span, Spanned}, parse::{ block::Block, expr::{BinOp, Constructor, Expr, UnOp}, ...
//! # A Linear Algebra Library use num::ToPrimitive; use std::{collections::HashSet, iter::FromIterator}; /// The implementer can be viewed as a tensor of `shape` through the `as_shape` method. /// The resulting `EphemeralView` cannot outlive the original data struct. pub trait ToView<'a, Dtype> { fn as_shape<S: ...
///#![cfg_attr(test, feature(test, proc_macro_mod))] /// Detect dead disks in a ceph cluster /// 1. Detect dead disk /// 2. Report dead disk to JIRA for repairs /// 3. Test for resolution /// 4. Put disk back into cluster #[macro_use] extern crate serde_derive; mod create_support_ticket; mod in_progress; mod test_disk...
// Copyright 2018-2019 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) a...
//! //! Init codes //! //! This module including init codes for device, memory, and task system. //! This module is called by boot function. pub mod multiboot; use crate::arch::target_arch::context::ContextManager; use crate::arch::target_arch::device::io_apic::IoApicManager; use crate::arch::target_arch::device::loc...
// Copyright 2020 <盏一 <EMAIL>> // 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, sof...
// Copyright (c) 2020 Huawei Technologies Co.,Ltd. All rights reserved. // // StratoVirt is licensed under Mulan PSL v2. // You can use this software according to the terms and conditions of the Mulan // PSL v2. // You may obtain a copy of Mulan PSL v2 at: // http://license.coscl.org.cn/MulanPSL2 // THIS SOFTWA...
use hibitset::{ AtomicBitSet, BitIter, BitSet, BitSetAll, BitSetAnd, BitSetLike, BitSetNot, BitSetOr, BitSetXor, }; use thiserror::Error; pub type Index = u32; pub trait Join { type Item; type Access; type Mask: BitSetLike; fn open(self) -> (Self::Mask, Self::Access); /// Get a value out of ...
use engine::{Expr, Step, Choice, Term, Node, NodeName, VariableName, BinaryOp, UnaryOp}; use std::collections::HashMap; pub(crate) fn parse_expr(tokenizer: &mut TokenIterator) -> Result<Expr, ()> { let t = tokenizer.next().ok_or(())?; let left = match t { Token::Number(num) => Expr::Term(Term::Number(n...
use crate::rectangle_brush::RectangleBrush; use std::{ ops::Range, path::{Path, PathBuf}, }; use syntect::{ highlighting::{HighlightState, Highlighter, RangedHighlightIterator, Style, ThemeSet}, parsing::{ParseState, SyntaxSet}, }; use wgpu_glyph::{GlyphBrush, Point, Scale, SectionText, VariedSection}; ...
use std::cmp::Ordering; use std::collections::{BTreeSet, HashSet}; use std::fmt; use serde::Serialize; use super::{PointId, PointInfoLite, RouteSegmentRef}; use crate::values::{intersect, Point}; #[derive(Clone, Debug, Serialize)] pub struct Line { pub direction: Point, pub origin: Point, points: BTreeSe...
extern crate libsoundio_sys as raw; use super::error::*; use super::format::*; use super::sample::*; use super::util::*; use std::marker::PhantomData; use std::os::raw::{c_double, c_int}; use std::ptr; use std::slice; /// This is called when an instream has been read. The `InStreamUserData` struct is obtained /// fr...
//! Uses the timer interrupt to blink a led with different frequencies. //! //! This assumes that a LED is connected to pc13 as is the case on the blue pill board. //! //! Note: Without additional hardware, PC13 should not be used to drive an LED, see page 5.1.2 of //! the reference manaual for an explanation. This is ...
//! Contains the core submission logic that submits a batch of events at once to Elasticsearch //! and notifiers a separate oneshot channel for each event of the result. use crate::config::Configuration; use crate::elasticsearch::{ BulkError, BulkItem, BulkOperation, EnsureIndexExistsError, IndexStatus, MakeBu...
//! The trees module. //! This module contains: //! * Traits that all implementations of trees should implement //! * Specific implementations of trees //! //! The [`SomeWalker`] trait implements traversing a tree. This includes dealing with the borrow //! checking problems of recursive structures (using [`recursive_re...
use core::marker::PhantomData; use managed::ManagedSlice; use crate::common::*; use crate::connection::Connection; use crate::protocol::{commands::Command, Packet, ResponseWriter, SpecificIdKind}; use crate::target::Target; use crate::SINGLE_THREAD_TID; mod builder; mod error; mod ext; mod target_result_ext; pub us...
extern crate pwasm_abi; use pwasm_abi::types::*; use cap9_core::Serialize; use cap9_core::StorageValue; /// Generic wasm error #[derive(Debug)] pub struct Error; use crate::proc_table; use crate::syscalls::*; use crate::*; use crate::data::*; use core::marker::PhantomData; /// Same as [`StorageMap`], but can be enu...
use anyhow::Result; use log::debug; // because we use zydis data structures throughout our API // make this dependency public. // this way, our users can do `use lancelot::analysis::dis::zydis` // and not have any version conflicts. pub use zydis; use crate::{ arch::Arch, module::{Module, Permissions}, ut...
#![allow(clippy::integer_arithmetic, clippy::cast_possible_truncation)] // ref: https://github.com/phip1611/generic-tm1637-gpio-driver-rust/blob/main/src/lib.rs // ref: https://github.com/igelbox/tm1637-rs/blob/master/examples/main.rs // ref: https://github.com/rustrum/tmledkey-hal-drv/blob/master/examples/stm32f103/s...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
// Copyright 2019 Fullstop000 <<EMAIL>>. // // 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...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
use crate::{ linker, CompileResult, ModuleResult, SpirvCodegenBackend, SpirvModuleBuffer, SpirvThinBuffer, }; use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule, ThinShared}; use rustc_codegen_ssa::back::write::CodegenContext; use rustc_codegen_ssa::{CodegenResults, NativeLib}; use ru...
use instrumented::instrument; use regex::Regex; use crate::config; // Stripe fees static STRIPE_BASE_FEE: i64 = 30; // 30 cents static STRIPE_PCT_FEE: f64 = 0.029; // 2.9% /// The list of possible values for a RequestError's type. #[derive(Debug, PartialEq, Deserialize, Serialize)] pub enum ErrorType { #[serde(s...
use std::mem; use std::net::Ipv4Addr; use std::ptr::null_mut; use std::sync::{Arc, Mutex}; use bytes::Bytes; use lazy_static::lazy_static; use libc::{c_void, sockaddr}; use winapi::shared::ntdef::HANDLE; use winapi::shared::ws2def::{AF_INET, SOCKADDR_IN}; use winapi::um::synchapi::SetEvent; use winapi::um::sysinfoapi:...
use crate::bus::{PollResult, StringIndex, UsbBus, UsbBusAllocator}; use crate::class::{ControlIn, ControlOut, UsbClass}; use crate::control; use crate::control_pipe::ControlPipe; use crate::descriptor::{descriptor_type, lang_id, BosWriter, DescriptorWriter}; pub use crate::device_builder::{UsbDeviceBuilder, UsbVidPid};...
use rustc_hash::FxHashMap; use crate::{ llir::{ llir_impl::LlirFunction, llir_nodes::{Branch, Call, Condition, Function, Node, VariableAccessMut}, opt::{ code_stats::CodeStats, optimizers::{ optimize_alias_function, optimize_call_chain, optimize_commo...
use super::Optimizer; use crate::{ compress::util::{always_terminates, is_pure_undefined}, debug::dump, mode::Mode, util::ExprOptExt, }; use swc_common::{util::take::Take, Spanned, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_utils::{prepend, undefined, StmtLike}; use swc_ecma_visit::{noop_visit_type, N...
//! Generic sound source. //! //! # Overview //! //! Generic sound source is base building block for each other types of sound sources. It holds state of buffer read //! cursor, information about panning, pitch, looping, etc. It performs automatic resampling on the fly. //! //! # Usage //! //! Generic sound source can ...
// Copyright 2020 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT // http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD // https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied, // modified, or di...
use std::iter; use swc_atoms::{js_word, JsWord}; use swc_common::{util::take::Take, Mark, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; use swc_ecma_transforms_classes::{get_prototype_of, visit_mut_only_key}; use swc_ecma_utils::{private_ident, quote_ident, ExprFactory}; use swc_ecma_visit::{ ...
//! I2C Implementations //! //! Check the documentation of [`I2c`] for details. use crate::port; use core::marker::PhantomData; /// TWI Status Codes pub mod twi_status { // The status codes defined in the C header are meant to be used with the // masked status value: (TWSR & TW_STATUS_MASK). In our case, svd...
//! # Day 8: Seven Segment Search //! //! You barely reach the safety of the cave when the whale smashes into the cave //! mouth, collapsing it. Sensors indicate another exit to this cave at a much //! greater depth, so you have no choice but to press on. //! //! As your submarine slowly makes its way through the cave ...
extern crate failure; extern crate log; extern crate stderrlog; extern crate termion; extern crate tui; #[allow(dead_code)] mod util; use std::io; use termion::event::Key; use termion::input::MouseTerminal; use termion::raw::{IntoRawMode, RawTerminal}; use termion::screen::AlternateScreen; use tui::backend::TermionB...
use std::fs::{File, Metadata}; use std::cell::Cell; use std::collections::BTreeMap; use std::ops::Bound::{Included, Unbounded}; use std::rc::Rc; use std::path::{Path, PathBuf}; use polodb_bson::Document; use super::RawPage; use super::pagecache::PageCache; use super::header_page_wrapper; use super::header_page_wrapper:...
// 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 crate::block_buffer_pool::BlockBufferPool; use crate::leader_arrange::LeaderSchedule; use crate::leader_arrange_utils; use morgan_runtime::treasury::Treasury; use morgan_runtime::epoch_schedule::RoundPlan; use morgan_interface::bvm_address::BvmAddr; use std::collections::hash_map::Entry; use std::collections::{Hash...
use super::eval_queries::{mk_eval_cx, op_to_const}; use super::machine::CompileTimeEvalContext; use super::{ValTreeCreationError, ValTreeCreationResult, VALTREE_MAX_NODES}; use crate::interpret::{ intern_const_alloc_recursive, ConstValue, ImmTy, Immediate, InternKind, MemPlaceMeta, MemoryKind, PlaceTy, Scalar, ...
//! module for all the recovering mechanism around the cardano blockchains mod paperwallet; use crate::{account::Wallet, keygen, scheme as wallet, Password}; use chain_crypto::{Ed25519Extended, SecretKey}; use chain_impl_mockchain::legacy::OldAddress; use chain_path_derivation::{ bip44::{self, Bip44}, rindex:...
use arrayvec::ArrayVec; use spin::Mutex; use crate::fdt::MachineMeta; use crate::memory_region::MemoryRegion; use crate::plic::PlicState; use crate::pmap::{PageTables, PageTableRoot}; use crate::riscv::bits::*; use crate::riscv::csr; use crate::statics::SHARED_STATICS; use crate::trap::U64Bits; use crate::{pmap, print,...
/* * Copyright 2019 The Starlark in Rust Authors. * Copyright (c) Facebook, Inc. and its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/lic...
#![allow(clippy::new_without_default)] //! Interprets the terminal events we care about (keyboard input). //! //! Keyboard events are read from `stdin`. We look for byte strings of key combinations that we //! care about. E.g. Alt-arrow keys, C-w etc. #[cfg(test)] mod tests; use std::char; use std::collections::VecD...
mod user_info; use std::{ collections::HashMap, io::{self}, iter, net::SocketAddr, }; use bufstream::BufStream; use bytes::BytesMut; use ironrdp::{ nego, rdp, rdp::{ capability_sets::CapabilitySet, server_license::{ ClientNewLicenseRequest, ClientPlatformChallengeRe...
#![allow(unused_variables)] #![allow(non_upper_case_globals)] #![allow(warnings)] use pbr::ProgressBar; use std::io::{self, stderr}; use std::error::Error; use std::io::Write; use std::io::{BufWriter, BufRead, BufReader}; use std::collections::HashMap; use std::collections::hash_map::Entry; use itertools::Itertools; us...
#![allow(clippy::collapsible_if, clippy::len_zero)] use std::borrow::Borrow; use crate::args::ArgumentList; use crate::command::Command; use crate::context::Context; use crate::error::{Error, ErrorKind, Result}; use crate::option::{CommandOption, OptionList}; use crate::parse_result::ParseResult; use crate::tokenizer::...
//! Configures and runs the inbound proxy. //! //! The inbound proxy is responsible for terminating traffic from other network //! endpoints inbound to the local application. #![deny(warnings, rust_2018_idioms)] use self::allow_discovery::AllowProfile; pub use self::endpoint::{ HttpEndpoint, ProfileTarget, Reques...
// references: // [MD5](https://en.wikipedia.org/wiki/MD5) // [golang crypto md5](https://github.com/golang/go/blob/master/src/crypto/md5/md5.go) // [md-5](https://github.com/RustCrypto/hashes/) use core::{cmp::min, convert::TryInto}; static INIT_STATE: [u32; 4] = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476...
//! Support for actually generating a JS function shim. //! //! This `Builder` type is used to generate JS function shims which sit between //! exported functions, table elements, imports, etc. All function shims //! generated by `wasm-bindgen` run through this type. use crate::js::incoming; use crate::js::outgoing; u...
use std::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not, Shr, Shl}; // We interpret the values in the following layout: // **00**01**02**03**04**05*/06\*07**08**09**0A**0B**0C**** // 0D**0E**0F**10**11**12*/13 14\*15**16**17**18**19**1A** // **1B**1C**1D**1E**1F*/20 21 22\*23**24**25**...