text
stringlengths
7.05k
33.9k
use std::{ collections::{HashMap, HashSet}, error::Error, fmt, fs::File, io::{self, BufReader, BufRead, Cursor, Read, Write}, path::PathBuf, sync::{Arc, atomic::{AtomicBool, Ordering}}, }; use synacor_vm::{ binary, vm::{self, Vm, VmState, Instruction}, asm::{ AsmError, ...
/* MIT License Copyright (c) 2017 <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, distrib...
use std::{cmp::Ordering, collections::HashMap, iter}; use fuzzcheck_common::ipc::{TuiMessage, TuiMessageEvent}; use fuzzcheck_common::FuzzerEvent; use termion::event::Key; use super::{ framework::{AnyView, Either, InnerFocusable, ParentView, SwitchFocus, Theme, ViewState}, vertical_list_view::{self, VerticalL...
use style::{Display, Style}; use dom::{ElementData, LayoutType, Node, NodeType}; use float::Floats; use font::{Font, FontSlant, FontWeight}; use inline::LineMaker; use style; use default_style; use css::{parse_attr_style, Declaration, Rule, Selector, SimpleSelector, Specificity, Stylesheet, Value}; use std::...
extern crate english_numbers; extern crate ordinal; extern crate rand; use english_numbers::convert_all_fmt; use ordinal::Ordinal; use rand::Rng; use std::io; fn main() { let n = input_num("How many days of christmas?"); let mut gifts = vec![]; let mut day = 1; while day <= n { println!( ...
//! Defines types used to construct representations of chords and notes. //! //! These can be generated manually, but often one would want to use the //! `parser` module into order to generate these from a string. //! //! ``` //! use quartic::chord::{Chord, ChordStructure, Note, NoteClass, PitchClass}; //! //! // Manua...
///model viewer extern crate image; extern crate rand; extern crate mazth; extern crate e2rcore; extern crate pretty_env_logger; // extern crate chrono; // use self::chrono::prelude::*; use std::fs::File; use std::io::BufReader; use std::io::Read; use std::path::Path; use std::rc::Rc; use std::f32; use self::e2rcor...
#[cfg(test)] #[path = "../../../tests/unit/construction/constraints/capacity_test.rs"] mod capacity_test; use crate::construction::constraints::*; use crate::construction::heuristics::{ActivityContext, RouteContext, RouteState, SolutionContext}; use crate::models::common::{Dimensions, ValueDimension}; use crate::model...
// Copyright 2019 Zhizhesihai (Beijing) Technology Limited. // // 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 a...
// Copyright (c) Microsoft. All rights reserved. //! This subcommand imports an iotedged config (v1.1 and below) into the super-config for 1.2+. //! //! Notes: //! //! - This implementation assumes that Microsoft's implementation of libaziot-keys is being used, in that it generates the keyd config //! with the `azio...
//! Liveness analysis for SSA values. //! //! This module computes the live range of all the SSA values in a function and produces a //! `LiveRange` instance for each. //! //! //! # Liveness consumers //! //! The primary consumer of the liveness analysis is the SSA coloring pass which goes through each //! EBB and assi...
// This file is part of Substrate. // Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the F...
// Copyright (c) 2018-2022 The MobileCoin Foundation //! Contains the worker thread that performs the business logic for Fog //! Overseer. //! //! This is the "core" logic for Overseer. //! //! HTTP Client -> Overseer Rocket Server -> OverseerService -> *OverseerWorker* use crate::{error::OverseerError, metrics}; use...
use std::default::Default; use std::ffi::{CString, CStr, NulError}; use std::net::SocketAddr; use std::os::raw::{c_char, c_uchar, c_int, c_void}; use std::path::{PathBuf, Path}; use std::ptr; use std::slice; use std::str; use hyper::header::{Headers, ContentLength, ContentType, Cookie}; use hyper::{self, Response}; u...
use crate::{ emath::{lerp, Align, Pos2, Rect, Vec2}, CursorIcon, PointerButton, NUM_POINTER_BUTTONS, }; use crate::{CtxRef, Id, LayerId, Sense, Ui}; // ---------------------------------------------------------------------------- /// The result of adding a widget to a [`Ui`]. /// /// A `Response` lets you know...
/* * Copyright 2019 OysterPack Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Copyright Materialize, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by ...
use crate::arch::process::ArchProcess; use crate::arch::thread as arch_thread; use crate::deferred::Deferred; use crate::elf::*; use crate::kobj::{KObj, KObjRef}; use crate::phys_mem::{self, PhysicalBitmap}; use crate::prelude::*; use crate::process; use crate::ptr::{self, Align, PointerInSlice}; use crate::spin::Mutex...
// Copyright 2015-2018 <NAME> <<EMAIL>> // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://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...
use crate::frame::RedisFrame; use anyhow::{anyhow, bail, Context, Result}; use async_trait::async_trait; use bytes::{BufMut, Bytes, BytesMut}; use serde::Deserialize; use crate::error::ChainResponse; use crate::frame::Frame; use crate::transforms::{Transform, Transforms, Wrapper}; #[derive(Deserialize, Debug, Clone)]...
use std::cmp; use std::collections::BTreeMap; use std::fmt::{Debug, Error as FmtError, Formatter}; use std::usize; use x86::teddy_simd::TeddySIMD; /// A list of masks. This has length equal to the length of the fingerprint. /// The length of the fingerprint is always `max(3, len(smallest_substring))`. #[derive(Debug, ...
//! Implements graph pattern matching //! //! This module implements grep-and-replace functionality on SSA graph. //! The grep and replace pattern uses "bindings" to access variables. //! A variable can be bound by using %<i> syntax. Examples below show the same. //! //! Example of a query expression: //! (OpXor %1, %1...
//! State DB use crate::constant::MEMORY_BLOCK_NUMBER; use crate::{smt_store_impl::SMTStore, traits::KVStore, transaction::StoreTransaction}; use anyhow::{anyhow, Result}; use gw_common::merkle_utils::calculate_state_checkpoint; use gw_common::{error::Error as StateError, smt::SMT, state::State, H256}; use gw_db::sche...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Core Release"] pub crel: crate::Reg<crel::CREL_SPEC>, #[doc = "0x04 - Endian"] pub endn: crate::Reg<endn::ENDN_SPEC>, #[doc = "0x08 - Message RAM Configuration"] pub mrcfg: crate::Reg<mrcfg::MRCFG_SPEC>, #[doc =...
#![feature(rustc_private)] #![feature(once_cell)] extern crate rustc_ast; extern crate rustc_driver; extern crate rustc_error_codes; extern crate rustc_errors; extern crate rustc_hash; extern crate rustc_attr; extern crate rustc_hir; extern crate rustc_interface; extern crate rustc_session; extern crate rustc_span; ex...
// Copyright 2017 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. //! Connect to or provide Fuchsia services. #![deny(missing_docs)] #[allow(unused)] // Remove pending fix to rust-lang/rust#53682 use { failure::{Err...
use html5ever::tree_builder::QuirksMode; use html5ever::QualName; use std::cell::{Cell, RefCell}; use std::fmt; use std::ops::Deref; use std::rc::{Rc, Weak}; use crate::attributes::{Attribute, Attributes, ExpandedName}; use crate::cell_extras::*; use crate::iter::NodeIterator; /// Node data specific to the node type....
/* * // Copyright (c) 2016-2019, Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. * // Copyright (c) 2020-present, Jaguar0625, gimre, BloodyRookie. * // All rights reserved. * // * // This file is part of Catapult. * // * // Catapult is free software: you can redistribute it and/or modify * // it under the t...
//! A Constant-Phi-Node removal pass. use crate::dominator_tree::DominatorTree; use crate::entity::EntityList; use crate::fx::FxHashMap; use crate::fx::FxHashSet; use crate::ir::instructions::BranchInfo; use crate::ir::Function; use crate::ir::{Block, Inst, Value}; use crate::timing; use alloc::vec::Vec; use smallvec...
//! Defines `ObjectBackend`. use crate::traps::ObjectTrapSink; use cranelift_codegen::binemit::{ Addend, CodeOffset, NullStackmapSink, NullTrapSink, Reloc, RelocSink, }; use cranelift_codegen::entity::SecondaryMap; use cranelift_codegen::isa::TargetIsa; use cranelift_codegen::{self, binemit, ir}; use cranelift_mod...
//! This is the documentation for the Sniprun project //! //! Sniprun is a neovim plugin that run parts of code. use dirs::cache_dir; pub use display::{display, return_message_classic, DisplayType}; use log::{info, LevelFilter}; use neovim_lib::{Neovim, NeovimApi, Session, Value}; use simple_logging::log_to_file; use ...
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. //! This module encodes TypeScript errors (diagnostics) into Rust structs and //! contains code for printing them to the console. use crate::ansi; use crate::fmt_errors::format_maybe_source_line; use crate::fmt_errors::format_maybe_source_name; ...
// Copyright (c) SimpleStaking and Tezedge Contributors // SPDX-License-Identifier: MIT use std::collections::HashMap; use std::collections::HashSet; use std::mem; use std::ops::{Deref, DerefMut}; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::{mpsc, Arc, Mutex, RwLock}; use std::thread; us...
// 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. pub mod filter; mod watcher; use self::{filter::*, watcher::*}; use crate::{ interrupter::*, proxies::{observer::*, player::*}, Result, Sessio...
use crate::common::{ColorLegend, CommonState, Warping}; use crate::game::{msg, Transition}; use crate::helpers::{rotating_color, rotating_color_map, ID}; use crate::managed::WrappedComposite; use crate::render::{dashed_lines, Renderable, MIN_ZOOM_FOR_DETAIL}; use crate::sandbox::SpeedControls; use crate::ui::UI; use ab...
use alloc::alloc::{GlobalAlloc, Layout}; use alloc::string::String; use alloc::sync::Arc; use core::slice; use bitflags::*; use device_tree::util::SliceRead; use device_tree::Node; use log::*; use rcore_memory::PAGE_SIZE; use volatile::{ReadOnly, Volatile, WriteOnly}; use crate::arch::cpu; use crate::memory::virt_to_...
use std::{path::Path, sync::Arc, time::Duration}; use async_recursion::async_recursion; use async_trait::async_trait; use either::Either; use futures_util::StreamExt; use obws::{ events::EventType, requests::{Scale, SceneItemSpecification}, responses::MediaState, }; use serde::Deserialize; use tokio::sync:...
#![allow(dead_code)] //////////// REMOVE REMOVE DEBUG DEBUG TODO TODO use helper::*; use std::{ collections::{ HashMap, HashSet, }, io, fmt, iter, cmp, time::Instant, io::ErrorKind, }; use byteorder::{ReadBytesExt, WriteBytesExt}; use mod_ord::ModOrd; /// Stateful wrapper around a Udp-like object (facilitat...
use crate::graph::{Graph, GraphWeight}; use std::ops::Not; /// Effeciently maintains a collection of conflict triples (nodes v-u-w where uv and uw are edges, /// but vw is a non-edge). /// /// To avoid logic errors, users of this struct must: /// - Always supply the same graph to the `update_for_*` functions as used ...
// Copyright 2020-2021 <NAME>. // // Code is licensed under GPLv3.0 License. #![allow(non_snake_case)] #![allow(dead_code)] use crate::dleq::DLEQ; use crate::sharebox::{DistributionSharesBox, ShareBox}; use crate::util::Util; use num_bigint::{BigInt, BigUint, RandBigInt, ToBigInt}; use num_integer::Integer; use num_...
//! Material agnostic depth rendering. Shadows or a prepass. //! //! Any material that implements [`DepthRenderableMaterial`] will be able to use //! this routine to render their shadows or a depth prepass. use std::{marker::PhantomData, mem, num::NonZeroU64}; use arrayvec::ArrayVec; use rend3::{ format_sso, ...
use conrod_core::{ image, mesh::{self, Mesh}, render, text::rt, Rect, Scalar, }; use std::collections::HashMap; /// A loaded wgpu texture and it's width/height pub struct Image { /// The immutable image type, represents the data loaded onto the GPU. /// /// Uses a dynamic format for fle...
// crates /* use std::path::Path; use walkdir::WalkDir; use my_public_ip::resolve; use std::path::Path; */ // unused crates use local_ip_address::local_ip; use std::str; use std::process::Command; use std::fs::File; use std::fs; use std::io::Read; use titlecase::titlecase; use uname::uname; use std::env; use libmacchin...
// Lumol, an extensible molecular simulation engine // Copyright (C) 2015-2016 Lumol's contributors — BSD license use std::ops::{Deref, DerefMut}; use soa_derive::soa_zip; use log_once::warn_once; use crate::{Matrix3, Vector3D}; use crate::{AnglePotential, BondPotential, DihedralPotential, PairInteraction}; use crat...
#[allow(non_snake_case)] pub mod OP { pub const LONG: u8 = 0b10000000; pub const NOP: u8 = 0b00000000; pub const CALL: u8 = 0b00000001; pub const RETURN: u8 = 0b00000010; pub const TAIL_CALL: u8 = 0b00000011; pub const CLOSURE: u8 = 0b00000100; pub const CLOSURE_LONG: u8 = CLOSURE | LONG;...
use crate::blob_fetch_stage::BlobFetchStage; use crate::blocktree::Blocktree; #[cfg(feature = "chacha")] use crate::chacha::{chacha_cbc_encrypt_ledger, CHACHA_BLOCK_SIZE}; use crate::cluster_info::{ClusterInfo, Node, FULLNODE_PORT_RANGE}; use crate::contact_info::ContactInfo; use crate::gossip_service::GossipService; u...
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::io::Write; use indexmap::IndexMap; use symbol::Symbol as Id; use crate::items::LR0Item; use crate::parser::{Action, ParseTable}; use crate::Parser; #[derive(Debug, Error)] pub enum GrammarError { #[error("Name conflict: {0}")] NameConflic...
use std::collections::BTreeMap; use std::collections::HashMap; use std::env; use std::{thread, time}; use airtable_api::{Airtable, Record}; use chrono::naive::NaiveDateTime; use chrono::offset::Utc; use chrono::DateTime; use chrono_humanize::HumanTime; use reqwest::{Client, StatusCode}; use serde::{Deserialize, Serial...
// This module gives a (partial) implementation of Windows property sets, // whose serialization format is described at: // https://msdn.microsoft.com/en-us/library/windows/desktop/ // aa380367(v=vs.85).aspx use crate::internal; use crate::internal::codepage::CodePage; use byteorder::{LittleEndian, ReadBytesEx...
// Public-domain implementation from: // https://github.com/teor2345/privcount_shamir/ // Implements a prime field modulo some prime of form 2^A - 2^B - 1. // // Tries to be fairly efficient, and to not have timing side-channels. // // Certain constraints are placed on A and B, see below. use num::traits::{Num, On...
use bedrock as br; use std::rc::Rc; use winapi::shared::windef::HWND; #[cfg(not(feature = "transparent"))] pub struct Presenter { _window: HWND, sc: peridot::IntegratedSwapchain, } #[cfg(not(feature = "transparent"))] impl Presenter { pub fn new(g: &peridot::Graphics, window: HWND) -> Self { ...
/* NBT是我见过效率最低、适用面最窄的数据结构 当初哪个开发者发明的,出来让我打一顿 */ /* NbtRead // io::read NbtWrite NbtValue */ use byteorder::{BigEndian, ReadBytesExt};//, WriteBytesExt}; use std::collections::HashMap; use std::io::{Error, ErrorKind, Result}; const TYPE_ID_END: u8 = 0; const TYPE_ID_BYTE: u8 = 1; const TYPE_ID_SHORT: u8 = 2; const ...
///! 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...
/*! Implements the main event loop and UI managment. The `App` struct is the central manager for events and windows. For the event loop to run you must call `App::run()` in the main thread. An `AppHandle` instance created using the `App::handle()` method is used to send messages and execute code in the main or UI thre...
#![doc( html_root_url = "https://docs.rs/spirit-cfg-helpers/0.3.0/spirit_cfg_helpers/", test(attr(deny(warnings))) )] #![forbid(unsafe_code)] #![warn(missing_docs)] #![allow( unknown_lints, clippy::unknown_clippy_lints, clippy::needless_doctest_main )] //! Spirit configuration helpers //! //! These...
#![allow(non_camel_case_types)] use crate::cvt::cvt; use crate::ntdll::{ NtQueryInformationFile, RtlNtStatusToDosError, FILE_ACCESS_INFORMATION, FILE_INFORMATION_CLASS, FILE_MODE_INFORMATION, IO_STATUS_BLOCK, }; use bitflags::bitflags; use io_lifetimes::BorrowedHandle; use std::ffi::{c_void, OsString}; use std...
//! Data logging toolkit. use crate::{ common::*, config, utils::{CowTensor, RateCounter}, }; use async_std::{fs::File, io::BufWriter}; use tch_goodies::MergedDenseDetection; pub use logging_message::*; pub use logging_worker::*; mod logging_worker { use super::*; /// The data logging worker. ...
//! This module handles the low level details of sending requests to //! the webdriver server using hyper, and interpreting errors. It also //! handles some of the inconsistancies in the implementation of the //! webdriver standard between different browsers. // Many thanks to "<NAME> <<EMAIL>>" the author // of fanto...
// validbr - Brazilian registry validator, provides structures for representing CPF, CNPJ, RG, CNH, CEP and Credit Card Number! // // The MIT License (MIT) // // Copyright (c) Obliter Software (https://github.com/oblitersoftware/) // Copyright (c) contributors // // Permission is hereby grant...
//! Data structures to represent the Wasm value stack during execution. use super::{DropKeep, DEFAULT_VALUE_STACK_LIMIT}; use crate::{TrapCode, Value, ValueType, F32, F64}; use alloc::vec::Vec; use core::{fmt, fmt::Debug, iter, mem}; /// A single entry or register in the value stack. /// /// # Note /// /// This is a ...
use amethyst::{ assets::AssetLoaderSystemData, core::{ SystemBundle, transform::{Transform, TransformBundle}, ecs::{DispatcherBuilder, ReaderId}, shrev::EventChannel, }, input::{get_key, is_close_requested, is_key_down, VirtualKeyCode}, prelude::*, renderer::{ ...
//! Algorithms on DNA sequences mod dna_impl; use std::collections::HashSet; use std::f64; use rand; use rand::distributions::{IndependentSample, Range, WeightedChoice, Weighted}; pub use self::dna_impl::Dna; use ::seq; type Seq = Vec<u8>; pub const A: u8 = b'A'; pub const T: u8 = b'T'; pub const G: u8 = b'G'; pu...
use core::str::Utf8Error; #[derive(Clone, Debug)] #[repr(C)] pub struct Superblock { /// 32bit value indicating the total number of inodes, both used and free, /// in the file system. This value must be lower or equal to /// (s_inodes_per_group * number of block groups). It must be equal to the /// s...
/* Copyright The containerd 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 agreed to...
// Copyright 2019 Parity Technologies // // 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 agree...
// Copyright 2021-2022 Fastly, Inc. use anyhow::{bail, Result}; use bytes::{BufMut, Bytes, BytesMut}; use log::*; use std::net::{IpAddr, SocketAddr}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::time::Duration; use thiserror::Error; use tokio::net::UdpSocket; use tokio::time::timeout; u...
use crate::type_name::ShellTypeName; use crate::value::column_path::ColumnPath; use crate::value::range::{Range, RangeInclusion}; use crate::value::{serde_bigdecimal, serde_bigint}; use bigdecimal::BigDecimal; use chrono::{DateTime, Utc}; use nu_errors::{ExpectedRange, ShellError}; use nu_source::{PrettyDebug, Span, Sp...
// Copyright 2017 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 2012-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-MI...
pub use crate::{common::genesis_deposits, interop::interop_genesis_state}; pub use eth1::Config as Eth1Config; use eth1::{DepositLog, Eth1Block, Service as Eth1Service}; use slog::{debug, error, info, trace, Logger}; use state_processing::{ eth2_genesis_time, initialize_beacon_state_from_eth1, is_valid_genesis_sta...
use crate::{ aead::{Aead, AeadCtx, AeadCtxR, AeadCtxS}, kdf::{labeled_extract, DigestArray, Kdf as KdfTrait, LabeledExpand, MAX_DIGEST_SIZE}, kem::{Kem as KemTrait, SharedSecret}, op_mode::{OpMode, OpModeR, OpModeS}, util::full_suite_id, HpkeError, }; use rand_core::{CryptoRng, RngCore}; use ze...
#[macro_use] extern crate failure; extern crate event; extern crate libc; extern crate orbclient; extern crate orbimage; extern crate syscall; pub mod rect; pub mod image; use event::EventQueue; use image::{ImageRef}; use orbclient::{Color, Event, Renderer}; use rect::Rect; use std::{ cell::RefCell, env, ...
//! Semantic analysis. pub mod convert; mod fs; mod infer; mod vectorize; #[macro_use] pub mod types; pub mod bootstrap; pub mod check; pub mod env; pub mod formatter; pub mod fresh; pub mod import; pub mod nodes; pub mod sub; pub mod walk; #[cfg(test)] mod tests; #[allow(unused, non_snake_case)] pub mod flatbuff...
use macroquad::{prelude::*, rand::gen_range}; const GEMS: [Color; 8] = [BLACK, RED, BLUE, GREEN, YELLOW, ORANGE, PINK, PURPLE]; const CAMERA_WIDTH: f32 = 256.0; const CAMERA_HEIGHT: f32 = 240.0; pub struct Board { width: i16, height: i16, num_cells: i16, hidden_top_rows: i16, cells: Vec<i16>, ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - UART Baud Rate Registers: High"] pub bdh: BDH, #[doc = "0x01 - UART Baud Rate Registers: Low"] pub bdl: BDL, #[doc = "0x02 - UART Control Register 1"] pub c1: C1, #[doc = "0x03 - UART Control Register 2"] pu...
#![cfg_attr(not(feature="std"), no_std)] #![allow(non_snake_case)] extern crate tiny_keccak; extern crate pwasm_std; extern crate pwasm_ethereum; extern crate pwasm_abi; extern crate pwasm_abi_derive; use tiny_keccak::Keccak; use pwasm_ethereum as eth; use pwasm_abi::types::*; use pwasm_abi_derive::eth_abi; // `Tok...
//! `post` table parsing and writing. use std::str; use crate::binary::read::{ReadArray, ReadBinary, ReadCtxt}; use crate::binary::write::{WriteBinary, WriteContext}; use crate::binary::{I16Be, I32Be, U16Be, U32Be, U8}; use crate::error::{ParseError, WriteError}; pub struct PostTable<'a> { pub header: Header, ...
use std::{convert, fmt, str, sync::Arc, net::{Ipv4Addr, Ipv6Addr}}; use chrono::prelude::*; use chrono_tz::Tz; use crate::{ errors::{Error, FromSqlError, Result}, types::{ column::Either, decimal::Decimal, value::{AppDate, AppDateTime}, SqlType, Value, }, }; use uuid::Uuid...
//! Module for flash save media support. //! //! Flash may be read with ordinary read commands, but writing requires //! sending structured commands to the flash chip. use super::{ lock_media, read_raw_buf, read_raw_byte, verify_raw_buf, Error, MediaInfo, MediaType, RawSaveAccess, }; use crate::sync::{with_irqs_di...
extern crate cc; extern crate pkg_config; use std::env; use std::fs; use std::path::{Path, PathBuf}; fn build_libz(libz_sources: &[&str]) { let mut config = cc::Build::new(); for c_file in libz_sources { config.file(c_file); } config.flag("-w"); config.compile("libz.a"); } fn build_libtco...
use crate::error::{CellbaseError, CommitError, Error, UnclesError}; use crate::header_verifier::HeaderResolver; use crate::{TransactionVerifier, Verifier}; use ckb_core::cell::ResolvedTransaction; use ckb_core::extras::EpochExt; use ckb_core::header::Header; use ckb_core::transaction::{Capacity, CellInput, Transaction}...
// Copyright 2018 Parity Technologies (UK) Ltd. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, mer...
use rand::{Rand, Rng}; use std::{ cmp::{Ord, Ordering, PartialOrd}, io::{Read, Result as IoResult, Write}, marker::PhantomData, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, str::FromStr, }; use crate::{ bytes::{FromBytes, ToBytes}, fields::{Field, LegendreSymb...
//! A simple register reuse optimization pass. //! Since we have infinite registers, using a general register coloring pass //! would be wasteful. //! //! This is essentially what is known as `Linear scan global register allocation` use super::vectorize; use crate::asm::{Body, JumpMode, Terminator}; use crate::errors:...
//! Support for generating a standard WebIDL custom section //! //! This module has all the necessary support for generating a full-fledged //! standard WebIDL custom section as defined by the `wasm-webidl-bindings` //! crate. This module also critically assumes that the WebAssembly module //! being generated **must be...
//! Graceful shutdown for Kvarn. //! //! This is handled through a [`Manager`] and several helper structs. //! The `Manager` is returned from [`RunConfig::execute`] and can be awaited //! to pause execution till the server is shut down. //! It is also used to trigger a shutdown. use crate::prelude::{threading::*, *}; #...
// Copyright 2018 Developers of the Rand project. // Copyright 2013-2015 The Rust Project Developers. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // https://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your // option. Thi...
#![cfg(feature = "prefix")] use std::fs::{create_dir_all, read_dir, remove_dir, remove_file, File}; use std::path::{Path, PathBuf}; use std::sync::{Arc, RwLock}; use std::{collections::BTreeMap, unreachable}; use hashbrown::HashMap; use pahkat_types::package::{Descriptor, Package}; use pahkat_types::repo::RepoUrl; us...
/*! The following code has been modified from the original delaunator-rs project: https://github.com/mourner/delaunator-rs For a description of the data structure, including the halfedge connectivity, see: https://mapbox.github.io/delaunator/ # Description A very fast 2D [Delaunay Triangulation](https://en.wikiped...
#![macro_use] use core::marker::PhantomData; use core::sync::atomic::{compiler_fence, Ordering}; use core::task::Poll; use embassy::waitqueue::AtomicWaker; use embassy_hal_common::unborrow; use futures::future::poll_fn; use pac::{saadc, SAADC}; use saadc::ch::config::{GAIN_A, REFSEL_A, RESP_A, TACQ_A}; // We treat th...
use base64; use curve25519_dalek::{constants::ED25519_BASEPOINT_POINT, edwards::EdwardsPoint, scalar::Scalar}; use rand_core::OsRng; use std::time::{Duration, Instant}; use x25519_dalek::{PublicKey, StaticSecret}; use regex::bytes::Regex; pub fn trial(prefix: &str, start: usize, end: usize) -> Option<(String, String)>...
use super::video::VIDEO_MANAGER; use alloc::boxed::Box; use alloc::vec; use alloc::vec::Vec; use common::{ console::ConsoleIn, key::{Key, ScanCode}, video::{FrameBuffer, PixelFormat, VideoMode}, }; use common::{ console::{Char, Color, ConsoleOut, DrawRegion, FONT_HEIGHT, FONT_WIDTH}, font::CONSOLE_F...
// 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. //! Allows extracting DSO contextual information in-process within Fuchsia processes //! that use the standard Fuchsia libc. #![deny(missing_docs)] use {...
use std::os::raw::*; use std::mem; use std::ptr; use std::ffi::CStr; use std::fmt::{self, Debug, Formatter}; use super::{OsSharedContext, winapi_utils::*}; use error::Result; impl OsSharedContext { pub fn wgl(&self) -> Result<&Wgl> { self.wgl.as_ref().map_err(Clone::clone) } } // extern "C" fns implem...
use glam::{DVec2, Mat3A, Mat4, UVec2, Vec3, Vec3A}; use parking_lot::Mutex; use pico_args::Arguments; use rend3::{ format_sso, types::{Backend, Camera, CameraProjection, DirectionalLight, Texture, TextureFormat}, util::typedefs::FastHashMap, Renderer, }; use rend3_pbr::SkyboxRoutine; use std::{ coll...
use crate::{ de::{deserialize::ReceivedPacket, PacketReader}, ser::serialize, session_state::SessionState, Property, {debug, error, info, warn}, }; use embedded_nal::{nb, IpAddr, SocketAddr, TcpClientStack}; use embedded_time; use embedded_time::duration::{Extensions, Seconds}; use heapless::{String, ...
//! The cryptography module for the secure implementation of the security features for the //! controller //! //! # Design //! //! The crypto handler defined in this module constructs messages to other SCEWL devices in the //! following layout: //! //! ```text //! TRANSPORT //! | b'SC' ; header magic //! | tgt_id ...
use tract_hir::internal::*; use tract_ndarray::prelude::*; use crate::model::ParsingContext; use crate::tfpb::tensorflow::NodeDef; pub fn block_lstm(_ctx: &ParsingContext, node: &NodeDef) -> TractResult<Box<dyn InferenceOp>> { let forget_bias = node.get_attr_opt_float("forget_bias")?.unwrap_or(1.0); let cell_...
// SPDX-License-Identifier: MIT #![no_std] #[macro_use] extern crate bitflags; use core::{cmp, mem, slice}; pub use self::io::Io; mod io; pub use self::mapper::{PhysicalAddress, VirtualAddress, Mapper}; mod mapper; pub use self::mmio::Mmio; mod mmio; pub static PCI_IDS: &[(u16, u16)] = &[ (0x8086, 0x02A4), /...
//! Error types and other error-related code. use crate::util; use actix_web::{ client::{PayloadError, SendRequestError}, HttpResponse, }; use diesel::result::DatabaseErrorKind; use juniper::{DefaultScalarValue, FieldError, IntoFieldError}; use log::{error, log, Level}; use openidconnect::{core::CoreErrorRespo...