text
stringlengths
3.09k
13.9k
// Copyright 2019 The xi-editor 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 ag...
use crate::common::*; use Function::*; pub(crate) enum Function { Nullary(fn(&FunctionContext) -> Result<String, String>), Unary(fn(&FunctionContext, &str) -> Result<String, String>), Binary(fn(&FunctionContext, &str, &str) -> Result<String, String>), } lazy_static! { pub(crate) static ref TABLE: BTreeMap<&'s...
#![allow(clippy::too_many_arguments)] use sdl2::{ event::Event, image::LoadSurface, keyboard::Keycode, pixels::Color, rect::{Point, Rect}, render::{Canvas, RenderTarget, Texture, TextureCreator}, surface::Surface, video::Window, }; // Screen dimension const WIDTH: u32 = 650; const HEIG...
use crate::common::{vitup_setup, wait_until_folder_contains_all_qrs}; use assert_fs::TempDir; use chain_impl_mockchain::key::Hash; use iapyx::{NodeLoad, NodeLoadConfig}; use jormungandr_lib::interfaces::BlockDate; use jormungandr_testing_utils::testing::asserts::VotePlanStatusAssert; use jormungandr_testing_utils::test...
extern crate zip; extern crate sdl2; extern crate gl; use std::os::raw::c_void; use std::{thread, time}; use gl::types::*; use std::path::Path; use std::fs::File; use std::io::prelude::*; use std::collections::HashMap; use sdl2::event::Event; use sdl2::keyboard::Keycode; use awlib::AnotherWorldEngine; use awlib::opco...
//! Intermediate representation for C/C++ enumerations. use super::context::{BindgenContext, TypeId}; use super::item::Item; use super::ty::TypeKind; use clang; use ir::annotations::Annotations; use ir::item::ItemCanonicalName; use parse::{ClangItemParser, ParseError}; /// An enum representing custom handling that ca...
#![cfg(feature = "use_alloc")] use crate::size_hint; use crate::Itertools; use alloc::vec::Vec; #[derive(Clone)] /// An iterator adaptor that iterates over the cartesian product of /// multiple iterators of type `I`. /// /// An iterator element type is `Vec<I>`. /// /// See [`.multi_cartesian_product()`](crate::Iter...
mod gameboy; extern crate sdl2; use sdl2::pixels::{Color, PixelFormatEnum}; use sdl2::render::TextureAccess; use sdl2::EventPump; use std::time::{Instant, Duration}; use std::thread; use gameboy::cartridge::Cartridge; use gameboy::cpu::Cpu; use gameboy::graphics::Gpu; use gameboy::memory::MemoryUnit; use game...
use maxgraph_store::db::api::{GraphConfig, GraphResult, GraphError}; use std::sync::Arc; use maxgraph_store::db::graph::store::GraphStore; use std::net::SocketAddr; use maxgraph_runtime::store::v2::global_graph::GlobalGraph; use gaia_pegasus::Configuration as GaiaConfig; use maxgraph_store::db::api::GraphErrorCode::Eng...
use anyhow::{anyhow, bail, Result}; use log::info; use std::collections::HashMap; use std::path::PathBuf; use url::Url; pub fn publish( configs: &Vec<gh_trs::config::types::Config>, gh_token: &Option<impl AsRef<str>>, repo: impl AsRef<str>, verified: bool, ) -> Result<()> { let gh_token = gh_trs::e...
use super::BEvent; use crate::prelude::{BTerm, VirtualKeyCode}; use bracket_geometry::prelude::Point; use std::collections::{HashSet, VecDeque}; /// Internal: clears the current frame's input state. Used by HAL backends to indicate the start of a new frame /// for input. pub(crate) fn clear_input_state(term: &mut BTer...
// Copyright 2021 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate 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 option) any la...
//! Solution to [AoC 2021 Day 4](https://adventofcode.com/2021/day/4) use std::str::FromStr; use std::{collections::HashSet, convert::TryInto}; use anyhow::anyhow; fn find_first_winner(draws: &[u32], mut boards: Vec<Board>) -> Option<Board> { for &draw in draws { // Iterate over indices to make satisfyin...
use std::char; use std::fmt; /// Representation of a demangled symbol name. pub struct Demangle<'a> { inner: &'a str, /// The number of ::-separated elements in the original name. elements: usize, } /// De-mangles a Rust symbol into a more readable version /// /// All Rust symbols by default are mangled a...
#[cfg(test)] mod tests; mod app; mod input; mod messages; mod state; mod ui; use ::failure; use ::jwalk::Parallelism::{RayonDefaultPool, Serial}; use ::jwalk::WalkDir; use ::std::env; use ::std::io; use ::std::path::PathBuf; use ::std::process; use ::std::sync::atomic::{AtomicBool, Ordering}; use ::std::sync::mpsc; u...
//! Actix tracing - support for tokio tracing with Actix services. #![deny(rust_2018_idioms, nonstandard_style)] #![doc(html_logo_url = "https://actix.rs/img/logo.png")] #![doc(html_favicon_url = "https://actix.rs/favicon.ico")] use core::marker::PhantomData; use actix_service::{ apply, ApplyTransform, IntoServi...
// Taken and adapted from https://github.com/smol-rs/smol/blob/ad0839e1b3700dd33abb9bf23c1efd3c83b5bb2d/examples/hyper-server.rs use std::net::SocketAddr; use std::net::{Shutdown, TcpListener, TcpStream}; use std::pin::Pin; use std::sync::Arc; use std::task::{Context, Poll}; use std::time::Duration; use anyhow::{Error...
use cssparser::*; use crate::traits::{Parse, ToCss}; use crate::printer::Printer; use super::CssRuleList; use crate::declaration::DeclarationHandler; use crate::targets::Browsers; use crate::rules::{ToCssWithContext, StyleContext}; use crate::error::{ParserError, PrinterError}; #[derive(Debug, PartialEq)] pub struct S...
extern crate web_sys; mod utils; use arrow::ipc::writer::StreamWriter; use arrow::record_batch::RecordBatch; use js_sys::Uint8Array; use parquet::arrow::{ArrowReader, ParquetFileArrowReader}; use parquet::basic::Compression; use parquet::file::reader::FileReader; use parquet::file::serialized_reader::{SerializedFil...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::layout::Layout; use diem_crypto::ed25519::Ed25519PublicKey; use diem_global_constants::{DIEM_ROOT_KEY, OPERATOR_KEY, OWNER_KEY}; use diem_management::{config::ConfigPath, constants, error::Error, secure_backend::SharedBackend...
#[macro_use] extern crate log; extern crate env_logger; extern crate getopts; extern crate smoltcp; mod utils; use std::str; use std::collections::BTreeMap; use std::fmt::Write; use std::os::unix::io::AsRawFd; use smoltcp::phy::wait as phy_wait; use smoltcp::wire::{EthernetAddress, IpAddress, IpCidr}; use smoltcp::if...
//! Drives graceful shutdown when the process receives a signal. #[cfg(feature = "runtime")] use std::{ pin::Pin, task::{Context, Poll}, }; use tokio::signal::unix::{signal, Signal, SignalKind}; use tracing::debug; #[cfg_attr(docsrs, doc(cfg(feature = "shutdown")))] pub use drain::Watch; /// Drives shutdown ...
// Copyright 2018 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT // http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD // https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied, // modified, or di...
//! NXP iMXRT hardware abstraction layer //! //! An [`embedded-hal`](https://crates.io/crates/embedded-hal) implementation //! targeting processors in NXP's IMXRT106x family. //! //! The HAL is a WIP. More documentation will become available once more capabilities //! are exposed. //! //! In some cases, the HAL simply ...
use sp_cid::Cid; use yatima_core::{ self, ipld_error::IpldError, name::Name, parse::{ self, span::Span, }, }; use std::{ cmp::Ordering, fmt, fmt::Write, string::String, }; use nom::{ error::ErrorKind, AsBytes, Err, IResult, InputLength, }; use std::path::PathBuf; #[derive(PartialE...
use std::env::args; use std::error::Error; use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; use std::thread; use std::time::{Duration, SystemTime}; use lz4_flex::compress_prepend_size; use paho_mqtt::{Client, ConnectOptions}; use sysinfo::{DiskExt, ProcessorExt, System, SystemExt}; use crate::lib::c...
use actix_web::{ cookie::Cookie, web::{Data, Json, Path}, HttpRequest, HttpResponse, }; use chrono::{Duration, Utc}; use reqwest::Url; use sqlx::{postgres::PgDatabaseError, PgPool}; use core::settings::{GoogleOAuth, RuntimeSettings}; use shared::{ config::RemoteTarget, domain::session::{ Cr...
use std::collections::HashMap; use bytemuck::cast_slice; use glam::{Vec3, Vec4Swizzles}; use ike_core::World; use ike_render::{wgpu::ColorTargetState, *}; use ike_transform::Transform; use crate::DEBUG_LINES; struct ShaderResources { shader: wgpu::ShaderModule, pipelines: HashMap<RenderTarget, wgpu::RenderPi...
//! A Rust crate for translating keycodes based on Chrome's mapping of keys. //! //! Easily convert, generate, listen for, or map keycodes for Linux, Windows, Mac, USB, and //! browsers! Includes a `struct` to manage the state of pressed keys and generate USB HID reports. //! Can be used for `#![no_std]` crates. //! //...
use clap::{value_t, value_t_or_exit, App, Arg}; use fastping_rs::Pinger; use image::{FilterType, GenericImageView, Rgba}; use std::net::{IpAddr, Ipv6Addr}; use std::process::exit; use std::thread; fn main() { let matches = App::new("pingas") .version(clap::crate_version!()) .author(clap::crate_auth...
// region: lmake_readme include "readme.md" //! A //! # cargo_reg_local //! //! Find data from crates.io registry index in local cache. //! For now on linux only. The folder of the cache is this: `~\.cargo\registry\index\github.com-1ecc6299db9ec823\.cache\` //! //! The only argument is a crate name or a substring ...
use crate::consts::MAX_SIZE; use crate::field::BrickKind; // file name with all levels const STD_LEVELS: &str = include_str!("../assets/std_puzzles"); // if starting block is not set for a level in the file, use this one const DEFAULT_KIND: BrickKind = BrickKind::Joker; // convert character to type of a block fn c2br...
// Copyright 2016 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 super::conn_udp_listener::*; use super::*; use crate::error::{Error, Result}; use std::future::Future; use std::pin::Pin; use tokio::net::UdpSocket; use tokio::sync::mpsc; use tokio::time::Duration; async fn pipe() -> Result<( Arc<dyn Listener + Send + Sync>, Arc<dyn Conn + Send + Sync>, UdpSocket, )>...
use openexr_sys as sys; use crate::{ core::{error::Error, header::HeaderRef}, deep::deep_frame_buffer::{DeepFrameBuffer, DeepFrameBufferRef}, multi_part::multi_part_input_file::MultiPartInputFile, }; type Result<T, E = Error> = std::result::Result<T, E>; use std::marker::PhantomData; #[repr(transparent)...
use indicatif::ProgressBar; use postgres::types::ToSql; use quick_xml::events::Event; use std::{collections::HashMap, error::Error, str}; use crate::db::{write_artists, DbOpt, SqlSerialization}; use crate::parser::Parser; #[derive(Clone, Debug)] pub struct Artist { pub id: i32, pub name: String, pub real_...
use std::{convert::TryFrom, sync::Arc}; use futures_util::stream; use futures_util::stream::StreamExt; use serde::Serialize; use thiserror::Error; use tonic::Streaming; use arrow::{ array::Array, datatypes::Schema, ipc::{self, reader}, record_batch::RecordBatch, }; use arrow_flight::{ flight_servi...
use crate::log::{self, LogOpt}; use crate::opt::DisplayOpts; use crate::process::{self, Process}; use nix::sys::signal::{self, Signal}; use nix::unistd::Pid; use signal_hook::{iterator::Signals, SIGALRM, SIGHUP, SIGINT, SIGTERM}; use std::sync::{Arc, Mutex}; use std::thread::{self, sleep, JoinHandle}; use std::time::{...
// Copyright 2020 <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,...
// Copyright © 2021-present <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 // https://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in w...
use crate::metadata::Metadata; use crate::updater::FirmwareStore; use serde_json::json; use std::time::Duration; pub struct HawkbitClient { client: reqwest::Client, url: String, tenant: String, token: String, } pub enum PollResult { Wait(Duration), Deployment(Deployment), } pub struct Deploym...
use std::collections::HashMap; use serenity::async_trait; use serenity::builder::CreateApplicationCommand; use serenity::client::Context; use serenity::futures::StreamExt; use serenity::model::channel::Message; use serenity::model::interactions::application_command::{ ApplicationCommandInteraction, ApplicationCom...
use core::{fmt, slice}; use log::info; use opencv; use opencv::core::{MatTrait, MatTraitManual, Scalar_}; use std::{num::ParseIntError, path::Path, str::FromStr}; /// Convert an image a path to a resized sequence of bytes. pub fn convert<P: AsRef<Path>>( path: P, dimensions: Dimensions, ) -> Result<Vec<u8>, Co...
use std::{ net::SocketAddr, sync::{Arc, Mutex}, time::Instant, }; use anyhow::{Context, Result}; use structopt::StructOpt; use tokio::sync::Semaphore; use tracing::{info, trace}; use bench::{ configure_tracing_subscriber, connect_client, drain_stream, rt, send_data_on_stream, server_endpoint, ...
use d10_core::pixelbuffer::PixelBuffer; use d10_core::color::{Color, Rgb, Srgb}; use d10_core::errors::ParseEnumError; use std::io::{Write, Read, Seek, BufRead}; use std::str::FromStr; use jpeg_encoder::{Encoder, SamplingFactor, ColorType, EncodingError as JpegEncodingError}; use jpeg_decoder::{Decoder, PixelFormat, ...
//! An attribute for easy generation of const functions with conditional compilations. //! //! # Examples //! //! ```rust //! use const_fn::const_fn; //! //! // function is `const` on specified version and later compiler (including beta and nightly) //! #[const_fn("1.36")] //! pub const fn version() { //! /* ... */...
use std::borrow::Cow; use std::fs::{self, create_dir_all}; use std::io; use std::path::{Path, PathBuf}; use typed_builder::TypedBuilder; #[non_exhaustive] #[derive(Debug, Clone, TypedBuilder)] pub struct Request<'a> { pub repo_path: Cow<'a, Path>, pub id: Cow<'a, str>, pub name: Cow<'a, str>, pub desc...
use log::{debug, trace}; use std::ffi::c_void; use std::fmt; use crate::gc::MrbGarbageCollection; use crate::sys; use crate::value::{Value, ValueLike}; use crate::{Artichoke, ArtichokeError}; /// Metadata about a Ruby exception. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Exception { /// The result of...
use std::{env::var, fs, path::{Path, PathBuf}}; use serde_derive::{Serialize, Deserialize}; #[derive(Debug, Default, Serialize, Deserialize, Clone)] pub struct Config { webhook_url: Option<String>, last_used_hero_id: Option<String>, //todo move last_ues_hero_id into cache avatar_uploader_url: Option<String...
//! Provides easy ways to run a beacon node or validator client in-process. //! //! Intended to be used for testing and simulation purposes. Not for production. use beacon_node::ProductionBeaconNode; use environment::RuntimeContext; use eth2::{ reqwest::{ClientBuilder, Url}, BeaconNodeHttpClient, }; use std::p...
use std::path::{Path, PathBuf}; use termion::event::Key; use toml::Value; use crate::util::{Filter, SortBy}; use crate::{ keys::{Action, Keybind}, util::{PaneConfig, PaneRole}, }; // The config struct is the singleton to handle the user configuration. // Currently it holds only the keybinding but it can be ex...
//! ADS-B Simulator - see README.md // // © NewForester, 2018. Available under MIT licence terms. // //! This module is the main routine of the ADS-B Simulator. The main routine //! is actually `producer()`. It seems impossible to divide this into smaller //! functions even for documentation purposes. //! //! In ter...
use super::Scheme; use crate::DeviceResult; #[repr(transparent)] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct RgbColor(u32); /// Color format for one pixel. `RGB888` means R in bits 16-23, G in bits 8-15 and B in bits 0-7. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ColorFormat { RGB332, ...
use crate::common::AdjustedMantissa; use crate::float::Float; use crate::table::{LARGEST_POWER_OF_FIVE, POWER_OF_FIVE_128, SMALLEST_POWER_OF_FIVE}; #[inline] pub fn compute_float<F: Float>(q: i64, mut w: u64) -> AdjustedMantissa { let am_zero = AdjustedMantissa::zero_pow2(0); let am_inf = AdjustedMantissa::zer...
//! Enums common to all CTRE Phoenix devices. #![allow(non_camel_case_types)] #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum ErrorCode { /// No Error - Function executed as expected OK = 0, // CAN-Related CAN_MSG_STALE = 1, /// Could not transmit the CAN frame. TxFail...
mod arithmetic; mod domain; mod equality; mod gamma; mod memory; mod pass; mod theta; use crate::{ graph::{InputParam, InputPort, NodeId, OutputPort, Rvsdg}, passes::{dataflow::domain::ProgramTape, utils::Changes}, utils::{AssertNone, ImHashMap}, }; use domain::{ByteSet, Domain}; use im_rc::hashmap::HashMa...
use heck::ToKebabCase; use wasm_bindgen::prelude::*; use wasm_bindgen::JsCast; use yew::prelude::*; /// Main app component struct App { /// Name of the cheat cheat_name: String, /// The GameShark code to convert gameshark_code: String, /// Output of patch conversion. The patch is displayed in blu...
// A custom GDK paintable capable of rendering a GIF // The paintable makes uses of the awesome image // crate to read a gif file and transform it to a Vec<Frame> // which are then rendered by the paintable at different snapshots use gtk::{gdk, glib, graphene}; use gtk::prelude::*; use gtk::subclass::prelude::*; use g...
use crate::cli::cli::{pre_exec, Colors, Palette}; use clap::{App, AppSettings, Arg, ArgMatches}; use fancy_regex::Regex; pub struct Cmd {} impl Cmd { pub fn new() -> App<'static> { App::new("ping") .args(&[ Arg::new("url").about("URL destination").required(true), ...
//! This crate provides procedural derive macros to simplify the usage of `evmap`. //! //! Currently, only `#[derive(ShallowCopy)]` is supported; see below. #![warn(missing_docs, rust_2018_idioms, intra_doc_link_resolution_failure)] use proc_macro2::{Ident, TokenStream}; use quote::{format_ident, quote, quote_spanned}...
#![allow(dead_code)] use crate::state::{Entity, State}; use crate::events::{BuildHandler, Event, EventHandler}; use crate::widgets::Button; use crate::{IntoChildIterator, WindowEvent}; use crate::state::style::*; #[derive(Clone, Debug, PartialEq)] pub enum TabEvent { SwitchTab(usize), } //impl Message for Ta...
use std::fmt::Debug; use async_trait::async_trait; use cast_trait_object::dyn_upcast; use crate::graph::shape::{SinkShape, SourceShape}; use crate::graph::{stage, Connect, Graph, Inlet, Outlet, Port, Stage}; use crate::{AppData, ProctorResult, SharedString}; /// Through shape that encapsulates externally created sta...
const DEFAULT_RADIO_BANDWIDTH: u32 = 925000; struct ChannelConfiguration { pub freq_hz: u32, pub bandwidth: u32, } impl ChannelConfiguration { fn min_radio_freq(&self) -> u32 { let radio_bw = get_radio_bandwidth(self.bandwidth); return self.freq_hz - (self.bandwidth / 2) + (radio_bw / 2); ...
//! [![docs](https://docs.rs/slog_unwraps/badge.svg)](https://docs.rs/slog_unwraps) //! ![code size](https://img.shields.io/github/languages/code-size/najamelan/slog_unwraps.svg) //! [![Build Status](https://api.travis-ci.org/najamelan/slog_unwraps.svg?branch=master)](https://travis-ci.org/najamelan/slog_unwraps) //! [...
#![deny(unused_must_use)] //! Network tests for Dynamic Honey Badger. extern crate env_logger; extern crate hbbft; extern crate itertools; extern crate log; extern crate rand; extern crate rand_derive; extern crate serde_derive; extern crate threshold_crypto as crypto; mod network; use std::collections::BTreeMap; us...
use crate::idml_parser::fonts_parser::{Font, FontType}; use crate::idml_parser::IDMLResources; use dirs; use libharu_sys::*; use std::cell::Cell; use std::collections::HashMap; use std::ffi::CString; use std::fs; use std::iter::FromIterator; use std::marker::Copy; use std::path::PathBuf; use std::ptr; #[derive(Debug, ...
#![feature(available_parallelism)] use std::thread; use std::env; use std::io::Write; use std::error; use std::fs; use std::time::Instant; use std::cmp; use regex::Regex; #[derive(Debug)] enum SortBy { StoryId, Comments } const CHECKPOINTS_COUNT: usize = 31; static FILE: &[u8] = include_bytes!("../hn-index....
use std::sync::{mpsc, Arc, RwLock}; use std::{thread, time}; use bitcoincore_rpc::{Client as RpcClient, RpcApi}; use crate::types::GetNetworkInfoResult; use crate::util::debounce_sender; use crate::{Config, HDWallet, HDWatcher, Indexer, Query, Result}; #[cfg(feature = "electrum")] use crate::electrum::ElectrumServer...
// SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>> // SPDX-License-Identifier: MIT use crate::{VariantBuilder, VariantBuilderExt, VariantType}; use glib::{translate::*, variant::VariantTypeMismatchError, VariantTy}; use std::{borrow::Cow, ops::Deref}; pub(crate) mod deserialize; pub(crate) mod deserializer; pub use des...
use std::fs; use std::path::PathBuf; use std::{env, str}; #[allow(dead_code)] fn link(name: &str, bundled: bool) { use std::env::var; let target = var("TARGET").unwrap(); let target: Vec<_> = target.split('-').collect(); if target.get(2) == Some(&"windows") { println!("cargo:rustc-link-lib=dyli...
use lua_patterns::LuaPattern; use std::collections::HashMap; struct Replacement { pattern: &'static str, replacement: &'static str, should_escape_pattern: bool, } impl Replacement { const fn new( pattern: &'static str, replacement: &'static str, should_escape_pattern: bool, ...
use crate::canvas::Canvas; use crate::icons::{XpmColor, XpmImage}; use crate::server::client::Client; use crate::server::keyboard::{KeyCode, KeyState}; use crate::server::objects::wl_surface::SurfaceObject; use crate::server::objects::xdg_toplevel::XdgToplevelObject; use crate::server::WINDOW_TITLE_BAR_HEIGHT; use crat...
use aoc_2021::input_file; use std::fs; #[derive(Clone, Debug, PartialEq)] enum Element { Open, Close, Number(i32), } fn parse(input: &str) -> Vec<Element> { let mut elements = vec![]; let mut input = input.chars().peekable(); while let Some(c) = input.next() { match c { '['...
//! Provides utilties for downloading and parsing modpacks use daedalus::download_file; use fs_extra::dir::CopyOptions; use serde::Deserialize; use std::{convert::TryFrom, env, io, path::Path}; use tokio::{fs, try_join}; use uuid::Uuid; use zip::ZipArchive; use zip_extensions::ZipWriterExtensions; use self::{ man...
use std::collections::{HashMap, HashSet}; use elasticlunr::{Index, Language}; use lazy_static::lazy_static; use config::Config; use errors::{bail, Result}; use library::{Library, Section}; use serde_json; pub const ELASTICLUNR_JS: &str = include_str!("elasticlunr.min.js"); lazy_static! { static ref AMMONIA: am...
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors // // 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 // // Unl...
use http::Uri; use std::rc::Rc; // https://tools.ietf.org/html/rfc3986#section-2.2 const RESERVED_PLUS_EXTRA: &[u8] = b":/?#[]@!$&'()*,+?;=%^<>\"\\`{}|"; // https://tools.ietf.org/html/rfc3986#section-2.3 const UNRESERVED: &[u8] = b" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-._~"; #[inline] ...
use super::MessageEvent; use crate::events::EventListener; use crate::prelude::*; use crate::utils::ResultExt; use async_channel::{self as channel, Receiver, Sender}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::{io, pin::Pin, task::Poll}; /// The state of the SSE connection. #[derive(...
use super::{parse_interaction_options::ParseInteractionOption, prelude::*}; #[derive(Debug)] pub struct MatchSubCommands { commands: Vec<MatchSubCommand>, result_type: Option<Ident>, } impl IntoIterator for MatchSubCommands { type Item = MatchSubCommand; type IntoIter = IntoIter<Self::Item>; fn i...
use std::rc::Rc; use std::cell::Cell; use wasm_bindgen::prelude::*; use serde_derive::{Serialize, Deserialize}; use futures_signals::signal::{Signal, SignalExt, Mutable}; use futures_signals::signal_vec::{SignalVec, SignalVecExt, MutableVec}; use dominator::{Dom, text_signal, html, clone, events, link}; use crate::to...
use crate::core::U256; use crate::{ domain::{BlockTimeHeight, YoctoNear, YoctoStake}, interface, }; use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; /// STAKE token value at a point in time, i.e., at a block height. /// /// STAKE token value = [total_staked_near_balance](StakeTokenValue::total_st...
//! __Deprecated__. The `storage` module implements the logic for storing the specific work //! entities. Deprecated in favor of the balance module. //! //! Only kept around to support migrating from the old storage format. use chrono::{DateTime, Local, Utc}; use failure::{bail, format_err, Error}; use serde::{Deseria...
use bio_types::strand::Strand; use derive_more::Constructor; use crate::core::dna::Nucleotide; use crate::core::stranding::predict::{LocusStrandPredictor, ROIStrandPredictor}; use crate::core::summary::{LocusSummary, ROISummary}; use super::StrandPredictor; use derive_getters::Getters; #[derive(Constructor, Getters,...
use crate::{prelude::*, support::fields_eq}; use itertools::Itertools; use truc::record::definition::DatumDefinitionOverride; #[derive(Getters)] pub struct Group { name: FullyQualifiedName, #[getset(get = "pub")] inputs: [NodeStream; 1], #[getset(get = "pub")] outputs: [NodeStream; 1], rs_strea...
use std::fmt; use std::fmt::Debug; #[derive(Debug, Clone, Eq, PartialEq)] pub enum Direction { Up, Right, Down, Left, } impl fmt::Display for Direction { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { Direction::Up => write!(f, "up"), Direction...
use crate::define_syscall; use core::fmt::{Arguments, Result, Write}; use core::ops; use libbmu::Time; use rpi::{MMIO_BASE, gpio}; use tock_registers::interfaces::{ReadWriteable, Readable, Writeable}; use tock_registers::registers::{ReadOnly, ReadWrite, WriteOnly}; register_bitfields! { u32, AUX_ENABLES [ ...
use aoc::*; use eyre::eyre; use itertools::Itertools; use regex::{Regex, RegexSet}; enum Operation { SwapPosition(usize, usize), SwapLetter(u8, u8), RotateLeft(usize), RotateRight(usize), RotatePosition(u8), ReversePosition(usize, usize), MovePosition(usize, usize), } impl Operation { ...
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #[macro_use] extern crate clap; use anyhow::{anyhow, bail, Context, Result}; #[cfg(feature = "blobstore")] use avml::ONE_MB; use clap::{App, Arg}; #[cfg(any(feature = "blobstore", feature = "put"))] use std::fs::remove_fil...
use crate::atomic::AtomicRequest; use crate::buffer::Buffer; use crate::connector::Connector; use crate::crtc::Crtc; use crate::device::Device; use crate::encoder::Encoder; use crate::error::Error; use crate::error::Result; use crate::mode::Mode; use crate::object::Object; use crate::plane::Plane; #[derive(Debug)] pub...
use std::collections::BTreeMap; use std::convert::From; use std::cmp::min; use std::io::{self, Read}; #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] enum Dir { NW, N, NE, SW, S, SE } impl From<&str> for Dir { fn from(s: &str) -> Dir { match s { "nw" => Dir::NW, ...
use std::net::{IpAddr, SocketAddr}; use std::{ io, time::{Duration, Instant}, }; use futures::prelude::*; use futures::select; use log::warn; use tokio::time::interval; use crate::packet::*; use crate::protocol::{handshake::Handshake, TimeStamp}; use crate::util::get_packet; use crate::{Connection, Connection...
use syntax::ast; use syntax::ast::Mutability::MutImmutable; use syntax::codemap::Span; use syntax::ext::base::ExtCtxt; use syntax::ext::build::AstBuilder; use syntax::ext::deriving::generic; use syntax::ext::deriving::generic::ty; use syntax::parse::token; use syntax::ptr::P; pub fn element(ecx: &mut ExtCtxt, span: ...
//! The memory module contains the memory structure and implementation to read/write the memory. use crate::bus::DRAM_BASE; use crate::cpu::{BYTE, DOUBLEWORD, HALFWORD, WORD}; use crate::exception::Exception; /// Default memory size (1GiB). pub const DRAM_SIZE: u64 = 1024 * 1024 * 1024; /// The memory used by the em...
use std::{ net::IpAddr, path::PathBuf, sync::{mpsc::RecvError, Arc}, time::Duration, }; use anyhow::anyhow; use notify::{watcher, DebouncedEvent, Watcher}; use serde::{Deserialize, Serialize}; use tokio::sync::mpsc::{self, UnboundedReceiver, UnboundedSender}; use tracing::error; use trust_dns_resolver:...
use super::{ super::{ResponseError, ResponseErrorKind}, ResolveOptions, ResolveResult, Resolver, }; use std::{collections::VecDeque, mem::take, sync::Arc}; #[cfg(feature = "async")] use futures::future::BoxFuture; /// 域名解析串 /// /// 将多个域名解析器串联起来,遍历并找寻第一个可用的解析结果 #[derive(Debug, Clone)] pub struct ChainedResolve...
use crate::{asset_protocols::image::ImageAsset, math::*}; use core::{ assets::{ asset::{Asset, AssetId}, protocol::{AssetLoadResult, AssetProtocol, AssetVariant, Meta}, }, Ignite, Scalar, }; use serde::{Deserialize, Serialize}; use std::{ collections::{hash_map::Keys, HashMap, HashSet}, ...
// Copyright (c) 2018-2021 The MobileCoin Foundation use consensus_enclave::ConsensusServiceSgxEnclave; use consensus_enclave_api::WellFormedTxContext; use consensus_service::{ tx_manager::UntrustedInterfaces, validators::DefaultTxManagerUntrustedInterfaces, }; use criterion::{criterion_group, criterion_main, Crit...
use std::{fmt, str}; use super::common_header; use crate::http::header; common_header! { /// `Cache-Control` header, defined /// in [RFC 7234 §5.2](https://datatracker.ietf.org/doc/html/rfc7234#section-5.2). /// /// The `Cache-Control` header field is used to specify directives for /// caches alon...
use std::convert::TryFrom; use std::fmt::{self, Display}; use std::fs::File; use std::io::{BufReader, Read, Seek, Write}; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use crate::error::{Error, Result}; const MODEL_VERSION: u32 = 0; const MAGIC: [u8; 4] = [b'F', b'i', b'F', b'u']; #[derive(Clone, Cop...
use serde::Deserialize; use std::path::{Path, PathBuf}; use std::fs::File; use std::io::{self, Read}; use std::ffi::OsString; use std::collections::HashMap; use std::error; use std::fmt; use std::env::split_paths; #[derive(Debug)] pub enum Error { IoError(io::Error), ParseError(toml::de::Error) } impl fmt::Display ...