text
stringlengths
3.09k
13.9k
use crate::LocCode; use std::ops::BitOr; // TODO: Make u8 not rely on enum position #[derive(Debug, Clone, Copy)] pub enum Orientation { LBU, LFU, LFD, LBD, RBD, RFD, RFU, RBU, N, L, R, F, B, U, D, LF, LB, RF, RB, FU, FD, BU, B...
use async_std::sync::{Arc, Weak}; use browser_webrtc::signaling_protocol::ChannelId; use browser_webrtc::{ReceiverEvent, Server}; use sycamore::prelude::*; use crate::{ReceiverView, ReceiversListView}; #[derive(Debug)] pub struct ReceiverBuilderView { receivers: Arc<ReceiversListView>, server: Weak<Server>, ...
#![no_std] #![no_main] #![feature(lang_items)] #![feature(custom_test_frameworks)] #![test_runner(tests::test_runner)] #![reexport_test_harness_main = "test_main"] mod ascii_font; pub mod bitwise_macro; pub mod console; pub mod graphics; pub mod log; pub mod pci; pub mod usb; pub mod volatile; use log::*; use consol...
/////////////////////////////////////////////////////////////////////////////// // // Copyright 2018-2021 Robonomics Network <<EMAIL>> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at ...
#[macro_use] extern crate log; extern crate clap; extern crate libc; extern crate nfqueue; extern crate env_logger; #[macro_use] extern crate lazy_static; use std::cmp::min; use std::time::{Duration, Instant}; use std::collections::HashMap; use std::net::{Ipv4Addr, SocketAddrV4}; use clap::{Arg, App}; use libc::AF_INET...
//! Simple theme framework based on Flutter. pub mod state; use { crate::{base, geom::*}, reclutch::display::{Color, DisplayCommand, FontInfo, ResourceReference, Size}, }; /// Implemented by types which are capable of changing themes. pub trait Themed { /// Updates `self` from `theme`. fn load_theme(...
#![windows_subsystem = "windows"] mod bw_cli; mod gui; mod hotkeys; mod tray; mod typing; use crate::bw_cli::LoginItem; use crate::typing::send_raw_string; use argh::FromArgs; use log::LevelFilter; use log::{error, info}; use std::ffi::OsString; use std::io::{stdin, BufRead}; use std::os::windows::ffi::OsStringExt; ...
use crate::audio::AudioManager; use crate::keyboard::OnScreenKeyboard; use crate::midi::MidiReader; use crate::periodic_updater::PeriodicUpdater; use crate::synth::{Synth, Params}; use cpal::traits::DeviceTrait; use crossbeam::channel; use eframe::{ egui, epi::{self, App}, }; use parking_lot::Mutex; use std::{c...
use lazy_static::lazy_static; use regex::Regex; use std::fs; use std::{cmp, collections::HashMap, ops::Sub}; #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] struct Point(i32, i32); impl Sub for Point { type Output = Self; fn sub(self, other: Self) -> Self::Output { Self { 0: self.0 - o...
// Copyright 2020-2021 <NAME> // SPDX-License-Identifier: Apache-2.0 use bee_message::{prelude::MilestoneIndex, MessageId}; use bee_storage::{ access::{AsIterator, Batch, BatchBuilder, Delete, Exist, Fetch, InsertStrict, MultiFetch, Truncate, Update}, backend, }; use bee_tangle::metadata::MessageMetadata; use ...
use proc_macro2::TokenStream as TokenStream2; use quote::{ quote, quote_spanned, }; use syn::{ self, spanned::Spanned as _, }; use super::{ BitfieldStruct, config::{ Config, }, field_info::FieldInfo, }; mod packed; mod unpacked; impl BitfieldStruct { /// Expands the given ...
//! AES128-CTR Driver //! //! Provides a simple driver for userspace applications to encrypt and decrypt messages //! using aes128-ctr mode on top of aes128-ecb //! //! The initial counter configred according to the counter received from the user application. //! The capsule is invoked as follows: //! - the key has...
use futures::io::{AsyncRead, AsyncWrite}; use romio::TcpStream; use std::convert::TryFrom; use std::net::ToSocketAddrs; use std::path::Path; use crate as adb; use crate::util::ConsumePrefix; /// An implementation of adb's socket address specifiers. /// /// `SocketSpec`s of all types can be constructed on every platf...
// Small terminal library. unix-only, and hardcodes escapes rather than using // terminfo, although I believe any of this could be implemented to do the right // thing fairly easily. use super::Result; use libc::termios; use std::fs::File; use std::io::Write; use std::os::unix::io::AsRawFd; pub struct Terminal { s...
use crate::error::FsResult; use once_cell::sync::Lazy; /// Customize how we build history files. /// /// If you need the default value, you can get it with new() /// ``` /// use docchi_fs::history::HistoryOptions; /// let op = HistoryOptions::new(); /// ``` /// If you want to customize, you can use builders. /// /// `...
// 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 ...
use crate::framework::context::Context; use crate::framework::error::GameResult; use crate::common::Rect; use crate::entity::GameEntity; use crate::frame::Frame; use crate::input::touch_controls::TouchControlType; use crate::player::Player; use crate::shared_game_state::SharedGameState; use crate::text_script::ScriptM...
use std::borrow::Cow; use std::iter::FromIterator; use std::{cell::RefCell, collections::HashMap}; use candid::CandidType; use ic_cdk::{ api::{self, call}, export::candid, }; use ic_certified_map::{AsHashTree, Hash, RbTree}; use percent_encoding::percent_decode_str; use serde::{Deserialize, Serialize}; use ser...
mod collection; mod scene; mod mesh; mod physics; pub use collection::*; pub use scene::*; pub use mesh::*; pub use physics::*; use std::{ collections::HashMap, ffi::OsStr, fs::{self, File, DirEntry}, path::Path, }; use ron::de::from_reader; pub struct DataAccessor { pub collections: Vec<Collecti...
use std::any::TypeId; use std::collections::hash_map::DefaultHasher; use std::collections::HashMap; use std::ffi::{CStr, CString}; use std::hash::{Hash, Hasher}; use std::os::raw::{c_char, c_void}; use log::info; use serde::Deserialize; use rgb::lnpbp::bitcoin::OutPoint; use rgb::lnpbp::bp; use rgb::lnpbp::lnp::tra...
use std::error::Error; use std::num::ParseIntError; use std::time::{SystemTime, Duration}; pub fn case_eq(lhs: &[u8], rhs: &[u8]) -> bool { if lhs.len() != rhs.len() { return false; } for p in rhs .iter() .map(|x| x.to_ascii_lowercase()) .zip(lhs.iter()) { if p.0 != ...
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; use near_sdk::collections::LookupMap; use near_sdk::{ env, ext_contract, near_bindgen, AccountId, Balance, BorshStorageKey, Gas, PanicOnDefault, Promise, PromiseResult, PublicKey, }; #[near_bindgen] #[derive(PanicOnDefault, BorshDeserialize, BorshS...
use crate::config::{EventConfig, NatsJsonCollectorConfig, TopicConfig, TornadoConnectionChannel}; use actix::Recipient; use log::*; use std::collections::HashMap; use tornado_collector_common::{Collector, CollectorError}; use tornado_collector_jmespath::config::JMESPathEventCollectorConfig; use tornado_collector_jmespa...
use crate::{ bios::Bios, generic_error::GenericError, memlcontrol::Memlcontrol, memory_region::{MemoryRegionType, REGIONS}, }; #[derive(Debug, Clone)] pub struct Memory { pub ram: Vec<u8>, // 2048K (0x00000000, 0x80000000, 0xa0000000) pub expansion_region_1: Vec<u8>, // 8192K (0x...
use cosmwasm_std::testing::{MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR}; use cosmwasm_std::{ from_binary, from_slice, to_binary, Coin, ContractResult, Empty, OwnedDeps, Querier, QuerierResult, QueryRequest, SystemError, SystemResult, Uint128, WasmQuery, }; use std::collections::HashMap; use cw20::{B...
use crate::types::{chat::ChatId, primitive::Integer}; use serde::{Deserialize, Serialize}; use std::{error::Error, fmt}; const MIN_NAME_LEN: usize = 1; const MAX_NAME_LEN: usize = 32; const MIN_DESCRIPTION_LEN: usize = 3; const MAX_DESCRIPTION_LEN: usize = 256; /// This object represents a bot command #[derive(Clone,...
//! The "Auto MPG" data set. use std::fs; use std::io::{BufRead, BufReader, Read}; use std::path; use app_dirs::*; use ndarray::Array2; use utils::downloader::assure_file; use utils::error::Error; use canonical::CanonicalData; use common::APP_INFO; /// Configure the loader for the data set. /// /// This structure ...
use crate::{pool, DbResult, Paginated, DEFAULT_PAGE_SIZE}; use async_diesel::*; use chrono::prelude::*; use diesel::prelude::*; use diesel::QueryDsl; use diesel_filter::{DieselFilter, Paginate}; use serde::{Deserialize, Serialize}; use uuid::Uuid; table! { k8s_clusters(id) { id -> Uuid, env_id -> N...
use memory; use arch::{multiboot, page}; use drivers::display::{Color, DisplaySize, Display}; use core::cmp; use core::mem; use core::{u8, u16, u32}; use core::ops::Range; #[allow(dead_code)] pub struct Vbe { cinfo: &'static multiboot::VbeControllerInfo, minfo: &'static multiboot::VbeModeInfo } impl Vbe { ...
use std::io::Error as IoError; use std::path::Path; use std::time::Duration; use std::{cell::RefCell, convert::TryInto}; use gstreamer::{ glib::{BoolError, FlagsClass}, prelude::*, query::Seeking, ClockTime, Element, Format, GenericFormattedValue as Gfv, MessageView, SeekFlags, State as GstState, S...
use std::rc::Rc; use super::state::*; use shared::domain::jig::module::body::_groups::design::Trace; use utils::{drag::Drag, prelude::*, resize::get_resize_info}; use dominator::clone; use crate::debug::*; use components::audio::mixer::{AudioPath, AudioSourceExt, AUDIO_MIXER}; use components::collision::stickers_tra...
//! A trait that can be used to format an item from its components. use core::ops::Deref; use std::io; use crate::format_description::well_known::Rfc3339; use crate::format_description::FormatItem; use crate::formatting::{format_component, format_number_pad_zero}; use crate::{error, Date, Time, UtcOffset}; /// A typ...
// LNP Node: node running lightning network protocol and generalized lightning // channels. // Written in 2020-2022 by // Dr. <NAME> <<EMAIL>> // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to // the public domain worldwide. ...
use crate::filedb::*; use crate::runtime::*; use crate::util::*; use crate::{compile, emit_err}; use interloc::*; use std::fs::{read_dir, read_to_string}; fn test_file_should_succeed(files: &FileDb, output_file: Option<&str>) { let info = before_alloc(); let mut writer = StringWriter::new(); let program =...
use crate::calendar::scheduler::schedule_class; use crate::class::user_is_teacher; use crate::models::ClassAsynchronousTask; use crate::models::NewClassAsynchronousTask; use crate::models::NewStudentClassAsynchronousTask; use crate::utils::default_head; use crate::utils::error_messages::database_error; use crate::utils...
use super::*; use byteorder::{LittleEndian, ReadBytesExt}; use libflate::zlib; use std::collections::HashMap; use std::format as fmt; use std::fs::File; use std::io::{self, BufReader, Read, Seek, SeekFrom}; const COMMON_BUF_SZ: usize = 32; const HEADER_SZ: usize = 4 * 2; // [u32:sprite_c][u32:chunk_c] const SPRITE...
// Copyright © 2018 <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, distribu...
use std::time::Duration; use chrono::{DateTime, NaiveDateTime, Utc}; use rdkafka::consumer::{BaseConsumer, Consumer}; use rdkafka::error::KafkaError; use rdkafka::message::BorrowedMessage; use rdkafka::metadata::{Metadata, MetadataPartition, MetadataTopic}; use rdkafka::{ClientConfig, Message, Timestamp, TopicPartitio...
use std::hash::Hasher; use std::hash::Hash; use std::collections::HashSet; use regex::Regex; use super::utils::ParseError; #[derive(Debug)] struct Range { min: u32, max: u32, } impl Range { fn is_valid(&self, i: u32) -> bool { self.min <= i && i <= self.max } } #[derive(Debug)] struct Rule { ...
// Copyright 2018-2019 <NAME> <<EMAIL>> // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in...
#[cfg(target_arch = "x86")] use core::arch::x86::*; #[cfg(target_arch = "x86_64")] use core::arch::x86_64::*; use super::BLAKE2S_IV; #[cfg(all(not(target_feature = "sse4.1"), target_feature = "sse2"))] #[path = "./sse2.rs"] mod feature; #[cfg(target_feature = "sse4.1")] // #[cfg(all(not(target_feature = "avx2"), tar...
use arrayvec::ArrayVec; use caldera::prelude::*; use ply_rs::{parser, ply}; use spark::vk; use std::{fs, io, mem, path::Path}; #[derive(Clone, Copy)] struct PlyVertex { pos: Vec3, } #[derive(Clone, Copy)] struct PlyFace { indices: UVec3, } impl ply::PropertyAccess for PlyVertex { fn new() -> Self { ...
// use crate::card::{DiceColor, Die}; use crate::coord::Coord; use crate::game::{Game, GameMove, GameResult}; use crate::play::Strategy; use cfg_if::cfg_if; use rubot::{self, Bot, Depth, ToCompletion}; use std::i32; use std::time::Duration; impl rubot::Game for Game { type Player = bool; type Fitness = i32; ...
use bmp_monochrome::Bmp; use worker::*; use image::{GenericImageView, Pixel}; use std::io::Cursor; use worker::wasm_bindgen::UnwrapThrowExt; mod utils; fn log_request(req: &Request) { console_log!( "{} - [{}], located at: {:?}, within: {}", Date::now().to_string(), req.path(), req...
use crate::{bar, display::get_primary_display, message_loop, util, window::Window, CONFIG}; use std::{ ffi::CString, sync::{Arc, Mutex}, thread, }; use winapi::shared::windef::HWND; use winapi::shared::windef::RECT; use winapi::um::wingdi::CreateSolidBrush; use winapi::um::wingdi::SetBkColor; use winapi::u...
// Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::language_storage::TypeTag; use crate::move_resource::MoveResource; use crate::parser::parse_type_tag; use crate::token::TOKEN_MODULE_NAME; use anyhow::{bail, Result}; use move_core_types::account_address::AccountAddress; ...
//! Universal Asynchronous Receiver Transmitter - Receiver Code //! //! This module is for receiving data with a UART. use super::{UartConfig, UartDevice, ValidUartPinout}; use rp2040_pac::uart0::RegisterBlock; use embedded_hal::serial::Read; use embedded_time::rate::Baud; use nb::Error::*; #[cfg(feature = "eh1_0_al...
use crate::core_impl::ext::{generate_ext_function_wrappers, generate_ext_structs}; use crate::core_impl::info_extractor::ItemTraitInfo; use proc_macro2::TokenStream as TokenStream2; use quote::quote; impl ItemTraitInfo { /// Generate code that wrapps external calls. pub fn wrap_trait_ext(&self) -> TokenStream2...
use bifrost_hasher::hash_str; use parking_lot::RwLock; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; use std::collections::BTreeMap; #[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)] pub enum Relation { Equal, Before, After, Concurrent, } #[derive(Serialize, Deserialize, De...
use std::ops::Mul; use awsm_web::webgl::{BufferData, BufferTarget, BufferUsage}; use nalgebra_glm::{self as glm, Vec3, Mat4, Vec2}; use nalgebra::geometry::Point3; use shipyard::*; use shipyard_scenegraph::prelude::*; use awsm_web::prelude::*; use crate::{media::{MediaPiece, PuzzleInfo, Media, MediaView}, renderer::{S...
use std::{collections::HashMap, rc::Rc, vec}; use clap::Clap; use prettytable::{cell, row, Cell, Row, Table}; use rustyline::{ completion::Completer, error::ReadlineError, hint::{Hinter, HistoryHinter}, Config, Editor, }; use rustyline_derive::{Helper, Highlighter, Validator}; use crate::{command::*, ...
// Copyright 2021 <NAME> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those...
use std::collections::{HashMap, HashSet}; #[derive(Debug, Clone, Default)] pub struct Node { pub tax_id: i64, pub parent_tax_id: i64, pub rank: String, pub division: String, pub names: HashMap<String, Vec<String>>, // many synonym or common names pub comments: Option<String>, pub format_str...
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
use std::thread; use std::time::{Duration, Instant}; use d3::core::executor::*; use d3::core::machine_impl::*; use d3::d3_derive::*; use crossbeam::channel::RecvTimeoutError; use sdl2::event::Event; use sdl2::keyboard::Keycode; use sdl2::pixels::Color; use sdl2::rect::Rect; use sdl2::render::WindowCanvas; use parki...
// Mod config - used to parse config files // Uses use serde::Deserialize; use std::{fmt, fs, io, vec::Vec}; use url::Url; // Const // array of supported kinds pub const SUPPORTED: [&str; 6] = [ "mastodon", "mastodon_user", "pleroma", "pleroma_user", "plume", "funkwhale", ]; // Errors // Defin...
use crate::{Beatmap, ManiaPP}; use super::{ManiaGradualDifficultyAttributes, ManiaPerformanceAttributes}; /// Gradually calculate the performance attributes of an osu!mania map. /// /// After each hit object you can call /// [`process_next_object`](`ManiaGradualPerformanceAttributes::process_next_object`) /// and it ...
#![doc = include_str!("../README.md")] //! ## `serde` support //! //! When the `serde` feature of this crate is enabled, `Serialize` and //! `Deserialize` are impl'd for the following types: //! //! - [`AffinePoint`] //! - [`Scalar`] //! - [`ecdsa::VerifyingKey`] //! //! Please see type-specific documentation for more...
use crate::geometry::contact_generator::{ ContactGenerationContext, PrimitiveContactGenerationContext, PrimitiveContactGenerator, }; #[cfg(feature = "dim2")] use crate::geometry::Capsule; use crate::geometry::{Collider, ContactManifold, HeightField, Shape}; use crate::ncollide::bounding_volume::BoundingVolume; #[cf...
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
use std::collections::{BTreeMap, VecDeque}; use std::io::{self, Read}; use lazy_static::lazy_static; use regex::Regex; #[derive(Copy, Clone, Debug)] enum Operand { Register(char), Value(i64) } #[derive(Copy, Clone, Debug)] enum Cmd { Snd(Operand), Rcv(char), Set(char, Operand), Add(char, Oper...
use std::collections::BTreeSet; use std::sync::{Arc, Mutex, Condvar}; use std::fs::File; use std::io::{BufReader, BufRead}; use std::ops::DerefMut; use files::{write_json_file, read_json_file}; use schedule::{World, Device, ScheduleEntry, GuestPath, DeviceOverride}; use script_handler::ScriptHandler; use config::{Confi...
use std::borrow::Cow; use crate::common::{Backend, BackendReaderExt, BackendError}; use anni_repo::library::{album_info, disc_info}; use async_trait::async_trait; use std::collections::{HashMap, HashSet}; use std::path::{Path, PathBuf}; use tokio::fs::{read_dir, File}; use anni_repo::db::RepoDatabaseRead; use crate::Ba...
use crate::{fp12::Fp12, Compress, G1Affine, G2Affine, Gt}; use core::ops::{Add, AddAssign}; use ff::Field; use subtle::{Choice, ConditionallySelectable}; use blst::*; /// Execute a complete pairing operation `(p, q)`. pub fn pairing(p: &G1Affine, q: &G2Affine) -> Gt { let mut tmp = blst_fp12::default(); unsaf...
use std::str; use std::cmp::{min, max}; use std::collections::HashMap; fn starts(input: &[u8]) -> (i64, i64){ let ns: Vec<i64> = str::from_utf8(input).unwrap().lines().map(|l|{ let mut a = l.split(": "); a.next(); a.next().unwrap().parse::<i64>().unwrap() } ).collect...
use crate::filter::*; use crate::ui::{Action, Input}; use tui::backend::CrosstermBackend; use tui::layout::{Constraint, Direction, Layout, Rect}; use tui::style::{Color, Style}; use tui::widgets::{Block, Borders, Paragraph, Text, Widget}; use tui::Frame; use std::borrow::Cow; use std::cell::Cell; pub struct QueryVie...
/// Binding to blas with [cblas-sys](https://lib.rs/cblas-sys) as a slas backend. #[derive(Default, Clone, Copy)] pub struct Blas; use super::*; macro_rules! impl_dot { ($t: ty, $blas_fn: ident) => { /// Thin wrapper around blas for the various dot product functions that works for multiple different (and m...
//! The `sort` crate provides a CSV file processor that is able to sort CSV files. extern crate crossbeam; extern crate csv; extern crate csv_filter_config as config; extern crate csv_filter_util as util; use config::FilterConfig; use crossbeam::channel::bounded as bounded_channel; use csv::{ReaderBuilder, StringReco...
use kmm::{ allocator::{bitmap::BitmapAllocator, AllocatorError, FrameAllocator, LockedAllocator}, Align, }; use mmu::OffsetPageMapper; use riscv::{ addr::PAGE_SIZE, mmu::{self, EntryFlags, MapError, PageSize, PageTable}, registers::{Satp, SatpMode}, PhysAddr, VirtAddr, }; use rvalloc::BumpAlloca...
// Copyright 2020 The Chromium OS 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 std::io::Read; use std::mem; use std::os::unix::io::FromRawFd; use std::{fs::File, rc::Rc}; use super::event::*; use super::{bindings, VdaConnecti...
extern crate redis; use self::redis::Connection; use config::{EnvConfig, ProcessConfig}; use output::Logger; use std::process::Command; use std::sync::atomic::Ordering; use std::{thread, time}; use worker::redis::Commands; use STOP; #[derive(PartialEq)] enum Status { FailedToPull, ExecutedCommand, FailedT...
use std::str::FromStr; use parser::token::{ Token, TokenKind }; use util::util; const TABSIZE: &'static usize = &4; #[derive(Debug)] pub struct Lexer { pub source: String, pos: usize, is_begin_line: bool, indent_level: Vec<usize>, } impl Lexer { pub fn new(src: String) -> Lexer { Lexer ...
/* * Copyright (c) 2013 <NAME> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL W...
#![cfg(target_arch = "wasm32")] use std::convert::TryInto; use wasm_bindgen::prelude::*; use wasm_bindgen::JsCast; use web_sys::{HtmlCanvasElement, WebGlBuffer, WebGlProgram, WebGlRenderingContext, WebGlShader}; pub mod geometry; mod shaders; #[cfg(feature = "wee_alloc")] #[global_allocator] static ALLOC: wee_alloc...
use cached::proc_macro::cached; use cached::stores::UnboundCache; use im; use itertools::Itertools; use lazy_static::lazy_static; use regex::Regex; use std::collections::HashSet; //departure location: 27-840 or 860-957 #[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Rule { name: String, ...
use pcap::{Capture, Active}; use std::array::TryFromSliceError; use std::collections::BTreeMap; use std::time::{Duration, Instant}; use crate::frame::NetSignals; struct RadiotapData { length: usize, channel: String, signal: Option<i8>, } pub fn frames_data(mut device: Capture<Active>) -> NetSignals { ...
// Copyright 2019 Walmart 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 applicable law or agreed to in...
use std::ops::{Add, Sub, AddAssign, SubAssign, Div, DivAssign, Mul, MulAssign}; use crate::math::space::Vec3; #[repr(C)] #[derive(Default, Debug, Copy, Clone, PartialEq)] pub struct Color(pub f64, pub f64, pub f64); impl Add for Color { type Output = Color; fn add(self, rhs: Color) -> Self::Output { Color(self.0...
use std::path; use aws_config::meta::region::RegionProviderChain; use aws_sdk_s3 as s3; use s3::model::{ BucketLocationConstraint, CompletedMultipartUpload, CompletedPart, CreateBucketConfiguration, }; use s3::output::{CreateMultipartUploadOutput, UploadPartOutput}; use s3::{ByteStream, Client, Error, Region}; us...
// Generated from definition com.github.openshift.api.route.v1.RouteSpec /// RouteSpec describes the hostname or path the route exposes, any security information, and one to four backends (services) the route points to. Requests are distributed among the backends depending on the weights assigned to each backend. When...
use crate::util::path_eq; use crate::Diagnostic; use proc_macro2::TokenStream as TokenStream2; use quote::{quote, ToTokens}; use syn::{parse_quote, Attribute, Data, DeriveInput, Expr, Field, Ident, Lit, Meta, NestedMeta}; /// The kind of the python parameter, this corresponds to the value of Parameter.kind /// (https:...
use crate::Value; use std::iter; use std::mem; use std::slice; use thiserror::Error; /// An error raised when interacting with the stack. #[derive(Debug, Error)] #[error("tried to access out-of-bounds stack entry")] pub struct StackError(()); /// The stack of the virtual machine, where all values are stored. #[derive...
use nannou::math::cgmath; use nannou::prelude::*; use std::time::Duration; use crate::renderer::{ self, buffer, camera::{Camera, CameraController}, geom::{DrawGeom, Geom, GeomLoader, GeomVertex, Vertex}, instance::{Instance, Instances}, light::{DrawLight, Light}, texture::Texture, }; pub struc...
//! Solutions for https://adventofcode.com/2018/day/12 use utils::data::load_data; use utils::data::non_empty_lines; #[allow(dead_code)] pub fn part1() { println!("{}", solve(get_puzzle_input(), 20)); } #[allow(dead_code)] pub fn part2() { println!("{}", solve(get_puzzle_input(), 50_000_000_000)); } #[derive...
// Copyright 2012-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-MI...
// Copyright 2013-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...
use std::borrow::BorrowMut; use std::env::*; use std::fs::File; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use std::str::SplitWhitespace; use clearscreen::clear; use reedline::{DefaultCompleter, DefaultCompletionActionHandler, DefaultHighlighter, DefaultHinter, FileBackedHistory, Reedline, Sign...
//! Stream Pager //! //! A pager for command output or large files. #![warn(missing_docs)] use anyhow::{bail, Error}; use clap::ArgMatches; use std::env; use std::ffi::{OsStr, OsString}; use std::fmt::Write; #[cfg(unix)] use std::os::unix::io::{FromRawFd, RawFd}; #[cfg(unix)] use std::str::FromStr; use std::time::Dura...
mod import; use crate::{ compiler::{ AnonymousFunction, Break, Boolean, Continue, evaluate_expression, Null, Objects, ReturnO, StringO, }, Environment, Store, }; use sflyn_parser::{ Statement, Statements, tokens::Keywords, }; pub fn evaluate_statement( statement: &...
use cssparser::*; use crate::properties::Property; use crate::traits::{PropertyHandler, ToCss}; use crate::printer::Printer; use crate::properties::{ align::AlignHandler, background::BackgroundHandler, flex::FlexHandler, font::FontHandler, margin_padding::*, outline::OutlineHandler, border::BorderHandler,...
use crate::c; #[derive(Debug, Clone)] pub enum Input { SubstructureRedirect, SubstructureNotify, KeyPress, } impl Input { fn mask(&self) -> u32 { match self { Self::SubstructureRedirect => c::SubstructureRedirectMask, Self::SubstructureNotify => c::SubstructureNotifyMas...
use crate::error::result; use crate::parser::ast; use crate::parser::ast::ast::{Node, RootAST, Syntax, Types}; use super::variables::Scope; use super::variables::Variables; use super::functions::Functions; use super::structs::Structs; #[derive(PartialEq, Debug)] pub enum InterpreterState { Main, If, IfDone, F...
use std::net::Ipv4Addr; use ipnet::Ipv4Net; use iprange::IpRange; use lazy_static::lazy_static; use regex::Regex; lazy_static! { static ref REGEX_KEY_MATCH2: Regex = Regex::new(r"(.*):[^/]+(.*)").unwrap(); static ref REGEX_KEY_MATCH3: Regex = Regex::new(r"(.*)\{[^/]+\}(.*)").unwrap(); } /// Determines whethe...
// //! Copyright 2021 Alibaba Group Holding 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 appl...
//! Multipart body filters //! //! Filters that extract a multipart body for a route. use std::future::Future; use std::pin::Pin; use std::task::{Context, Poll}; use std::{fmt, io}; use bytes::{Buf, Bytes}; use futures::{future, Stream}; use headers::ContentType; use hyper::Body; use mime::Mime; use multiparty::heade...
//! What to do if the destination already exists. use itertools::Itertools; use std::{fmt, str::FromStr}; use tokio::fs as tokio_fs; use crate::args::DisplayEnumSet; use crate::common::*; use crate::separator::Separator; /// Which `IfExists` features are supported by a given driver or API? #[derive(Debug, EnumSetTyp...
use core::alloc::{AllocErr, Layout}; use core::mem; use core::ptr::{self, NonNull}; use winapi::um::errhandlingapi::GetLastError; use winapi::um::memoryapi::VmOfferPriorityVeryLow; use winapi::um::memoryapi::{OfferVirtualMemory, VirtualAlloc, VirtualFree, VirtualQuery}; use winapi::um::winnt::{MEM_COMMIT, MEM_DECOMMIT...
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 use anyhow::Result; use sha2::{Digest, Sha256}; use std::time::Duration; use zerocopy::AsBytes; use crate::app::TransportWrapper; use crate::bootstrap::{Bootstrap, Boot...
use std::fs::{File, Metadata}; use std::io::{Seek, BufReader, SeekFrom, Read, BufWriter, Write}; use std::collections::{VecDeque}; const BUFFER_SIZE: u64 = 4096; pub enum ModificationType { Added, Removed, NoChange, } #[allow(dead_code)] pub enum Input { File(File), Stdin(std::io::Stdin), } /// ...
// Standard Library Modules // use std::io; use std::fs::File; use std::io::prelude::*; /// A representation of chip8 ram pub struct ChipMemory { /// a vector representing the ram ram: Vec<u8>, /// true if a rom has been loaded loaded: bool, /// program start location start: usize } impl Chi...