text
stringlengths
8
4.13M
// Copyright 2022 Sebastian Ramacher // SPDX-License-Identifier: MIT use ascon_aead::{ aead::{generic_array::typenum::Unsigned, Aead, AeadInPlace, KeyInit}, Ascon128, Ascon128a, Ascon80pq, }; use criterion::{ black_box, criterion_group, criterion_main, Bencher, BenchmarkId, Criterion, Throughput, }; use ra...
// Copyright (C) 2021 Subspace Labs, Inc. // 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unle...
use nu_engine::{eval_block, eval_expression, CallExt}; use nu_protocol::ast::Call; use nu_protocol::engine::{CaptureBlock, Command, EngineState, Stack}; use nu_protocol::{ Category, Example, IntoInterruptiblePipelineData, ListStream, PipelineData, Signature, Span, SyntaxShape, Value, }; #[derive(Clone)] pub st...
use crate::ui::components::image_button::ImageButtonProps; use raui_core::prelude::*; widget_component! { pub button_state_image(key, props) { let ButtonProps { selected, trigger, context, .. } = props.read_cloned_or_default(); let ImageButton...
use nix; use std::{cmp, fmt, os, ptr}; #[derive(Clone)] pub struct CircularBuffer<T> { head: usize, tail: usize, buf: Vec<T>, read: usize, written: usize, } impl<T> CircularBuffer<T> { pub fn new(cap: usize) -> Self { let mut buf = Vec::with_capacity(cap); unsafe { buf.set_len(cap) }; Self { head: 0, ...
// Copyright 2013 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 ...
pub trait StutteringIterator: Iterator { /// Creates an iterator that duplicates each item count times. #[inline] fn stutter(self, count: usize) -> StutteringIter<Self> where Self: Sized, Self::Item: Copy, { StutteringIter::new(self, count) } } impl<T: ?Sized> Stuttering...
// src/token/mod.rs mod token; pub use token::*;
/// /// Blitz Explorer /// /// Request on the tcp server /// /// Copyright 2019 Luis Fernando Batels <luisfbatels@gmail.com> /// use std::net::{TcpStream, SocketAddr}; use std::io::{BufReader, BufRead, Write, BufWriter, copy}; use catalog::catalog::Catalog; pub struct Request { } impl Request { // Handle the c...
#[doc = "Reader of register LL_DBG_7"] pub type R = crate::R<u32, super::LL_DBG_7>; #[doc = "Reader of field `ADV_RX_WR_PTR`"] pub type ADV_RX_WR_PTR_R = crate::R<u8, u8>; #[doc = "Reader of field `ADV_RX_RD_PTR`"] pub type ADV_RX_RD_PTR_R = crate::R<u8, u8>; impl R { #[doc = "Bits 0:6 - Advertiser Receive FIFO wri...
use std::fmt; use std::time::Instant; struct Struct { data: [u8; 32], } impl fmt::Display for Struct { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}", self.data) } } fn main() { // -------------------------------- println!("loge"); ::std::env::set_var("RUST_LO...
use ckb_core::transaction::Transaction as CoreTransaction; use ckb_network::NetworkController; use ckb_shared::shared::Shared; use ckb_store::ChainStore; use jsonrpc_core::{Error, Result}; use jsonrpc_derive::rpc; use jsonrpc_types::Transaction; use numext_fixed_hash::H256; use std::convert::TryInto; #[rpc] pub trait ...
// Returns the market price of a given coin pair // TODO: Remove this market prices simulations // TODO: Dynamically retrieve market price for wallet coins from broker API pub fn get_pair_price(pair: &String) -> f64 { let mut price: f64 = 0.; if pair == "BTC/USDT" { price = 55818.12; } else if pair...
#![deny(missing_docs)] //! Hello world mod utilities; #[allow(unused_imports)] use crate::utilities::*; mod components; #[allow(unused_imports)] use crate::components::*; mod backbone; use backbone::simulator::SimulatorRunState; mod systems; use crate::systems::*; use amethyst::{ core::transform::TransformBun...
use crate::text::Message; use serde::{Deserialize, Serialize}; use std::borrow::Cow; /// Message sent by client to server. #[derive(Deserialize, Serialize, Clone, Debug, Eq, PartialEq)] pub enum ClientMessage<'a, 'b> { /// Subscribe to a groups updates. JoinGroup { gid: usize }, /// Unsubscribe from a gro...
use super::*; /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// #[derive(Serialize, Deserialize, Debug, Clone)] pub struct UserFull { name: String, email: String, #[serde(renam...
use archiver::config; use archiver::ctx::Ctx; fn main() { archiver::cli::run(|| { let cfg = config::Config::from_file("archiver.toml"); let ctx = Ctx::create(cfg?)?; ctx.notify("Test notification!")?; Ok(()) }) }
//------------------------------------------------------------------------------ // from+git_me@luketitley.com //------------------------------------------------------------------------------ mod args; mod tasks; use args::*; //------------------------------------------------------------------------------ fn main() {...
use server::location::Location; use vector::Vector2; pub trait Player { fn name(&self) -> String; fn uuid(&self) -> String; // TODO: Are we using UUIDs here? Need to check proto // TODO: Verify that f32 is right here fn location(&self) -> Location; fn rotation(&self) -> Vector2<f32>; }
use byteorder::{LittleEndian, WriteBytesExt}; use failure::Error; use crate::{ chunks::TOKEN_XML_TAG_END, model::{owned::OwnedBuf, TagEnd}, }; #[derive(Debug, Copy, Clone)] pub struct XmlTagEndBuf { id: u32, } impl XmlTagEndBuf { pub fn new(id: u32) -> Self { Self { id } } } impl OwnedBu...
extern crate crypto2; use crypto2::aeadcipher::Chacha20Poly1305; fn main() { let key = [ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, ]; ...
//! Пример с асинхронными параллельно работающими чтением/записью в сокет. use futures::Future; use std::net::SocketAddr; use tokio::net::TcpListener; mod server { use futures::{Future, Stream}; use tokio::{ io::{copy, AsyncRead}, net::TcpListener, }; /// Простенький ехо-сервер. p...
use super::EMPTY; /// Bucket array with bi-directional pointers. pub struct Bucket { bounds: [u32; 257], ps: [u32; 256], qs: [u32; 256], } impl Bucket { /// Construct the bucket array. #[inline] pub fn compute(s: &[u8]) -> Box<Self> { let mut bkt = Box::new(Bucket { bounds:...
extern crate serde; extern crate serde_derive; extern crate serde_json; // https://www.goldmansachs.com/insights/insights-articles.json #[derive(Default, Debug, Clone, PartialEq, serde_derive::Serialize, serde_derive::Deserialize)] #[serde(rename_all = "camelCase")] pub struct Root { pub items: Vec<GSItem>, p...
use std::convert::TryInto; use std::io; use std::mem; use std::net::{SocketAddr, SocketAddrV4, SocketAddrV6, TcpListener, TcpStream}; use std::os::unix::io::{AsRawFd, FromRawFd}; use std::time::Duration; use nix::sys::time::{TimeVal, TimeValLike}; pub trait TcpListenerExt { fn accept_timeout(&self, timeout: Optio...
use anyhow::{anyhow, Result}; use chrono::{DateTime, Utc}; use uuid::Uuid; use crate::note::DbNote; pub fn init_schema(db: &sqlite::Connection) -> Result<()> { db.execute(" -- This table is a dictionary of note statuses. create table if not exists note_status( id integer primary key, ...
use nom::character::is_digit; use crate::parse::parse_u64; use crate::attributes::SdpOptionalAttribute; use std::fmt; use nom::{ IResult, character::complete::char, combinator::map_res, bytes::complete::{take_while, tag} }; #[derive(Debug, PartialEq, Clone)] pub struct SdpTiming(pub u64, pub u64); ...
#![doc = "generated by AutoRust 0.1.0"] #![allow(unused_mut)] #![allow(unused_variables)] #![allow(unused_imports)] use super::{models, API_VERSION}; #[non_exhaustive] #[derive(Debug, thiserror :: Error)] #[allow(non_camel_case_types)] pub enum Error { #[error(transparent)] Managers_List(#[from] managers::list:...
table! { user (id) { id -> Varchar, username -> Varchar, nickname -> Varchar, phone -> Varchar, email -> Varchar, password -> Varchar, } }
#![feature(stmt_expr_attributes)] #![cfg_attr(feature="benchmark", feature(test))] #[cfg(feature = "benchmark")] extern crate criterion; #[cfg(feature = "benchmark")] extern crate test; extern crate passenger; #[cfg(feature = "benchmark")] use criterion::Criterion; #[cfg(feature = "benchmark")] mod benches { u...
mod primitives; pub use self::primitives::DEFAULT_PROFILE_IDX;
use std::collections::HashMap; const INPUT: &str = include_str!("../input.txt"); fn get_passports() -> impl Iterator<Item = HashMap<&'static str, &'static str>> { let required_keys = ["byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"]; INPUT .split("\n\n") .map(|spec| { spec.split(|...
use fastping_rs::Pinger; use fastping_rs::PingResult::{Idle, Receive}; use std::collections::HashMap; use std::sync::mpsc::{Sender, Receiver}; use std::time::SystemTime; use crate::{PingResult, Target}; pub fn run_ping(pinger: &Pinger, results: &Receiver<fastping_rs::PingResult>, ips: ...
use wasm_bindgen::prelude::*; // https://rustwasm.github.io/docs/wasm-bindgen/reference/types/boxed-jsvalue-slice.html #[wasm_bindgen(module = "js/event-queue.js")] extern "C" { #[wasm_bindgen] pub fn pop_event() -> String; // #[wasm_bindgen(method)] // fn render(this: &MyClass) -> String; }
#[doc = "Register `OTG_DSTS` reader"] pub type R = crate::R<OTG_DSTS_SPEC>; #[doc = "Field `SUSPSTS` reader - SUSPSTS"] pub type SUSPSTS_R = crate::BitReader; #[doc = "Field `ENUMSPD` reader - ENUMSPD"] pub type ENUMSPD_R = crate::FieldReader; #[doc = "Field `EERR` reader - EERR"] pub type EERR_R = crate::BitReader; #[...
#![no_main] extern crate abxml; #[macro_use] extern crate libfuzzer_sys; use abxml::chunks::ResourceWrapper; fuzz_target!(|data: &[u8]| { let rw = ResourceWrapper::new(data); rw.get_resources(); });
use serde::Serialize; use std::io::Write; pub mod auth; pub mod internal_server; pub mod validation; #[derive(Serialize, Debug)] #[serde(untagged)] /// Represents all the different error categories pub enum ErrorCategories { ValidationError(validation::ValidationError), InternalServerError(internal_server::In...
extern crate hyper; extern crate rustc_serialize; extern crate websocket; //mod webpage; mod chatserver; mod newwebpage; fn main() { chatserver::start(); // webpage::serve(); newwebpage::serve(); }
//! [`Recorder`] implementation finding the starts of all matches. //! Faster than a full [`NodesRecorder`](super::nodes::NodesRecorder). use super::*; use std::cell::RefCell; /// Recorder that saves only the start indices to the [`Sink`]. pub struct IndexRecorder<'s, S> { sink: RefCell<&'s mut S>, } impl<'s, S> ...
use crate::{ Result, OG_SUDO_STANDARD_LECTURE, PASSWORD, SUDOERS_ROOT_ALL, SUDOERS_USER_ALL_ALL, SUDOERS_USER_ALL_NOPASSWD, USERNAME, }; use sudo_test::{Command, Env, User}; /* cases where password input is expected */ #[test] fn fails_if_password_needed() -> Result<()> { let env = Env(SUDOERS_USER_ALL_AL...
#[derive(Debug, Clone, PartialEq)] pub enum Type { Void, Int1, Int32, Pointer(Box<Type>), Function(Box<FunctionType>), } #[derive(Debug, Clone, PartialEq)] pub struct FunctionType { pub ret_ty: Type, pub params_ty: Vec<Type>, } impl Type { pub fn func_ty(ret_ty: Type, params_ty: Vec<Ty...
#![recursion_limit = "256"] pub mod meta;
use std::path::PathBuf; use thiserror::Error; pub type StandardResult<T> = std::result::Result<T, BoilrError>; #[derive(Error, Debug)] pub enum BoilrError { #[error("Error cannot format {0:?}")] FormatDisplayError(#[from] std::fmt::Error), #[error("Error cannot read from {path:?}")] ReadError { ...
use derivatives::Differentiable; use std::collections::{BTreeMap, VecDeque}; use std::collections::btree_map::{Entry}; #[derive(Debug, Clone)] pub struct Transition { pub by_char: BTreeMap<char, u32>, pub default: u32, } #[derive(Debug, Clone)] pub struct Dfa { pub transitions: Vec<Transition>, } pub tra...
use super::{operate, BytesArgument}; use nu_engine::CallExt; use nu_protocol::ast::Call; use nu_protocol::ast::CellPath; use nu_protocol::engine::{Command, EngineState, Stack}; use nu_protocol::Category; use nu_protocol::{Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value}; struct Arguments { c...
//! FBX data. use std::{cell::RefCell, path::Path, rc::Rc}; use fbxcel::pull_parser::{self as fbxbin, any::AnyParser}; use gtk::{prelude::*, Window}; use crate::{ widgets::{FbxAttributeTable, FbxNodeTree, Logs}, WINDOW_TITLE_BASE, }; pub use self::attribute::{Attribute, AttributeLoader}; mod attribute; //...
fn main() { let edges = orbits::read_from_input().unwrap(); println!("Part 1: {}", orbits::count_indirect_edges(&edges)); println!("Part 2: {}", orbits::shortest_path_length(&edges, "YOU", "SAN").unwrap()); } mod orbits { use std::collections::BTreeSet; use std::env; use std::fs; #[derive(Debug)] pub st...
use crate::automata::conversion::LTL2Automaton; use crate::automata::{CoBuchiAutomaton, State}; use crate::specification::Specification; use hyperltl::{HyperLTL, Op}; use smtlib::{IdentKind, Identifier, Instance, QuantKind, Sort, Term, TermKind}; use std::collections::HashMap; use std::process; pub(crate) struct BoSyE...
use secp256k1::{Message, SecretKey, PublicKey, sign, Signature as Sig, RecoveryId, recover}; use hex::{FromHex, encode}; use k256::{ ecdsa::{ recoverable, signature::{Signer, DigestSigner}, SigningKey, VerifyingKey, Signature, }, Secp256k1, elliptic_curve::{FieldBytes, se...
use actix::prelude::*; #[derive(Message)] #[rtype(result = "()")] pub struct Info { pub info: crate::participants::consumer_folder::consumer_structs::Info, } #[derive(Message)] #[rtype(result = "()")] pub struct PurchaseResult { pub expense: f64, pub balance: f64, pub purchased: f64, } #[derive(Message)] #[rty...
//! The compile module is responsible for taking a `Pattern` and compiling it into a `StateGraph` //! (as defined in `state`). It is recommended to optimize Patterns before compiling them. //! //! The output of `to_state()`, which is implemented for Pattern and some subtypes, is a //! `StateGraph`, which itself is a ve...
use std::str; use std::net; use std::thread; pub fn main() { let udp_socket = net::UdpSocket::bind("127.0.0.1:3999") .expect("Unable to bind to port"); let mut buff = [0; 1024]; loop { let udp_socket_new = udp_socket.try_clone() .expect("Unable to clone socket"); match...
/* Copyright (c) 2023 Uber Technologies, Inc. <p>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 <p>http://www.apache.org/licenses/LICENSE-2.0 <p>Unless required by applicable law or agre...
use util::*; fn main() -> Result<(), Box<dyn std::error::Error>> { let timer = Timer::new(); let input = input::matrix::<char>(&std::env::args().nth(1).unwrap(), ""); let mut count = 1; let slopes = vec![(1, 1), (3, 1), (5, 1), (7, 1), (1, 2)]; for (right, down) in slopes { count *= (0..inp...
use clap::{App, AppSettings, Arg, SubCommand}; use std::fs::{self, OpenOptions}; use std::io::{self, Read, Write}; use std::process; use cbm::disk::directory::FileType; use cbm::disk::file::{File, FileOps, Scheme}; use cbm::disk::geos::GEOSFile; use cbm::disk::{self, D64, D71, D81, DiskType}; use cbm::Petscii; // Pos...
use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Debug)] pub struct PpuData { line_cycle: usize, scanline: usize, frame: usize, v: u16, t: u16, x: u8, w: u8, nametable_a: Vec<u8>, nametable_b: Vec<u8>, nametable_c: Vec<u8>, nametable_d: Vec<u8>, pale...
//! This module corresponds to `mach/mach_host.h` use kern_return::kern_return_t; use mach_types::{host_t, clock_serv_t}; use clock_types::clock_id_t; extern "C" { pub fn host_get_clock_service(host: host_t, clock_id: clock_id_t, clock_serv: *mut clock_serv_t) -> kern_return_t; }
/* * Slack Web API * * One way to interact with the Slack platform is its HTTP RPC-based Web API, a collection of methods requiring OAuth 2.0-based user, bot, or workspace tokens blessed with related OAuth scopes. * * The version of the OpenAPI document: 1.7.0 * * Generated by: https://openapi-generator.tech *...
use sack::{SackType, SackStorable, TokenLike, SackBacker}; /// This is a sack that can decay pub trait Decayer<'a, C1: 'a, C2: 'a, C3: 'a, D1: 'a, D2: 'a, D3: 'a, B1: 'a, B2: 'a, B3: 'a, T1: 'a, T2: 'a, T3: 'a> where C1: SackStorable, C2: SackStorable, C3: SackStorable, D1: SackStorab...
pub mod signal; pub mod graph;
use crate::{bgp_type::AutonomousSystemNumber, error::ConvertBytesToBgpMessageError}; use std::collections::BTreeSet; use std::net::Ipv4Addr; use std::path::Path; use bytes::{BytesMut, BufMut}; use anyhow::Context; #[derive(Debug, PartialEq, Eq, Clone, Hash)] pub enum PathAttribute { Origin(Origin), AsPath(AsP...
#[cfg(feature = "std")] use crate::grid::config::{ColoredConfig, VerticalLine as VLine}; use super::Line; /// A horizontal split line which can be used to set a border. #[cfg_attr(not(feature = "std"), allow(dead_code))] #[derive(Debug, Clone)] pub struct VerticalLine { pub(crate) index: usize, pub(crate) lin...
use ::core::core_msg::ToCoreThreadMsg; use ::file::file_msg::{FileThreadId, ToFileThreadMsg, SaveResult}; use ::file::text::{Line, Point}; use std::fs::File; use std::io::{Read, Write}; use std::path::PathBuf; use std::sync::mpsc::{Sender, Receiver}; use std::thread; /// A file thread represents one open file. It cont...
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // 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>,...
// Copyright 2021 The Matrix.org Foundation C.I.C. // // 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...
use day10::part_1; fn main() { let result1 = part_1(); println!("The number of asteroids detected in the best position is {}", result1); }
use std::{cmp::Reverse, sync::Arc}; use chrono::{Duration, Utc}; use eyre::Report; use hashbrown::HashMap; use rosu_v2::prelude::{GameMode, OsuError, Username}; use crate::{ commands::{ check_user_mention, osu::{get_user, UserArgs}, }, database::OsuData, embeds::{EmbedData, SnipedDiffE...
fn bar(x: &[u64; 1]) -> &u64 { &x[0] } fn main() {} /* thread 'rustc' panicked at 'internal error: entered unreachable code: __t4 := builtin$havoc_ref()', prusti-viper/src/encoder/foldunfold/mod.rs:455:26 stack backtrace: 0: rust_begin_unwind at /rustc/8007b506ac5da629f223b755f5a5391edd5f6d01/libr...
#[doc = "Register `BSEC_OTP_CONFIG` reader"] pub type R = crate::R<BSEC_OTP_CONFIG_SPEC>; #[doc = "Register `BSEC_OTP_CONFIG` writer"] pub type W = crate::W<BSEC_OTP_CONFIG_SPEC>; #[doc = "Field `PWRUP` reader - PWRUP"] pub type PWRUP_R = crate::BitReader; #[doc = "Field `PWRUP` writer - PWRUP"] pub type PWRUP_W<'a, RE...
use nu_protocol::ast::{Call, Expr, Expression, ImportPatternMember}; use nu_protocol::engine::{Command, EngineState, Stack}; use nu_protocol::{ Category, Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value, }; #[derive(Clone)] pub struct Hide; impl Command for Hide { fn name(&self) -> &str ...
use std::collections::{BTreeMap, BTreeSet}; use std::fmt; use std::io; use crate::base::Part; pub fn part1(r: &mut dyn io::Read) -> Result<String, String> { solve(r, Part::One) } pub fn part2(r: &mut dyn io::Read) -> Result<String, String> { solve(r, Part::Two) } fn solve(r: &mut dyn io::Read, part: Part) -...
use std::collections::HashMap; struct MorseDecoder { morse_code: HashMap<String, String>, } impl MorseDecoder { fn new() -> MorseDecoder { MorseDecoder{ morse_code : [("....-", "4"),("--..--", ","),(".--", "W"),(".-.-.-", "."),("..---", "2"),(".", "E"),("--..", "Z"),(".----", "1"),(".-..", "L...
//! Serial Peripheral Interface (SPI) bus use hal::spi::{FullDuplex, Mode , Phase, Polarity}; use nb; use tm4c123x::{SSI0,SSI1, SSI2, SSI3}; use gpio::gpioa::{PA2, PA4, PA5}; use gpio::gpiob::{PB4, PB6, PB7}; use gpio::gpiod::{PD0, PD2, PD3}; use sysctl::Clocks; use sysctl; use gpio::{AF1, AF2, AlternateFunction, O...
use std::env; use std::fs; fn main() -> std::io::Result<()> { let args : Vec<String> =env::args().collect(); let var = &args[1]; fs::remove_file(var)?; println! ("{} has been deleted", var); Ok(()) }
#[cfg(test)] mod test { use rbs::value::map::ValueMap; use rbs::{value_map, Value}; #[test] fn test_decode_value() { let m = value_map! { 1.to_string() => 1, 2.to_string() => 2, }; let m = Value::Map(m); let v: Value = rbatis::decode(Value::Array(...
use crate::prelude::Token; pub enum Statement { Assign { name: Token, expression: Expression }, AssignQuote { name: Token, expression: Expression }, Expression(Expression), } pub enum Expression { Ident { name: Token, }, List { value: Vec<Token>, }, MonadCall { ...
#[doc = "Register `CFGR` reader"] pub type R = crate::R<CFGR_SPEC>; #[doc = "Register `CFGR` writer"] pub type W = crate::W<CFGR_SPEC>; #[doc = "Field `SEL` reader - Select the phase for the Output clock"] pub type SEL_R = crate::FieldReader; #[doc = "Field `SEL` writer - Select the phase for the Output clock"] pub typ...
#[doc = "Register `CRC_CR` reader"] pub type R = crate::R<CRC_CR_SPEC>; #[doc = "Register `CRC_CR` writer"] pub type W = crate::W<CRC_CR_SPEC>; #[doc = "Field `RESET` reader - RESET"] pub type RESET_R = crate::BitReader; #[doc = "Field `RESET` writer - RESET"] pub type RESET_W<'a, REG, const O: u8> = crate::BitWriter<'...
//! andn /// Logical and not pub trait Andn { /// Bitwise logical `AND` of inverted `self` with `y`. /// /// # Instructions /// /// - [`ANDN`](http://www.felixcloutier.com/x86/ANDN.html): /// - Description: Logical and not. /// - Architecture: x86. /// - Instruction set: BMI. ...
use crate::feed_processor::{FeedObjectMapping, FeedProcessor, FeedProcessor as FeedProcessorT}; use crate::{self as pallet_feeds}; use codec::{Compact, CompactLen, Decode, Encode}; use frame_support::parameter_types; use frame_support::traits::{ConstU16, ConstU32, ConstU64}; use scale_info::TypeInfo; use sp_core::H256;...
#[doc = "Register `DOEPMSK` reader"] pub type R = crate::R<DOEPMSK_SPEC>; #[doc = "Register `DOEPMSK` writer"] pub type W = crate::W<DOEPMSK_SPEC>; #[doc = "Field `XFRCM` reader - Transfer completed interrupt mask"] pub type XFRCM_R = crate::BitReader; #[doc = "Field `XFRCM` writer - Transfer completed interrupt mask"]...
use chrono::Utc; use hashbrown::HashMap; use parking_lot::Mutex; use std::{hash::Hash, str::FromStr}; pub struct Buckets([Mutex<Bucket>; 9]); impl Buckets { pub fn new() -> Self { let make_bucket = |delay, time_span, limit| { let ratelimit = Ratelimit { delay, l...
#[doc = "Register `CFGR2` reader"] pub type R = crate::R<CFGR2_SPEC>; #[doc = "Register `CFGR2` writer"] pub type W = crate::W<CFGR2_SPEC>; #[doc = "Field `LOCKUP_LOCK` reader - Cortex-M0+ LOCKUP bit enable bit"] pub type LOCKUP_LOCK_R = crate::BitReader; #[doc = "Field `LOCKUP_LOCK` writer - Cortex-M0+ LOCKUP bit enab...
use crate::math::line_of_sight::line_of_sight; use crate::types::{Position, Segment}; pub fn reachable_positions<'a>( start: Position, obstacles: &'a [Segment], destination: Position, ) -> impl Iterator<Item=Position> + 'a { // Take all the segment start & end position and put them into an iterator. ...
// Copyright (c) 2016, <daggerbot@gmail.com> // This software is available under the terms of the zlib license. // See COPYING.md for more information. use std::sync::Arc; use x11_dl::xlib; use error::Result; // Global library instances. lazy_static! { static ref XLIB: Result<Arc<xlib::Xlib>> = match xlib::Xlib...
//! Puck WebSocket support. pub mod frame; pub mod message; pub mod send; pub mod upgrade; pub mod websocket; pub use upgrade::*;
//error-pattern:begin_panic_fmt fn main() { assert_eq!(5, 6); }
use rocket::catch; use rocket_contrib::{json, json::JsonValue}; #[catch(404)] pub fn index() -> JsonValue { json!({ "message": "Language not found." }) }
use std::{collections::BTreeSet, fmt, hash}; use crate::{ AnyId, AtomId, Context, ExclusivelyContextual, InContext, Atomic, AcesError, AcesErrorKind, sat, }; /// An identifier of a domain element used in c-e structures. /// /// In line with the theory, the set of all dots is a shared resource /// common to all c-e...
// This file is part of Darwinia. // // Copyright (C) 2018-2021 Darwinia Network // SPDX-License-Identifier: GPL-3.0 // // Darwinia 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 Lic...
use crate::{BaseInterface, EthernetInterface}; pub(crate) fn np_ethernet_to_nmstate( _np_iface: nispor::Iface, base_iface: BaseInterface, ) -> EthernetInterface { EthernetInterface { base: base_iface, ..Default::default() } }
use std::{ collections::{HashMap, HashSet}, iter::FromIterator, }; use quote::ToTokens; use syn::{ braced, bracketed, parse::{Parse, ParseStream}, punctuated::Punctuated, token::{self, Brace}, ExprLit, Ident, Lit, LitInt, LitStr, Result, Token, }; use tabled::{ builder::Builder, set...
use std::collections::HashMap; use apllodb_shared_components::Expression; use apllodb_storage_engine_interface::{ColumnName, TableName}; use crate::{ condition::Condition, sql_processor::query::query_plan::query_plan_tree::query_plan_node::node_id::QueryPlanNodeId, }; #[derive(Clone, PartialEq, Debug)] /// R...
#[doc = "Register `WRP2BR` reader"] pub type R = crate::R<WRP2BR_SPEC>; #[doc = "Register `WRP2BR` writer"] pub type W = crate::W<WRP2BR_SPEC>; #[doc = "Field `WRP2B_STRT` reader - Bank 2 WRP second area B start offset"] pub type WRP2B_STRT_R = crate::FieldReader; #[doc = "Field `WRP2B_STRT` writer - Bank 2 WRP second ...
use crate::physics::{physics_body::PhysicsBody, physics_collider::PhysicsCollider}; use ptgui::prelude::*; use raylib::prelude::*; use serde::Deserialize; #[derive(PartialEq, Copy, Clone, Deserialize, Debug)] pub struct Entity { position: Point, size: Dimensions, } impl Entity { pub fn new(position: Point...
// This file is part of rdma-core. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/rdma-core/master/COPYRIGHT. No part of rdma-core, including this file, may be copied, modified, propagated, or distributed ...
use cosmwasm_std::{Decimal, StdError}; use thiserror::Error; #[derive(Error, Debug)] pub enum ContractError { #[error("{0}")] Std(#[from] StdError), #[error("Unauthorized")] Unauthorized {}, // Add any other custom errors you like here. // Look at https://docs.rs/thiserror/1.0.21/thiserror/ fo...
//! Tests auto-converted from "sass-spec/spec/core_functions/string" #[allow(unused)] use super::rsass; // From "sass-spec/spec/core_functions/string/index.hrx" mod index { #[allow(unused)] use super::rsass; #[test] fn beginning() { assert_eq!( rsass( "a {b: str-inde...
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. use crate::VerifierError; use air::{proof::StarkProof, Air, EvaluationFrame}; use crypto::{BatchMerkleProof, ElementHasher, MerkleTree}; u...
v1_imports!(); use std::sync::Arc; use rocket::{Route, State}; use authn::AuthnHolder; use db::staff; use session::SessionManager; pub fn get_routes() -> Vec<Route> { routes![get_staff, rm_staff, new_staff] } #[allow(needless_pass_by_value)] #[get("/staff")] fn get_staff(_usr: staff::Admin, conn: DatabaseConne...