text
stringlengths
7.05k
33.9k
// https://www.grc.com/sqrl/storage.htm // https://github.com/Novators/libsqrl/blob/c/src/storage.c // https://doc.rust-lang.org/book/ch03-02-data-types.html // https://docs.rs/nom use nom::{count, call, switch, do_parse, take, IResult, many0, many_m_n, complete}; use nom::combinator::peek; use nom::number::streaming:...
// Copyright 2020 Two Sigma Investments, LP. // // 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...
//! Program state processor use crate::{ error::{to_claimable_tokens_error, ClaimableProgramError}, instruction::ClaimableProgramInstruction, state::{NonceAccount, TransferInstructionData}, utils::program::{ find_address_pair, find_nonce_address, EthereumAddress, NONCE_ACCOUNT_PREFIX, }, };...
// Copyright 2018 <NAME> // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing,...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: July 25, 2017 Last Modified: Dec. 15, 2017 License: MIT */ use time; use num_cpus; use std::env; use std::path; use std::f64; use std::sync::Arc; use std::sync::mpsc; use std::thread; use raster::*; use std::io::{Error...
//! Coordinator thread code. //! //! The coordinator, as the name suggests, coordinates the Heph runtime. This //! includes monitoring the [worker threads] running the thread-safe and //! thread-local actors and futures, monitoring the [sync worker threads] //! running the synchronous actors and handling process signal...
//! Generates markdown code for documentation comments //! of the output Rust crate. #![allow(dead_code)] use crate::cpp_ffi_data::{CppFfiFunctionKind, CppFfiItem, CppFieldAccessorType}; use crate::cpp_type::CppType; use crate::database::{DatabaseClient, DbItem, DocItem}; use crate::rust_code_generator::rust_type_to_...
//! The HSI device-dependent polar color space use crate::channel::{ AngularChannel, AngularChannelScalar, ChannelCast, ChannelFormatCast, ColorChannel, PosNormalBoundedChannel, PosNormalChannelScalar, }; use crate::color; use crate::color::{Bounded, Color, FromTuple, Invert, Lerp, PolarColor}; use crate::conv...
use std::ops::Range; use std::path::PathBuf; use std::sync::Arc; use crate::chain_complex::{AugmentedChainComplex, ChainComplex, FreeChainComplex}; use crate::resolution::Resolution; use crate::save::SaveKind; use crate::CCC; use algebra::module::homomorphism::{FreeModuleHomomorphism, ModuleHomomorphism}; use algebra:...
//! Sampling Control. #![allow(clippy::new_without_default)] use crate::interface::Frame; /// Sampling Control register. #[derive(Debug, Eq, PartialEq, Clone, Copy)] pub struct Sampling { data: u8, } impl Default for Sampling { fn default() -> Self { Self::new() } } impl Sampling { #[allow(cl...
use super::*; use crate::bitmaps::*; use crate::connection::ConnectionOps; use crate::{ Color, Dimensions, KeyEvent, MouseButtons, MouseCursor, MouseEvent, MouseEventKind, MousePress, Operator, PaintContext, Point, Rect, Size, WindowCallbacks, WindowOps, WindowOpsMut, }; use failure::Fallible; use std::any::Any...
use regex; use structure::block::Block; use meta_data::substr::{Substr, find_text}; macro_rules! try_regex { ($e:expr) => { match $e { Ok(e) => e, Err(e) => panic!(r"Failed regex string: {}", e) } } } lazy_static! { // {fdf816d2-1ead-11d5-b975-0050bae0a95d,1,2605a1e0-a0...
use std::io; use crate::bit::BitIndex; use crate::byteorder::{LittleEndian, ReadBytesExt}; use crate::num::FromPrimitive; use super::alu::*; use super::arm::*; use super::{Addr, InstructionDecoder, InstructionDecoderError}; pub mod display; pub mod exec; #[derive(Debug, PartialEq)] pub enum ThumbDecodeErrorKind { ...
use csv; use fnv::FnvHasher; use na::{UnitQuaternion, Vector3}; use state::*; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::HashMap; use std::ffi::OsStr; use std::fs; use std::hash::BuildHasherDefault; use std::path::PathBuf; use walkdir::{DirEntry, WalkDir}; type MyHasher = BuildHas...
extern crate eagre_ecs as ecs; extern crate framework; #[macro_use] extern crate glium; extern crate image; #[macro_use] extern crate log; extern crate nalgebra as na; extern crate obj; extern crate pretty_env_logger; extern crate rand; extern crate toml; #[macro_use] extern crate lazy_static; #[macro_use] extern crate...
//! PCI バス制御のプログラムを集めたファイル. #![allow(dead_code)] use crate::asm; use crate::error::{Code, Error}; use crate::make_error; use bit_field::BitField; use core::fmt; use cty::uint32_t; use modular_bitfield::prelude::*; /// CONFIG_ADDRESS レジスタの IO ポートアドレス const CONFIG_ADDRESS: u16 = 0x0cf8; /// CONFIG_DATA レジスタの IO ポートアドレス...
//! This module provides an abstraction for the rendering context, such as WebGL or OpenGL one. use crate::prelude::*; use web::traits::*; use crate::system::gpu::data::GlEnum; use crate::system::gpu::shader; use crate::system::web; use web::Closure; use web_sys::WebGl2RenderingContext; // ============== // === Ex...
use crate::event::TimedEvent; use std::collections::VecDeque; use std::fmt; use std::fs::File; use std::io; use std::io::{BufRead, Write}; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::time; use rgx::color::{Bgra8, Rgba8}; use seahash::SeaHasher; #[derive(Debug, Clone, Eq, PartialEq)] pub enum GifM...
use super::super::objects::cell::*; use super::super::objects::coordconverter::*; use super::super::objects::grid::*; use std::convert::TryInto; pub struct ResolverLvl4 { coordconverter: CoordConverter, } impl ResolverLvl4 { pub fn new(side: u16) -> ResolverLvl4 { ResolverLvl4 { coordconve...
// see https://github.com/Crossref/rest-api-doc/blob/master/api_format.md use crate::error::Result; use crate::response::{FacetMap, QueryResponse}; use crate::{Crossref, WorkListQuery, WorksQuery}; use chrono::NaiveDate; use serde::{Deserialize, Serialize}; use serde_json::Value; /// A hashmap containing relation nam...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Device address and endpoint control"] pub addr_endp: crate::Reg<addr_endp::ADDR_ENDP_SPEC>, #[doc = "0x04 - Interrupt endpoint 1. Only valid for HOST mode."] pub addr_endp1: crate::Reg<addr_endp1::ADDR_ENDP1_SPEC>, #[do...
extern crate bitflags; #[macro_use] extern crate error_chain; mod align; mod ansi; #[cfg(not(tarpaulin_include))] mod bat_utils; mod cli; mod color; mod config; mod delta; mod draw; mod edits; mod env; mod features; mod format; mod git_config; mod hunk_header; mod options; mod paint; mod parse; mod parse_style; mod s...
// Note on `candid_method`: each canister method should have a function // annotated with `#[candid_method]` that has the arguments and return type // expected by the canister method, to be able to generate `governance.did` // automatically. // // This often means we need a function with `#[export_name = "canister_quer...
#![allow(clippy::integer_arithmetic)] // Copyright 2017 <NAME> <<EMAIL>> // // Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or // the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according...
//! `sled` is an embedded database with //! an API that is similar to a `BTreeMap<[u8], [u8]>`, //! but with several additional capabilities for //! assisting creators of stateful systems. //! //! It is fully thread-safe, and all operations are //! atomic. Most are fully non-blocking. Multiple //! `Tree`s with isolated...
//! Fuzzer implementation use std::time::Duration; use std::str::FromStr; use std::io::{BufWriter, Write}; use std::thread; use std::sync::mpsc; use serde::{Serialize, Deserialize}; use chrono::{Utc, DateTime}; use thiserror::Error; use crate::{mutation::MutationHint, trace}; use crate::watch;...
use cranelift_entity::{entity_impl, PrimaryMap}; use std::fmt; use std::fmt::{Display, Error, Formatter}; use std::rc::Rc; use crate::cdsl::camel_case; use crate::cdsl::formats::InstructionFormat; use crate::cdsl::operands::Operand; use crate::cdsl::type_inference::Constraint; use crate::cdsl::types::{LaneType, Refer...
//! DelayTimer is a cyclic task manager with latency properties, //! based on an internal event manager and task scheduler, //! and supported by the runtime provided by smol, //! which makes it easy to manage asynchronous/synchronous/scripted cyclic tasks. //! //! # DelayTimer //! //! User applications can be served th...
use imgui::{ Context, DrawCmd::Elements, DrawData, DrawIdx, DrawList, DrawVert, TextureId, Textures, }; use std::mem::size_of; use wgpu::*; pub type RendererResult<T> = Result<T, RendererError>; // TODO: This value may change // https://github.com/gfx-rs/wgpu-rs/issues/199 const WHOLE_BUFFER: u64 = 0; #[derive(C...
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. //! Library to build `Custom_tag` OCaml values. use std::ffi::{CStr, CString}; use std::mem::MaybeUninit; use std::ops::Deref; use std:...
use crate::material::Material as InternalMaterial; use crate::mesh::Mesh; use crate::model::{Model, ModelHandle}; use crate::primitive::Primitive; use crate::renderer::RendererState; use crate::skybox::Skybox; use crate::vertex; use crate::vertex::Vertex; use glium::backend::Facade; use glium::framebuffer::{RenderBuffe...
//! There is still a lot we can optimize VStr //! * instead of using &str, we can use intern to cache static attr name. //! * we can also cache camelize/capitalize result. //! * if VStr raw already satisfy StrOps, setting the ops flag is noop. //! * interning/cache can be optional, e.g. Text Token can skip it at all. u...
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { crate::{build::BuildScript, graph::GnBuildGraph, target::GnTarget, types::*}, anyhow::{Context, Error}, argh::FromArgs, camino::Utf8P...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 #![forbid(unsafe_code)] use anyhow::{bail, ensure, format_err, Result}; use include_dir::{include_dir, Dir}; use log::{debug, info, LevelFilter}; use once_cell::sync::Lazy; use rayon::prelude::*; use sha2::{Digest, Sha256}; use starcoi...
//! Contains structs and methods to faciliate geometry in *n*-dimensional space. /// A point in *n*-dimensional space. pub type Point<T> = nalgebra::DVector<T>; /// A vector in *n*-dimensional space. pub type Vector<T> = Point<T>; /// A non-owned form of [`Vector`]. pub type VectorSlice<'a, T> = nalgebra::DVectorSli...
//! # riffy //! //! riffy is an unbounded, wait-free, multi-producer-single-consumer queue. //! //! It's a Rust-port of [Jiffy](https://github.com/DolevAdas/Jiffy) //! which is implemented in C++ and described in [this arxiv paper](https://arxiv.org/abs/2010.14189). use core::ptr; use std::cell::Cell; use std::error::...
// Copyright 2020 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 ...
use std::{collections::HashMap, io::Read}; use log::trace; use rbx_dom_weak::{ types::{Ref, SharedString, Variant, VariantType}, InstanceBuilder, WeakDom, }; use rbx_reflection::DataType; use crate::{ compat::{TodoValueConversion, TodoValueConversionType}, core::find_canonical_property_descriptor, ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - DMAC Global Configuration Register"] pub gcfg: crate::Reg<gcfg::GCFG_SPEC>, #[doc = "0x04 - DMAC Enable Register"] pub en: crate::Reg<en::EN_SPEC>, #[doc = "0x08 - DMAC Software Single Request Register"] pub sreq: c...
mod id; mod script; // TODO: make these share a common trait so code doesn't have to be copied everywhere. // Call them 'exports'? mod sprite; mod text; mod actor; use crate::prelude::*; use crate::sanitize; use std::collections::HashMap; use id::Identify; use script::Script; use sprite::*; use actor::*; use text::*...
use chrono::Utc; use core::config::*; use core::permissions::*; use core::tasks::*; use core::verifier::*; use database::*; use errors::*; use parking_lot::RwLock; use serenity; use serenity::model::prelude::*; use std::borrow::Cow; use std::collections::HashMap; use std::mem::drop; use std::sync::Arc; use std::time::{...
// 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 // disclai...
use actix_cors::Cors; use actix_files::{Files, NamedFile}; use actix_http::{ header::{self, HeaderMap}, ContentEncoding, }; use actix_web::http::header::{CacheControl, CacheDirective, ContentType, ETag, EntityTag}; use actix_web::{ body::MessageBody, dev::{ServiceFactory, ServiceRequest, ServiceResponse...
use std::collections::{ btree_map::{Entry, Iter}, BTreeMap, }; use std::fs::File; use std::io::{BufRead, BufReader}; pub fn parse_file(file_name: String) -> SWCNeuron { let reader = get_file_reader(file_name); match parse_lines(reader) { Ok(neuron) => neuron, Err(msg) => panic!(msg), ...
use { makepad_shader_compiler::*, crate::{ cx::Cx, area::Area, geometry::{GeometryFields}, live_traits::*, cx_draw_shaders::* }, }; pub enum ShaderCompileResult { Nop, Ok } pub const DRAW_CALL_USER_UNIFORMS: usize = 16; pub const DRAW_CALL_TEXTURE_SLOT...
use crate::log; use crate::sinks::*; use APU_SAMPLING_FREQUENCY; use CPU_FREQUENCY; const APU_SAMPLING_RATE: f64 = APU_SAMPLING_FREQUENCY / CPU_FREQUENCY; const APU_FRAME_COUNTER_RATE: f64 = 240.0 / CPU_FREQUENCY; #[derive(Debug, Eq, PartialEq)] pub enum ApuChannel { Pulse1, Pulse2, Triangle, Noise, ...
//! Idk man pub use cgmath; pub use glium; pub use image; use cgmath::{Matrix4, Vector3}; use glium::glutin; use glium::{ implement_vertex, uniform, Blend, BlendingFunction, Display, Frame, IndexBuffer, LinearBlendingFactor, Program, Rect, Surface, VertexBuffer, }; use glutin::event_loop::ControlFlow; use std::any:...
use crate::{ command::{ get::{find_control_file, get_property}, install::format_display_path, }, CommandExecute, }; use owo_colors::OwoColorize; use eyre::{eyre, WrapErr}; use pgx_utils::{ pg_config::{PgConfig, Pgx}, sql_entity_graph::{PgxSql, RustSourceOnlySqlMapping, RustSqlMa...
// 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...
use libc::c_char; use std::collections::HashMap; use std::ffi::CString; use std::iter; use std::ops::Deref; use cstring_manager::CStringManager; use llvm_sys; use llvm_sys_wrapper::*; use llvm_sys::transforms::ipo::*; use llvm_sys::transforms::vectorize::*; use parser; pub struct Module { module: llvm_sys_wrapper...
use std::sync::Arc; use { ahash::AHashMap, parking_lot::{Mutex, RwLock}, rusttype::{point, Scale}, }; use crate::math::{vec2, Vec2}; use super::texture_atlas::TextureAtlas; #[derive(Clone, Copy, Debug, Default)] pub struct GalleyCursor { /// character count in whole galley pub char_idx: usize, ...
use crate::ebml::NodeInfo; // Magic number for webm files #[allow(dead_code)] pub const MAGIC_NUMBER: [u8; 4] = [ 0x1a, 0x45, 0xdf, 0xa3 ]; pub const ID_EBMLHEADERNODE: u64 = 0x1a45dfa3; pub const ID_SEGMENTNODE: u64 = 0x18538067; pub const ID_SEEKHEADNODE: u64 = 0x114d9b74; pub const ID_SEEKNODE: u64...
use std::collections::HashSet; use std::convert::TryInto; use std::env; use std::ops::{Deref, DerefMut}; use std::path::{Path, PathBuf}; use std::process::{self, Command}; use anyhow::{Context, Result}; use clap::Parser; use fs_err as fs; use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; use path_slash::Path...
use bytes::Bytes; use chrono::{DateTime, Utc}; use dns_message_parser::rr::RR; use dns_message_parser::DecodeError; use dns_message_parser::Dns; use etherparse::IpHeader; use etherparse::PacketHeaders; use eyre::{Result, WrapErr}; use futures::StreamExt; use getopts::Options; use hex::encode; use pcap::stream::{PacketC...
// Copyright 2017-2018 the authors. See the 'Copyright and license' section of the // README.md file at the top-level directory of this repository. // // Licensed under the Apache License, Version 2.0 (the LICENSE-APACHE file) or // the MIT license (the LICENSE-MIT file) at your option. This file may not be // copied, ...
mod arg_matches; mod binance_account_info; mod binance_auto_buy; mod binance_auto_sell; mod binance_avg_price; mod binance_exchange_info; mod binance_get_klines_cmd; mod binance_history; mod binance_klines; mod binance_market_order_cmd; mod binance_my_trades; mod binance_order_response; mod binance_orders; mod binance_...
// std lib imports use std::io::{stdin, Read, Write}; use std::fs::{File, create_dir}; // random things use regex::Regex; use rustc_serialize::Encodable; use rustc_serialize::json::{decode, as_pretty_json, Encoder}; use time::OffsetDateTime; // theca imports use utils::c::istty; use utils::{drop_to_editor, pretty_lin...
// This file is part of Substrate. // Copyright (C) 2017-2020 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // 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 // // ht...
use std::str; use std::fmt; use std::ops::Index; use std::cmp::{Eq,PartialEq}; use std::slice::Iter; use std::cmp::max; use std::collections::HashSet; #[derive(Debug,Clone,Copy,Hash)] struct V3{ x: i64 ,y: i64 ,z: i64 } impl V3{ const fn new(x: i64, y: i64, z: i64) -> V3{ V3{ x:x,y...
use std::thread::sleep; use std::time; use termion; use termion::event::{Event, Key}; use termion::input::TermRead; use editor::Editor; use string_utils::rope_slice_is_line_ending; use utils::digit_count; #[allow(dead_code)] // don't care about unused colors mod screen; pub mod smallstring; use self::screen::{Color...
//! Command line argument parser derive extern crate proc_macro; use proc_macro::TokenStream; use core::fmt::Write; struct Argument { field_name: String, name: String, desc: String, required: bool, is_optional: bool, default: Option<String>, } #[derive(PartialEq, Eq, Debug)] enum OptValueTy...
// Copyright Amazon.com, Inc. or its affiliates. //! Provides utility to serialize Ion data from [`Element`](super::Element) into common targets //! such as byte buffers or files. use super::{AnyInt, Element, Sequence, Struct, SymbolToken}; use crate::result::{illegal_operation, IonError, IonResult}; use crate::IonTy...
//! This module updates the `UpOrDowngrading` status condition by comparing the current and the //! target cluster versions. //! //! The [`crate::status::Conditions`] and [`crate::status::Versioned`] must be implemented //! for the custom resource status to ensure generic access. //! //! The status field names ("condit...
use std::sync::Arc; use std::path::Path; use std::convert::TryInto; use std::cmp::Ordering; use std::mem::size_of; use lru::LruCache; use crate::{disk, Error, WriteOp}; use crate::manifest::{Manifest, SeqNumber}; use crate::Params; use crate::sorted_table::Key; use tokio::sync::Mutex; #[cfg(feature="wisckey")] use ...
mod tilemap; use std::{cmp::Ordering, ops::Range}; use bevy::{ input::{keyboard::KeyboardInput, mouse::MouseWheel, ElementState}, math::Vec3Swizzles, prelude::*, render::camera::WindowOrigin, }; use rand::Rng; use tilemap::{ DownNeighbour, LeftNeighbour, Material, RightNeighbour, TilePosition, Til...
/* * Copyright 2020 Nuclei Studio OÜ * * 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...
use std::{path::PathBuf, io::{self, Write}, iter, collections::BTreeMap, fmt, error}; use utils::term::{Term, style::{Style}}; use super::core::{self, StagingId, StagingTransaction}; use super::super::blockchain::{Blockchain, BlockchainName}; use super::super::wallet::{Wallets, Wallet, self, WalletName}; use cardano::{...
use crate::repr::{ColorIndexed, ColorRgb8, Image, Palette}; use crate::parser::repr::{Entry, EntryType, Header, WadMagic}; pub fn test_color_indexed_in() -> &'static [u8] { &[24u8] } pub fn test_color_indexed_out() -> ColorIndexed { ColorIndexed(24) } pub fn test_color_rgb8_in() -> &'static [u8] { &[24u8...
use crate::app::RenderBlock; use crate::router::{router, Route}; use shared::{BlockId, BlockMessage, EventChoiceMessage, EventId, Word}; use shared::{DownMsg, UpMsg}; use std::ops::Not; use std::sync::Arc; use zoon::futures_signals::signal_vec::MutableVecLockRef; use zoon::{ eprintln, println, static_ref, Connectio...
use bellman::pairing::{ Engine, }; use bellman::{ SynthesisError, ConstraintSystem }; use super::{ Assignment }; use super::num::AllocatedNum; use super::boolean::{ AllocatedBit, Boolean }; use super::permutation::{ PermutationElement, SortablePermutationElement, enforce_sort };...
pub mod adapters; pub use adapters::get_adapter; use regex::Regex; use std::ops::Range; /// MidiMessage is a parsed MIDI message, structured to be easy to work with. /// It is parsed from 3 raw bytes of data. #[derive(Debug, Eq, PartialEq)] pub enum MidiMessage { /// Key released. /// channel: 0-15 /// key...
use crate::{Rng, DEFAULT_FONT, Display, Board}; pub const DISP_WIDTH: usize = 64; pub const DISP_HEIGHT: usize = 32; /// This is the CPU emulator for the CHIP-8 machine. pub struct Cpu<B: Board> { pub board: B, // General purpose registers (the last one is used to signal overflows for // additions, subtr...
use std::convert::TryFrom; use std::sync::Arc; use aries_backtrack::{Backtrack, DecLvl}; use aries_collections::ref_store::RefMap; use aries_core::WriterId; use crate::extensions::{AssignmentExt, SavedAssignment, Shaped}; use crate::label::{Label, VariableLabels}; use crate::lang::expr::{or, Normalize}; use crate::la...
//! This module implements the keyboard device manager. use crate::device::manager::DeviceManager; use crate::device::manager::PhysicalDevice; use crate::device::ps2; use crate::errno::Errno; use crate::errno; use crate::tty; /// Enumation of keyboard keys. #[derive(Clone, Copy, Debug, PartialEq)] pub enum KeyboardKe...
#![no_std] #![no_main] // Local modules mod current_output; mod display; mod encoder_input; // Imports //use core::sync::atomic::{AtomicUsize, Ordering}; //use cortex_m::asm::nop; use embedded_hal::digital::v2::OutputPin; use panic_halt as _; //use panic_halt as _; use rtfm::cyccnt::{Duration, Instant, U32Ext /*CYCCN...
//! Single Cycle Input and Output (SIO) //! //! To be able to partition parts of the SIO block to other modules: //! //! ```no_run //! use rp2040_hal::{gpio::Pins, pac, sio::Sio}; //! //! let mut peripherals = pac::Peripherals::take().unwrap(); //! let sio = Sio::new(peripherals.SIO); //! ``` //! //! And then for examp...
use std::collections::HashMap; use std::fmt; use std::io::prelude::*; use std::io::{self, SeekFrom}; use log::{debug, info}; use super::*; use crate::rw::*; #[derive(Debug)] pub enum Error { MissingStartMarker(CommandRange), MissingEndMarker(CommandRange), UnorderedMarkers(CommandRange), EndMarkerToo...
use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; use std::rc::Rc; use std::sync::atomic::AtomicI32; use std::sync::atomic::Ordering; use std::sync::{Mutex, Once}; use gdk::gio::Cancellable; use gdk::{ ffi, glib::{translate::ToGlibPtr, Bytes}, prelude::{Cast, WindowExtManual}, ...
use bincode; use redis; use cdrs; use postgres; use mongodb; use rusted_cypher; use bson; use uuid::Uuid; use super::Error; use super::{BinaryData,ServerID,UserID,ImageID,ThreadID}; use super::{RedisClient,MongoDatabase}; use super::{RedisCollection,MongoCollection,CassandraSession,PostgresSession,Neo4jSession}; ...
//! latex2mathml //! //! Provides a functionality to convert LaTeX math equations to MathML representation. //! This crate is implemented in pure Rust, so it works for all platforms including WebAssembly. //! //! # Supported LaTeX commands //! //! - Numbers, e.g. `0`, `3.14`, ... //! - ASCII and Greek (and more) let...
pub mod align; pub mod error; pub mod konst; pub use align::*; pub use konst::*; pub use error::{Error, Result}; pub use fxd::{Error as DecimalError, FixedDecimal as Decimal}; pub use time::format_description::{self, FormatItem}; pub use time::PrimitiveDateTime as Datetime; pub use time::{error::Parse as DatetimePars...
use crate::{Color, Event, KeyCode, KeyEvent, KeyModifiers, MouseButton, MouseEvent}; use crosscurses::{mmask_t, Input}; use std::io::Write; impl<W: Write> super::BackendImpl<W> { pub fn parse_next(&self, input: crosscurses::Input) -> Event { // Try to map the crosscurses input event to an `KeyEvent` with p...
/******************************************************************************* * * kit/kernel/memory.rs * * vim:ft=rust:ts=4:sw=4:et:tw=80 * * Copyright (C) 2015-2021, <NAME> * Redistribution of this file is permitted under the terms of the simplified * BSD license. See LICENSE for more information. * *****...
//! Renamer. use std::collections::HashMap; use std::ffi::OsString; use std::fs; use std::io::{self, BufRead, Write}; #[cfg(unix)] use std::os::unix::ffi::{OsStrExt, OsStringExt}; use std::path::{Path, PathBuf}; use std::str; use anyhow::{anyhow, bail}; /// Characters to be escaped by percent encoding. const PERCENT...
//! You can run this test suite with: //! //! cargo test --test witxt //! //! An argument can be passed as well to filter, based on filename, which test //! to run //! //! cargo test --test witxt foo.witxt use anyhow::{anyhow, bail, Context, Result}; use rayon::prelude::*; use std::collections::HashMap; use st...
extern crate image; extern crate cgmath; extern crate rand; extern crate pbr; use std::env; use std::fs::File; use std::f32; use image::ColorType; use image::png::PNGEncoder; use cgmath::prelude::*; use cgmath::Vector3; use cgmath::vec3; use rand::prelude::*; use std::borrow::Borrow; fn write_image(filename: &str, pi...
/* origin: FreeBSD /usr/src/lib/msun/src/e_lgammaf_r.c */ /* * Conversion to float by <NAME>, Cygnus Support, <EMAIL>. */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunPro, a Sun Microsystems, Inc. business. * Per...
// Copyright 2015 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 ...
//! View part of the text editor. use crate::prelude::*; use enso_text::unit::*; use crate::buffer; use crate::buffer::style; use crate::buffer::style::Style; use crate::buffer::Buffer; use crate::buffer::DefaultSetter; use crate::buffer::Setter; use enso_frp as frp; use enso_text::text::BoundsError; use enso_text::...
// Copyright (C) 2019, Cloudflare, Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright notice, // this list...
use std::borrow::Borrow; use crate::{ constants::{SECS_IN_STANDARD_YEAR, STEP, STRESS}, state::{InstrumentCommon, InstrumentUnique, UserPosition}, u_to_f_repr, }; use anchor_lang::prelude::*; use ndarray::{Array, Array2}; use solana_program::log::sol_log_compute_units; use super::{option_intrinsic_value, ...
//! Configuring the system clock sources. //! You will typically need to create an instance of `GenericClockController` //! before you can set up most of the peripherals on the atsamd51 device. //! The other types in this module are used to enforce at compile time //! that the peripherals have been correctly configured...
pub mod statsg; pub mod mutstats; pub mod vecg; pub mod vecu8; pub mod mutvec; pub mod vecvec; pub mod vecvecg; // reexporting to avoid duplication and for backwards compatibility pub use indxvec::{MinMax,Printing,here}; /// simple error handling use anyhow::{Result,bail}; use core::iter::FromIterator; // Structs /...
/// Web/json interface to access settings use actix_http::Payload; use actix_session::{CookieSession, Session}; use actix_web::{ error, http, middleware, web, App, Error, FromRequest, HttpRequest, HttpResponse, HttpServer, Responder, }; use core::ops::Deref; use futures::prelude::*; use lazy_static::lazy_stati...
// Copyright 2020 - <NAME> <<EMAIL>> // SPDX-License-Identifier: Apache-2.0 #[macro_use] extern crate rocket; use crate::cache::ValidatorCacheRefresher; use crate::config::Config; use crate::network_monitor::NetworkMonitorBuilder; use crate::node_status_api::uptime_updater::HistoricalUptimeUpdater; use crate::nymd_cl...
// Copyright 2015-2020 Parity Technologies (UK) Ltd. // This file is part of Open Ethereum. // Open Ethereum is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your o...
use std::borrow::Cow; use maplit::hashmap; use once_cell::sync::Lazy; use crate::{ Class, CompiledInterpolation, ConstnessOverride, DefaultElement, Element, Field, Func, func::Kind, FunctionTypeHint, get_debug, IteratorExt, settings, StrExt, StringExt, type_ref::{Dir, FishStyle, StrType}, }; use super...
use bitvec::prelude::*; use scrypt::{scrypt, Params}; use sha2::{Digest, Sha512}; use std::convert::TryInto; use xsalsa20poly1305::aead::{generic_array::GenericArray, Aead, NewAead}; use xsalsa20poly1305::XSalsa20Poly1305; use zeroize::Zeroize; use crate::error::Error; pub(crate) const MIN_BITS: u32 = 3; pub(crate) c...
use crate::{ actions::{ContainerCreationDefintition, ContainerUpdateDefintition}, ecs::{ common::recompute_bounds, components::{ Bounds, Display, DisplayKind, Layer, LocalTransform, Morph, Order, Tweens, ViewRect, WorldTransform, }, resources::{ ...
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { crate::status::{StatusEntry, StatusValue}, anyhow::{bail, Result}, ffx_core::ffx_plugin, ffx_target_status_args as args, fidl_fuc...