text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
use deno_core::error::AnyError; use deno_core::ResourceId; use deno_core::ZeroCopyBuf; use deno_core::{OpState, Resource}; use serde::Deserialize; use std::borrow::Cow; use std::cell::RefCell; use std::rc::Rc; use super::error::WebGpuResult; struct WebGpuRenderBundleEncoder(RefCell<wgpu_core::command::RenderBundleEnc...
the_stack
use rustc_ast::walk_list; use rustc_data_structures::fx::FxHashSet; use rustc_hir as hir; use rustc_hir::def_id::DefId; use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor}; use rustc_hir::{Arm, Block, Expr, Local, Node, Pat, PatKind, Stmt}; use rustc_index::vec::Idx; use rustc_middle::middle::region::*; use ru...
the_stack
use std::cmp::min; use std::fmt::{self, Debug, Formatter}; use std::marker::PhantomData; use std::mem; use std::ops::Deref; use std::path::{Path, PathBuf}; use std::ptr; use std::result::Result as StdResult; use std::slice; use serde::de::{self, Deserializer}; use serde::ser::Serializer; use serde::{Deserialize, Seria...
the_stack
/// Creates a standard IANA type wrapping an integer. /// /// This adds impls for `From`, `PartialEq`, `Eq`, `PartialOrd`, `Ord`, and /// `Hash`. /// /// For `FromStr` and `Display`, see one of the other macros in this module. macro_rules! int_enum { ( $(#[$attr:meta])* => $ianatype:ident, $inttype:path; ...
the_stack
// The general pattern followed here is: Change one thing between rev1 and rev2 // and make sure that the hash has changed, then change nothing between rev2 and // rev3 and make sure that the hash has not changed. // build-pass (FIXME(62277): could be check-pass?) // revisions: cfail1 cfail2 cfail3 // compile-flags: -...
the_stack
//! This code is used to generate literal expressions of various kinds. //! These include integer, floating, array, struct, union, enum literals. use super::*; use std::iter; impl<'c> Translation<'c> { /// Generate an integer literal corresponding to the given type, value, and base. pub fn mk_int_lit(&self, t...
the_stack
#![cfg(feature = "alloc")] // TODO(tarcieri): test full set of vectors from the reference implementation: // https://github.com/P-H-C/phc-winner-argon2/blob/master/src/test.c use argon2::{ Algorithm, Argon2, Error, Params, ParamsBuilder, PasswordHash, PasswordHasher, PasswordVerifier, Version, }; use hex_lite...
the_stack
// spell-checker:ignore uioerror use std::{ error::Error, fmt::{Display, Formatter}, sync::atomic::{AtomicI32, Ordering}, }; static EXIT_CODE: AtomicI32 = AtomicI32::new(0); /// Get the last exit code set with [`set_exit_code`]. /// The default value is `0`. pub fn get_exit_code() -> i32 { EXIT_CODE....
the_stack
#![deny(clippy::disallowed_methods)] #![deny(clippy::disallowed_types)] use std::collections::BTreeMap; use std::collections::HashMap; use std::collections::HashSet; use std::path::Path; use std::path::PathBuf; use analyze::get_top_level_decls; use anyhow::anyhow; use anyhow::Context; use anyhow::Result; use analyze...
the_stack
#![deny(missing_docs)] #![warn(rust_2018_idioms)] use atomic_option::AtomicOption; use crossbeam_channel as mpsc; use parking_lot_core::SpinWait; use std::cell::UnsafeCell; use std::ops::Deref; use std::sync::atomic; use std::sync::mpsc as std_mpsc; use std::sync::Arc; use std::thread; use std::time; const SPINTIME:...
the_stack
use super::{CoreId, Kni, KniBuilder, KniTxQueue, Mbuf, Mempool, MempoolMap, SocketId}; use crate::dpdk::DpdkError; use crate::ffi::{self, AsStr, ToCString, ToResult}; #[cfg(feature = "metrics")] use crate::metrics::{labels, Counter, SINK}; use crate::net::MacAddr; #[cfg(feature = "pcap-dump")] use crate::pcap; use crat...
the_stack
use std::collections::HashSet; use std::env::home_dir; use std::net::{TcpListener, Ipv6Addr}; use std::sync::mpsc::{channel, TryRecvError}; use std::sync::{Arc, Mutex}; use std::time::Duration; use std::str::FromStr; use std::thread; use multiqueue::{BroadcastReceiver, BroadcastSender, broadcast_queue}; use rusqlite::...
the_stack
// rustdoc-stripper-ignore-next //! Runtime type information. use crate::translate::*; use crate::Slice; use std::fmt; use std::mem; use std::ptr; // rustdoc-stripper-ignore-next /// A GLib or GLib-based library type #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[doc(alias = "GType")] #[repr(transpar...
the_stack
use std::num::Wrapping; use bytes::Bytes; use super::HeaderTable; use crate::hpack::static_table::StaticTable; use crate::hpack::HeaderValueFound; use bytes::BytesMut; pub(crate) trait EncodeBuf { fn write_all(&mut self, bytes: &[u8]); fn reserve(&mut self, additional: usize) { drop(additional); ...
the_stack
#[macro_use] extern crate diesel; #[macro_use] extern crate log; use bigdecimal::BigDecimal; use chrono::prelude::*; use diesel::dsl::*; use models::plasma::block::Block; use models::plasma::block::BlockData; use models::plasma::tx::TransactionType::{Deposit, Exit, Transfer}; use models::plasma::tx::{ DepositTx, E...
the_stack
use arrayref::array_ref; use blake3::KEY_LEN; use pyo3::buffer::PyBuffer; use pyo3::exceptions::{PyBufferError, PyValueError}; use pyo3::prelude::*; use pyo3::types::{PyAny, PyBytes, PyString}; use pyo3::wrap_pyfunction; unsafe fn unsafe_slice_from_buffer<'a>(py: Python, data: &'a PyAny) -> PyResult<&'a [u8]> { //...
the_stack
use crate::sections::image_data_section::ChannelBytes; use crate::sections::PsdCursor; use thiserror::Error; pub trait IntoRgba { /// Given an index of a pixel in the current rectangle /// (top left is 0.. to the right of that is 1.. etc) return the index of that pixel in the /// RGBA image that will be ge...
the_stack
macro_rules! io_test_cases { ($impl:ident, $variant:ident) => { mod $impl { mod bufread { mod compress { use crate::utils::{ algos::$variant::{ sync, $impl::{bufread, read}, ...
the_stack
use image::{GenericImage, GenericImageView, ImageBuffer, Luma}; use crate::definitions::Image; use crate::union_find::DisjointSetForest; use std::cmp; /// Determines which neighbors of a pixel we consider /// to be connected to it. #[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum Connectivity { /// A pixel i...
the_stack
use std::collections::HashMap; use std::fs::{read, File}; use std::io::BufWriter; use std::io::Write; use std::path::Path; use std::sync::Mutex; use crate::parsers::nom_utils::NomCustomError; use anyhow::{anyhow, format_err, Context, Result}; use nom::multi::fold_many_m_n; use nom::IResult; use super::utils_parsing::...
the_stack
#![allow(non_upper_case_globals)] #![allow(non_snake_case)] #![allow(unused_variables)] #![allow(unused_mut)] use snowball::SnowballEnv; use snowball::Among; static A_0: &'static [Among<Context>; 7] = &[ Among("", -1, 7, None), Among("qu", 0, 6, None), Among("\u{00E1}", 0, 1, None), Among("\u{00E9}", 0...
the_stack
//! This module provides the `GET /admin/circuits` endpoint for listing the definitions of circuits //! in Splinter's state. use actix_web::{error::BlockingError, web, Error, HttpRequest, HttpResponse}; use futures::{future::IntoFuture, Future}; use std::collections::HashMap; #[cfg(feature = "authorization")] use cra...
the_stack
use std::{ collections::HashMap, io::Write, sync::mpsc::{channel, Receiver}, time::Instant, }; use midir::{Ignore, MidiInput, MidiInputConnection, MidiInputPort}; use super::Config; pub const MIDI_N: usize = 32; pub struct Midi { pub conns: Vec<MidiInputConnection<()>>, pub queues: Vec<Recei...
the_stack
use crate::ptr::{wrap_ptr, BaseRefCountedExt, RefCounterGuard, WrapperFor}; use crate::types::string::CefString; use crate::ToCef; use std::ptr::null_mut; use std::slice; use std::sync::Arc; use zaplib_cef_sys::{ cef_string_utf16_t, cef_v8_propertyattribute_t, cef_v8array_buffer_release_callback_t, cef_v8context_ge...
the_stack
#[doc(hidden)] #[macro_export] macro_rules! flow_watermarks { (($($rs:ident),+), ($($ws:ident),+)) => { let cb_builder = $crate::make_callback_builder!(($($rs.add_state(())),+), ($($ws),+)); cb_builder.borrow_mut().add_watermark_callback_with_priority(|timestamp, $($rs),+, $($ws),+| { $(...
the_stack
use crate::definitions::Image; use crate::map::{ChannelMap, WithChannel}; use image::{GenericImageView, GrayImage, Luma, Pixel, Primitive, Rgb, Rgba}; use std::ops::AddAssign; /// Computes the 2d running sum of an image. Channels are summed independently. /// /// An integral image I has width and height one greater th...
the_stack
//! Filtering definitions for controlling what modules and levels are logged use crate::{Level, Metadata}; use std::{env, str::FromStr}; pub struct FilterParseError; /// A definition of the most verbose `Level` allowed, or completely off. #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] pub enum LevelFi...
the_stack
use super::*; /// embedded-hal compatible blocking I2C implementation /// /// **NOTE**: Before using blocking I2C, you need to enable the DWT cycle counter using the /// [DWT::enable_cycle_counter] method. pub struct BlockingI2c<I2C, PINS> { nb: I2c<I2C, PINS>, start_retries: u8, timeouts: DwtTimeouts, } ...
the_stack
use ckb_app_config::BlockAssemblerConfig; use ckb_chain_spec::consensus::Consensus; use ckb_dao_utils::genesis_dao_data; use ckb_launcher::SharedBuilder; use ckb_shared::Shared; use ckb_store::ChainStore; use ckb_test_chain_utils::always_success_cell; use ckb_types::{ bytes, core::{ capacity_bytes, hard...
the_stack
use core::convert::TryFrom; use core::fmt; use core::iter::FusedIterator; use core::slice; use core::str; /// Returns whether a [`char`] is ASCII and has a literal escape code. /// /// Control characters in the range `0x00..=0x1F`, `"`, `\` and `DEL` have /// non-trivial escapes. /// /// # Examples /// /// ``` /// # u...
the_stack
use std::sync::Arc; use std::sync::Mutex; use super::EguiManager; use rafx::api::RafxResult; use sdl2::event::Event; use sdl2::mouse::MouseButton; use sdl2::video::Window; struct CursorHandler { system_cursor: Option<sdl2::mouse::SystemCursor>, cursor: Option<sdl2::mouse::Cursor>, mouse: sdl2::mouse::Mous...
the_stack
use crate::Editable; use dotrix::{ Color, Camera, Frame, Input, World }; use dotrix::ecs::{ Const, Mut }; use dotrix::egui::{ CollapsingHeader, DragValue, Egui, Grid, ScrollArea, SidePanel, Slider, }; use dotrix::input::{ Button, State as InputState }; use dotrix::math::Vec3; use dotrix::ov...
the_stack
use super::{ branch_expander, data_expander, heap2stack, ir::*, normalizer, rewriter, simplifier, traverser, }; use crate::ast; use crate::module::ModuleSet; use derive_new::new; use if_chain::if_chain; use std::collections::{hash_map, BTreeSet, HashMap}; use std::sync::Arc; #[derive(Debug, Clone)] pub struct Cont...
the_stack
use std::collections::HashSet; use std::iter::once; use crate::bsdf::*; // use crate::camera::*; use crate::film::*; use crate::integrator::*; use crate::light::*; use crate::nn_v2::*; use crate::sampler::*; use crate::scene::*; use crate::shape::*; use crate::texture::ShadingPoint; use crate::*; use nalgebra as na; ...
the_stack
use crate::ir::{self, Id, PortIterator, RRC}; use petgraph::{ algo, graph::{DiGraph, NodeIndex}, visit::EdgeRef, Direction::{Incoming, Outgoing}, }; use std::fmt::Write; use std::{collections::HashMap, rc::Rc}; type Node = RRC<ir::Port>; type Edge = (); /// A petgraph::DiGraph where ports are the node...
the_stack
use log::info; use once_cell::sync::Lazy; use parking_lot::Mutex; use std::collections::HashMap; use tokio::sync::mpsc::{Receiver, Sender}; /// Latest stats updated every second; used in SHOW STATS and other admin commands. static LATEST_STATS: Lazy<Mutex<HashMap<usize, HashMap<String, i64>>>> = Lazy::new(|| Mutex...
the_stack
use crate::VkDevice; use super::device::RawDevice; use ash::{ prelude::VkResult, vk::{self, ShaderModule}, }; use std::{ffi::CString, sync::Arc}; use super::instance::VkQueues; #[derive(Debug)] pub enum Pipeline { Graphics(VkGraphicsPipeline), Compute(VkComputePipeline), } pub struct VkRenderPass { ...
the_stack
use language_reporting as l_r; use lark_actor::{Actor, LspResponse, QueryRequest}; use lark_entity::EntityTables; use lark_intern::{Intern, Untern}; use lark_parser::{ParserDatabase, ParserDatabaseExt}; use lark_pretty_print::PrettyPrintDatabase; use lark_span::{ByteIndex, FileName, Span}; use lark_string::{GlobalIdent...
the_stack
use crate::texture::{Texture, TextureKey}; use ash::version::DeviceV1_0; use ash::vk; use imgui_winit_support::{HiDpiMode, WinitPlatform}; struct GfxResources { imgui_render_pass: vk::RenderPass, imgui_framebuffer: vk::Framebuffer, imgui_texture: Texture, } pub struct ImGuiBackend { imgui_platform: W...
the_stack
use crate::align_padding; use alloc::vec::Vec; use core::alloc::{GlobalAlloc, Layout}; use core::hash::Hasher; use core::marker::PhantomData; use core::ops::Deref; use core::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed, Release, SeqCst}; use core::sync::atomic::{compiler_fence, fence, AtomicU64, AtomicUsize}; use ...
the_stack
use super::super::session::Session; use super::super::State as SuperState; use super::super::*; use super::{ region::{Frame, Window}, Shared, }; use lorawan_encoding::{ self, creator::JoinRequestCreator, keys::AES128, parser::DevAddr, parser::{parse_with_factory as lorawan_parse, *}, }; pub...
the_stack
use std::{ cell::RefCell, ops::{Index, IndexMut}, sync::Arc, }; use crate::{ math::{add, dot, invert_quat, mix, norm, rotate, scale, sub}, ring::Ring, set::{set, Set, SetHandle}, swap::Swap, Controlled, Filter, Handle, Sample, Signal, Stop, }; type ErasedSpatial = Arc<Spatial<Stop<dyn ...
the_stack
use std::io; use ByteTendril; use http2::stream::StreamId; // RFC 7540, section 7, Error Codes mod error_code; pub use self::error_code::ErrorCode; /// A frame header’s flags. pub trait Flags: From<u8> + Copy { /// Get the bits set by this flags collection as a `u8`. fn bits(&self) -> u8; } impl Flags for u8...
the_stack
use criterion::measurement::Measurement; use criterion::{criterion_group, criterion_main, BenchmarkGroup, Criterion}; use ic_crypto::utils::{NodeKeysToGenerate, TempCryptoComponent}; use ic_interfaces::crypto::{ BasicSigVerifier, BasicSigVerifierByPublicKey, BasicSigner, SignableMock, DOMAIN_IC_REQUEST, }; use ic_...
the_stack
use futures::prelude::*; use lazy_static::lazy_static; use parking_lot::Mutex; use regex::{Captures, Error, Regex, RegexSet}; use serde::Serialize; use std::collections::HashMap; use std::{borrow::Cow, convert::TryFrom, sync::Arc}; mod serialize; pub use serialize::{Redacted, RedactedItem}; pub const UNREDACTED_CANAR...
the_stack
use clap::{App, Arg}; use glium::{ implement_vertex, index::PrimitiveType, program, texture::RawImage2d, uniform, Display, IndexBuffer, Surface, Texture2d, VertexBuffer, }; use glutin::{event_loop::EventLoop, window::WindowBuilder, ContextBuilder}; use nokhwa::{ nokhwa_initialize, query_devices, Camera, Cam...
the_stack
#[path = "common.rs"] mod common; use std::path::Path; use allsorts::binary::read::ReadScope; use allsorts::tables::glyf::{ BoundingBox, CompositeGlyph, CompositeGlyphArgument, CompositeGlyphFlag, GlyfRecord, GlyfTable, Glyph, GlyphData, Point, SimpleGlyph, SimpleGlyphFlag, }; use allsorts::tables::{HeadTable...
the_stack
use super::{ common::{Job, JobResult, NodeLocation}, Iter, }; use futures::{stream::FuturesUnordered, try_ready, Async, Future, IntoFuture, Poll, Stream}; use std::{ collections::{HashMap, VecDeque}, hash::Hash, mem, }; /// `bounded_traversal_dag` traverses implicit asynchronous DAG specified by `i...
the_stack
use crate::ast::{ helper::raw::WindowName, module::Content, CreationalWith, DefinitionalArgs, WithExpr, }; use super::super::visitors::prelude::*; macro_rules! stop { ($e:expr, $leave_fn:expr) => { if $e? == VisitRes::Stop { return $leave_fn; } }; } /// Visitor for traversing a...
the_stack
use std::io::Cursor; use crate::net::constants::STANDARD_HEADER_SIZE; use crate::packet::header::{ AckedPacketHeader, ArrangingHeader, FragmentHeader, HeaderReader, StandardHeader, }; use crate::{ErrorKind, Result}; /// Can be used to read the packet contents of laminar. /// /// # Remarks /// - `PacketReader` is ...
the_stack
use crate::{ connectors::{ impls::http, prelude::Url, tests::{free_port::find_free_tcp_port, setup_for_tls, ConnectorHarness}, utils::url::HttpDefaults, }, errors::Result, }; use async_std::{ io::Cursor, task::{spawn, JoinHandle}, }; use http_types::{ headers::{He...
the_stack
use core::convert::TryFrom; // NOTE: // 1. AArch64 架构在 ARMv8.4-A 版本里面增加了对 SHA2-512 的支持。 // 2. X86/X86_64 架构的 SHA-NI 目前并不包含 SHA2-512。 #[cfg(all(target_arch = "aarch64", not(feature = "force-soft")))] mod aarch64; mod generic; // Round constants const K64: [u64; 80] = [ 0x428A2F98D728AE22, 0x713744912...
the_stack
use super::super::*; #[test] fn read() { use std::io::Cursor; const INPUT: Ipv6Header = Ipv6Header { traffic_class: 1, flow_label: 0x81806, payload_length: 0x8021, next_header: 30, hop_limit: 40, source: [1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,...
the_stack
use crate::baseclient::ClientCoding; use crate::server_suite::coding::CodingItem; use anyhow::*; use ring::aead; use ring::hkdf; use ring::rand::{SecureRandom, SystemRandom}; const KEYSIZE: usize = 32; // const SALTSIZE: usize = KEYSIZE; #[derive(Clone, Debug, PartialEq)] pub struct AES256GCMCodec; #[derive(Clone, D...
the_stack
use std::{fmt::Display, str::FromStr}; use arrow::compute::SortOptions; use indexmap::{map::Iter, IndexMap}; use itertools::Itertools; use snafu::Snafu; use super::TIME_COLUMN_NAME; #[derive(Debug, Snafu)] pub enum Error { #[snafu(display("invalid column sort: {}", value))] InvalidColumnSort { value: String ...
the_stack
//use std::fmt::format; use std::sync::mpsc::SyncSender; use serde_json::json; use tokio::net::TcpListener; use tokio::sync::oneshot; use tokio_stream::{wrappers::TcpListenerStream, StreamExt}; use warp::hyper::StatusCode; use warp::reject::{self, Rejection}; use warp::reply::{self, Reply}; use warp::{path, Filter}; ...
the_stack
use crate::{contexts::WriteContext, endpoint, sync::flag, transmission}; use s2n_quic_core::{ ack, event::{self, ConnectionPublisher}, frame::HandshakeDone, packet::number::PacketNumber, }; pub type Flag = flag::Flag<HandshakeDoneWriter>; /// The handshake status is used to track the handshake progres...
the_stack
use core::cmp::{max, min}; use core::u32; use crate::std_facade::Vec; #[cfg(not(feature="std"))] use num_traits::float::FloatCore; use crate::num::sample_uniform; use crate::strategy::traits::*; use crate::test_runner::*; /// A **relative** `weight` of a particular `Strategy` corresponding to `T` /// coupled with `T...
the_stack
use crate::chase::{ r#impl::basic, Bounder, EvaluateResult, Evaluator, Model, Observation, PreProcessor, Rel, Strategy, WitnessTerm, E, }; use either::Either; use itertools::Itertools; use razor_fol::syntax::{formula::Atomic, term::Complex, Const, Func, Theory, Var, FOF}; use std::{ cell::Cell, collecti...
the_stack
use proc_macro2::{Span, TokenStream as Toks}; use quote::{quote, ToTokens, TokenStreamExt}; use syn::parse::{Error, Parse, ParseStream, Result}; use syn::{braced, bracketed, parenthesized, Expr, Ident, Lifetime, LitInt, LitStr, Member, Token}; #[allow(non_camel_case_types)] mod kw { use syn::custom_keyword; c...
the_stack
// === Standard Linter Configuration === #![deny(non_ascii_idents)] #![warn(unsafe_code)] use enso_profiler as profiler; use enso_profiler_data as data; // ================= // === Constants === // ================= type RowNumber = i32; // ======================= // === Label Formating === // ==================...
the_stack
extern crate bagpipe; extern crate crossbeam; extern crate num_cpus; use crossbeam::mem::epoch; use crossbeam::sync::{MsQueue, TreiberStack}; use bagpipe::bag::{WeakBag, SharedWeakBag, PopStatus, ArcLike}; use bagpipe::queue::{GeneralYC, YangCrummeyQueue, FAAQueueLowLevel, FAAArrayQueue}; use std::sync::{Arc, Barrier};...
the_stack
use derive_more::{From, Into}; use std::cell::RefCell; use std::sync::Mutex; use crate::device::*; use crate::error::*; /// Represents a member of the device pool /// /// This holds both a mutex to a `Device` and information about the device. You must create instances of `DevicePoolMember` to construct your own custo...
the_stack
use rustc::mir; use rustc::ty::layout::{Size, Align}; use rustc::ty::subst::Substs; use rustc::ty::{self, Ty}; use error::{EvalError, EvalResult}; use eval_context::{EvalContext, ValTy}; use place::{Place, PlaceExtra}; use memory::{MemoryPointer}; use value::{PrimVal, PrimValKind, Value}; impl<'a, 'tcx> EvalContext<'...
the_stack
use std::prelude::v1::*; use std::{cmp, fmt, mem, str}; #[cfg(feature = "std")] use std::error; /// Max recursion depth. pub const STACK_SIZE: usize = 4; /// Special skip value to indicate to use platform pointer size instead. pub(crate) const PTR_SKIP: u8 = 0; //----------------------------------------------------...
the_stack
extern crate filetime; extern crate url; extern crate walkdir; use filetime::set_file_times; use walkdir::{WalkDir}; use std::convert; use std::env; use std::error::Error as ErrorTrait; use std::ffi::OsStr; use std::fmt; use std::fs::{self, File}; use std::io::{self, Read, Write}; use std::ops; use std::path::{Path, ...
the_stack
use crate::{ specification, substitution::{pick_from_replacements, Substitute}, DataGenRng, RandomNumberGenerator, }; use snafu::{ResultExt, Snafu}; use std::fmt; /// Tag-specific Results pub type Result<T, E = Error> = std::result::Result<T, E>; /// Errors that may happen while creating tags #[derive(Sna...
the_stack
use crate::prelude::*; use crate::controller::searcher::component; use crate::controller::searcher::component::Component; use crate::model::execution_context; use crate::model::suggestion_database; use double_representation::module; // ==================== // === ModuleGroups === // ==================== /// Modul...
the_stack
mod x86_64 { use sericum::{codegen::x64::exec, ir, ir::prelude::*, sericum_ir}; #[test] fn test0_mem2reg() { let mut m = Module::new("sericum"); sericum_ir!(m; define [i32] func [] { entry: i = alloca i32; store (i32 3), (%i); li = load (%i); ...
the_stack
use std::cmp; use std::fmt; use std::fs::File; use std::io::{BufRead, BufReader, BufWriter, Write}; #[cfg(test)] use rand::rngs::StdRng; #[cfg(test)] use rand::Rng; use serde::{Deserialize, Serialize}; use crate::constants::NodeId; use crate::constants::Weight; #[derive(Serialize, Deserialize, Clone)] pub struct In...
the_stack
use super::entry::{PageEntry, PageEntryFlags}; use super::page; use super::{Page, PageIndex}; use crate::memory::address::{PhysicalAddress, VirtualAddress}; use crate::memory::frame::{self, Frame}; use crate::memory::FrameAllocator; use core::marker::PhantomData; use core::ops::{Index, IndexMut}; use core::ptr::Unique;...
the_stack
mod behavior; mod segment; mod slice; pub use behavior::Behavior; pub(crate) use segment::Segment; pub use slice::Slice; pub type Free<'a, M> = Slice<'a, M, behavior::Free>; pub type Occupied<'a, M> = Slice<'a, M, behavior::Occupied>; pub type OccupiedWipe<'a, M> = Slice<'a, M, behavior::OccupiedWipe>; use crate::me...
the_stack
#![allow(dead_code)] use super::metadata; use crate::oauth2::{JwsClaims, JwsHeader}; use crate::{AccessToken, Error, ErrorKind, Result}; use async_trait::async_trait; use chrono::{Duration, Utc}; use rustls::sign::Signer; use rustls::sign::SigningKey; use rustls_pemfile::Item; use serde::{Deserialize, Serialize}; use ...
the_stack
use codecs::h264; use platform::macos::coremedia::{self, CMBlockBuffer, CMFormatDescription, CMSampleBuffer}; use platform::macos::coremedia::{CMSampleTimingInfo, CMTime, OSStatus, kCMVideoCodecType_H264}; use platform::macos::corevideo::{CVBuffer, DecodedFrameImpl}; use platform::macos::corevideo::ffi::CVImageBufferRe...
the_stack
use std::cmp::min; use std::fs::{self, File}; use std::io::{self, IoSlice, Read, Write}; use std::lazy::SyncLazy; use std::net::{self, Shutdown, SocketAddr}; use std::num::NonZeroUsize; use std::thread::sleep; use std::time::Duration; use heph::actor::{self, Bound}; use heph::actor_ref::{ActorRef, RpcMessage}; use hep...
the_stack
use crate::config::CONFIG; use crate::ui::article::links::{Link, LinkHandler}; use crate::ui::article::view::{Element, Line, RenderedElement}; use cursive::theme::Style; pub struct LinesWrapper { width: usize, pub lines_wrapped: bool, pub headers: Vec<String>, pub header_coords: Vec<usize>, pub l...
the_stack
use cli::Args; use db::{Database, AnimationId, TextureId, PaletteId, ModelId, PatternId, MatAnimId}; use errors::Result; /// A Connection records interrelationships between Nitro resources, namely how /// all the other resources relate to the models. pub struct Connection { pub models: Vec<ModelConnection>, } ///...
the_stack
use std::collections::VecDeque; use std::convert::From; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::PathBuf; use std::sync::{Arc, Mutex}; use std::time::Instant; use backoff::backoff::Backoff; use backoff::ExponentialBackoff; use crossbeam::queue::SegQueue; use failure::{format_err, Error, Res...
the_stack
use crate::binding::*; use crate::chkerr; use crate::connection::Conn; use crate::sql_type::FromSql; use crate::sql_type::OracleType; use crate::sql_type::ToSql; use crate::sql_type::ToSqlNull; use crate::statement::QueryParams; use crate::statement::Stmt; use crate::Connection; use crate::Error; use crate::Result; use...
the_stack
#[cfg(feature = "backtrace")] use crate::backtrace::Backtrace; use core::alloc::{AllocError, LayoutErr}; use core::array; use core::any::TypeId; use core::cell; use core::char; use core::fmt::{self, Debug, Display}; use core::mem::transmute; use core::num; use alloc_crate::str; use alloc_crate::string::{self, String}; ...
the_stack
use loupe::{MemoryUsage, MemoryUsageTracker}; use std::convert::TryInto; use std::fmt; use std::mem; use std::sync::{Arc, Mutex}; use wasmer::wasmparser::{Operator, Type as WpType, TypeOrFuncType as WpTypeOrFuncType}; use wasmer::{ ExportIndex, FunctionMiddleware, GlobalInit, GlobalType, Instance, LocalFunctionInde...
the_stack
pub use pallet::*; #[cfg(test)] mod mock; #[cfg(test)] mod tests; #[frame_support::pallet] pub mod pallet { use blake2::digest::{Update, VariableOutput}; use blake2::VarBlake2b; use frame_support::{ pallet_prelude::*, traits::{Currency, ExistenceRequirement}, unsigned::ValidateUns...
the_stack
use std::{f64, mem, num::FpCategory, ops::RangeInclusive, usize}; use arci::{BaseVelocity, MoveBase}; use iced::{ button, slider, text_input, window, Align, Application, Button, Checkbox, Clipboard, Column, Command, Container, Element, HorizontalAlignment, Length, Row, Settings, Slider, Text, TextInput, };...
the_stack
use bitcoin::consensus::encode; use bitcoin::network::message::RawNetworkMessage; use crossbeam_channel as chan; use nakamoto_common::block::time::{LocalDuration, LocalTime}; use nakamoto_p2p::error::Error; use nakamoto_p2p::protocol; use nakamoto_p2p::protocol::{Command, DisconnectReason, Event, Input, Link, Out}; ...
the_stack
use std::io; use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use csv; /// A simple index for random access to CSV records. /// /// This index permits seeking to the start of any CSV record with a constant /// number of operations. /// /// The format of the index is simplistic and amenable to serializing to d...
the_stack
use nom::{digit, double, IResult}; use std::str; use std::str::FromStr; use std::collections::HashMap; extern crate rand; use self::rand::Rng; use node; use node::NodeKind; use closure::Prog; use id::IdGen; use typing::{Type, TypeScheme}; use std::boxed::Box; // syntax reference: https://caml.inria.fr/pub/docs/m...
the_stack
//! Message handlers for v1 authorization messages use cylinder::{Signature, Signer, Verifier}; use crate::error::InternalError; use crate::network::auth::state_machine::challenge_v1::{ ChallengeAuthorizationAcceptingAction, ChallengeAuthorizationAcceptingState, ChallengeAuthorizationInitiatingAction, Challen...
the_stack
use crate::consensus::{ membership::{Membership, MembershipError}, metrics::NotaryMetrics, pool_reader::PoolReader, prelude::*, utils::{find_lowest_ranked_proposals, get_adjusted_notary_delay}, ConsensusCrypto, }; use ic_interfaces::state_manager::StateManager; use ic_interfaces::time_source::Ti...
the_stack
use crate::sync::{RwLock, RwLockReadGuard}; use std::{ fmt::Debug, fs::{self, File, OpenOptions}, io::{self, Write}, path::Path, sync::atomic::{AtomicUsize, Ordering}, }; use time::{format_description, Duration, OffsetDateTime, Time}; /// A file appender with the ability to rotate log files at a fi...
the_stack
use crate::error::*; use crate::mempool::Mempool; use failure::Error; use stegos_blockchain::Timestamp; use stegos_blockchain::{Blockchain, Output, Transaction, TransactionError}; use stegos_crypto::hash::Hash; /// /// Validate transaction. /// pub(crate) fn validate_external_transaction( tx: &Transaction, mem...
the_stack
use crate::error::{KademliaError, Result}; use control_macro::get_return; use fluence_libp2p::{generate_swarm_event_type, types::OneshotOutlet}; use particle_protocol::Contact; use trust_graph::InMemoryStorage; use futures::FutureExt; use futures_timer::Delay; use libp2p::identity::PublicKey; use libp2p::{ core::...
the_stack
use crate::{ clock::Clock, heuristics::{ ALERT_METRICS_HEARTBEAT_DURATION_PRODUCTION, ALERT_METRICS_HEARTBEAT_DURATION_TESTING, ALERT_METRICS_MINIMUM_PRODUCTION_METRICS_DEBUG_THRESHOLD, ALERT_METRICS_MINIMUM_PRODUCTION_METRICS_THRESHOLD, }, model::get_model_bytes, production_metrics::{ProductionMetrics, Prod...
the_stack
use wasm_bindgen::prelude::*; // GENERATOR-BEGIN: Enum // ⚠️This was generated by GENERATOR!🦹‍♂️ /// `CPUID` feature flags #[wasm_bindgen] #[derive(Copy, Clone)] #[allow(non_camel_case_types)] pub enum CpuidFeature { /// 8086 or later INTEL8086 = 0, /// 8086 only INTEL8086_ONLY = 1, /// 80186 or later INTEL186 ...
the_stack
//! A scope guard will run a given closure when it goes out of scope, //! even if the code between panics. //! (as long as panic doesn't abort) //! //! # Examples //! //! ## Hello World //! //! This example creates a scope guard with an example function: //! //! ``` //! extern crate scopeguard; //! //! fn f() { //! ...
the_stack
use crate::prelude::*; use crate::source::*; use crate::syntax::*; use std::str; // ================= // === Constants === // ================= /// An optimization constant. Based on it, the estimated memory is allocated on the beginning of /// parsing. pub const AVERAGE_TOKEN_LEN: usize = 5; // ===============...
the_stack
extern crate chrono; extern crate clap; extern crate config; use std::collections::{HashMap, HashSet, VecDeque}; use std::ffi::OsString; use std::fmt::Debug; use std::fs::OpenOptions; use std::io::{Read, Seek, SeekFrom, Write}; use std::ops::Range; use std::path::{Path, PathBuf}; use std::process::Command; use std::rc...
the_stack
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // STD Dependencies...
the_stack
use async_trait::async_trait; use std::default::Default; use ssi::did::{DIDMethod, Document}; use ssi::did_resolve::{ DIDResolver, DocumentMetadata, ResolutionInputMetadata, ResolutionMetadata, ERROR_INVALID_DID, TYPE_DID_LD_JSON, }; use ssi::USER_AGENT; const TOR_SOCKS_PORT: usize = 9050; /// did:onion Meth...
the_stack
use spirv_std::glam::UVec3; use crate::{ autobind, atomic::AtomicF32, util::Load, }; #[repr(C)] pub struct PoolPushConsts2 { bs: u32, ih: u32, iw: u32, oh: u32, ow: u32, kh: u32, kw: u32, sh: u32, sw: u32, ph: u32, pw: u32 } #[derive(Clone, Copy, Eq, PartialEq)]...
the_stack
use crate::*; use anchor_lang::{prelude::*, solana_program}; /// Creates and invokes a [stable_swap_client::instruction::initialize] instruction. /// /// # Arguments /// /// See [stable_swap_client::instruction::InitializeData]. /// /// * `nonce` - The nonce used to generate the swap_authority. /// * `amp_factor` - Am...
the_stack