text
stringlengths
3.09k
13.9k
use bevy::{ app::AppExit, openxr::{camera::XrPawn, OCULUS_TOUCH_PROFILE}, prelude::*, utils::Duration, xr::{ XrActionDescriptor, XrActionSet, XrActionType, XrHandType, XrProfileDescriptor, XrReferenceSpaceType, XrSessionMode, XrSystem, XrTrackingSource, XrVibrationEvent, XrVi...
use winapi::um::profileapi::{QueryPerformanceCounter, QueryPerformanceFrequency}; use winapi::um::winnt::LARGE_INTEGER; const TICKS_PER_SECOND: u64 = 10000000; //TODO: mark everything as unsafe pub struct StepTimer { qpc_frequency: LARGE_INTEGER, qpc_last_time: LARGE_INTEGER, qpc_max_delta: u64, elap...
use std::env; use std::fs as std_fs; use std::os::unix::fs::PermissionsExt; use color_eyre::eyre::{bail, Result}; use guess_host_triple::guess_host_triple; use reqwest::Client; use serde::{Deserialize, Serialize}; use tokio::{fs, io::AsyncWriteExt}; use crate::shell::Shell; use crate::utils::{build_reqwest_client, cu...
use super::state::State; use crate::edit::sidebar::dragging::state::State as DragState; use dominator::clone; use shared::{ api::endpoints::{self, ApiEndpoint}, domain::{jig::module::*, jig::*, CreateResponse}, error::EmptyError, }; use std::convert::TryInto; use std::rc::Rc; use utils::prelude::*; pub fn ...
use anyhow::{Context, Result}; use select::document::Document; use select::predicate::{And, Attr, Name, Not}; use serde::{Serialize, Deserialize}; use url::Url; #[allow(dead_code, unused_imports)] #[path = "../../target/flatbuffers/playthrough_generated.rs"] mod playthrough_generated; pub use playthrough_generated::ds...
mod test; use std::fs::File; use std::io::{BufReader, BufRead}; use std::fmt; use std::collections::{HashSet, HashMap}; use tokio::time::delay_queue::Key; use std::iter::FromIterator; use tokio::stream::StreamExt; use std::collections::hash_map::Iter; fn read_lines_from_file(filename: &str) -> std::io::Result<Vec<Str...
use totsu::prelude::*; use totsu::operator::MatBuild; use totsu::problem::ProbLP; use rand::prelude::*; use rand_xoshiro::rand_core::SeedableRng; use rand_xoshiro::Xoshiro256StarStar; use std::io::prelude::*; use std::io::BufWriter; use std::fs::File; //extern crate intel_mkl_src; type AMatBuild = MatBuild<FloatGene...
use proc_macro2::TokenStream; use quote::quote; use crate::attrs::*; use crate::utils::*; type Variants = syn::punctuated::Punctuated<syn::Variant, syn::Token![,]>; /// Defines and implements `config_type` enum. pub fn define_config_type_on_enum(em: &syn::ItemEnum) -> syn::Result<TokenStream> { let syn::ItemEnum...
use { opencv::{ core::{self, Scalar, Point, Rect}, objdetect, imgproc, types, prelude::*, videoio, highgui }, enigo::{self, Enigo}, crate::utils::{enhance_frame}, crate::timm_barth }; // TODO : coll of rects fn move_eye_center (point: &Point, ...
use std::fmt::{Debug, Display}; use nalgebra::allocator::Allocator; use nalgebra::allocator::Reallocator; use nalgebra::*; pub struct GaussNewtonParams<N: RealField> { pub min_iterations: usize, pub max_iterations: usize, pub max_absolute_change: N, pub max_total_error: N, pub max_error_improvemen...
//! Defines present node. use crate::{ chain::QueueId, command::{CommandPool, CommandBuffer, ExecutableState, PendingState, MultiShot, SimultaneousUse, Family, Submission, Submit}, factory::Factory, frame::Frames, wsi::{Surface, Target}, node::{AnyNodeDesc, AnyNode, NodeImage, NodeBuffer, NodeB...
// Copyright 2021 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. //! Implements a stub PCI device. This can be used to put a device on the PCI bus that will //! show up in PCI device enumeration with the configured p...
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; #[derive(Debug)] enum IpAddrKind { V4, V6, } fn main() { ip_addr_struct(); ip_addr_enum(); ip_addr_enum_different_types(); ip_addr_standard_library(); variety_of_types(); option_enum(); } fn ip_addr_struct() { #[derive(Debug)] struc...
//! Mnemonic wrapper use std::fmt; use zeroize::Zeroize; use bip39::{Language, MnemonicType, Seed}; use secstr::SecUtf8; use serde::de::{self, Deserializer}; use serde::{Deserialize, Serialize, Serializer}; use client_common::{ErrorKind, Result, ResultExt}; const MNEMONIC_LANGUAGE: Language = Language::English; ///...
use crate::{ commands::Data, servers::{send_capabilities, state::Connection}, }; use erooster_core::{ backend::{database::DB, storage::Storage}, config::Config, line_codec::LinesCodec, LINE_LIMIT, }; use futures::{channel::mpsc, SinkExt, StreamExt}; use std::{ fs, io::{self, BufReader}, ...
use super::{ header::BlockHeader, header_slice_status_watch::HeaderSliceStatusWatch, header_slice_verifier::HeaderSliceVerifier, header_slices, header_slices::{HeaderSlice, HeaderSliceStatus, HeaderSlices}, }; use crate::{models::*, sentry::chain_config::ChainConfig}; use parking_lot::{RwLock, RwLoc...
#![allow(dead_code)] use crate::{components::*, ecs::prelude::*}; use smallvec::SmallVec; use std::collections::HashMap; pub fn build(_: &mut World) -> Vec<Box<dyn Schedulable>> { let missing_previous_parent_system = SystemBuilder::<()>::new("MissingPreviousParentSystem") // Entities with missing `Previous...
use std::collections::HashMap; use crate::blog::{FullPost, MicroPost}; use crate::comments::Commentary; use crate::identity::Identity; use crate::video::VideoMetadata; use crate::IPLDLink; use serde::{Deserialize, Serialize}; use cid::Cid; /// Content feed in chronological order. /// Direct pin. #[derive(Serialize,...
use std::io; use ui::{ backend::Backend, events::{EventIterator, KeyEvent}, style::{Color, Stylize}, widgets::{self, List, Text}, Prompt, Validation, Widget, }; use super::{Choice, Transform}; use crate::{Answer, Answers, ListItem}; pub use builder::RawSelectBuilder; mod builder; #[cfg(test)] m...
pub use super::gateway::Credentials; use super::gateway::Gateway; use super::socket::Socket; pub use super::socket::VoiceFrameSender; use super::{gateway, socket, Error}; use async_fuse::Fuse; use discord_types::voice::{Event as GatewayEvent, Ready}; use futures::channel::mpsc; use futures::SinkExt; use log::{debug, wa...
// NOTE: Modified implementation of anchor's parser because anchor's impl has a few issues use crate::{db, AppState, Error}; use anchor_client::anchor_lang::Event; use futures::TryFutureExt; use std::time::SystemTime; use tracing::warn; use zo_abi::events; #[tracing::instrument(skip_all, level = "error")] pub async f...
use crate::pipes::{ PipeReader, PipeWriter, stdin, stdout, stderr, }; use super::{ builtins, eval, exceptions::Exception, foreign::ForeignFn, modules, scope::Scope, string::RipString, syntax::source::SourceFile, table::Table, value::Value, }; use futures::exec...
#![allow(clippy::use_self)] use crate::args::Args; use crate::errors::*; use crate::git::{git_check_version, git_version, GitConfigBuilder}; use std::str::FromStr; use strum_macros::{EnumString, ToString}; pub const DEFAULT_LIST_FORMAT: &str = "%C(yellow)%h%C(reset) [%(smash:source)] %s %C(cyan)<%an>%C(reset) %C...
// This file is part of Substrate. // Copyright (C) 2019-2021 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 quoted_string; use data::Input; use error::ComponentCreationError; use internals::bind::encoded_word::{EncodedWordEncoding, WriterWrapper}; use internals::bind::quoted_string::{InternationalizedMailQsSpec, MailQsSpec}; use internals::encoder::{EncodableInHeader, EncodingWriter}; use internals::error::{EncodingErro...
use core::convert::TryInto; use crate::traits::aligned::{A4, Aligned}; use crate::{ peripherals::hashcrypt::Hashcrypt, traits::{ cipher::{block::Block, BlockCipher}, digest::generic_array::{GenericArray, typenum::{U1, U16, U24, U32}}, }, typestates::init_state::Enabled, }; // intenti...
use std::collections::HashMap; use std::sync::{Arc, Mutex}; use anyhow::Error; use async_std::net::{TcpListener, TcpStream}; use async_std::task; use async_tungstenite::tungstenite::Message as WsMessage; use clap::Parser; use futures::channel::mpsc; use futures::prelude::*; use gst::glib::Type; use gst::prelude::*; u...
#![feature( slice_as_chunks, step_trait, step_trait_ext, cell_update, )] use std::sync::{Mutex, Arc}; use std::sync::atomic::{AtomicBool, Ordering}; use image::{ImageBuffer, Pixel}; use genawaiter::stack::let_gen_using; use genawaiter::GeneratorState; macro_rules! get { ($co:expr, $addr:expr) => {...
// Copyright 2020. 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...
#[macro_use] extern crate lazy_static; mod constants; mod explorer; // explore directories mod create; // create subcommand mod interpreter; // interpret py files use std::option::Option::{Some, None}; use std::env::{args, Args}; use std::result::Result; use std::fs; use std::path::{Path, PathBuf}; use std::process:...
/// Top level type. Is returned by `parse`. use super::token; use super::super::storage::SqlType; use std::collections::HashMap; #[derive(Debug, Clone, PartialEq)] pub enum Query { Dummy, // For Compiling DefStmt(DefStmt), ManipulationStmt(ManipulationStmt) } /// All Data Definition Statements #[derive(Deb...
type Error = Box<dyn std::error::Error>; fn main() { let input = "389547612"; let nums = read(input).unwrap(); assert_eq!("45286397", collect_label(play(nums, 100).unwrap()).unwrap()); assert_eq!(836763710, p2(input).unwrap()); println!("All done"); } fn p2(input: &str) -> Result<usize, Error> { ...
use crate::{config::ConfigManager, dmlive::DMLMessage, ipcmanager::DMLStream}; use futures::pin_mut; use log::info; use reqwest::Client; use std::{ collections::{HashSet, LinkedList}, convert::TryInto, sync::Arc, }; use tokio::{io::AsyncWriteExt, sync::mpsc::Sender}; pub struct HLS { url: String, i...
#![feature(unboxed_closures)] #![feature(fn_traits)] use std::any::Any; use std::collections::HashMap; use std::marker::PhantomData; #[macro_use] extern crate peaches_macros; pub use peaches_macros::component; pub struct State { map: HashMap<i32, Box<dyn Any>>, pos: i32, is_first_mount: bool, } impl St...
//! Read the header from CBCL file and decode into a struct of useful information about //! the file, to allow efficient tile extraction later. use byteorder::{LittleEndian, ReadBytesExt}; use std::{ fs::File, path::{Path, PathBuf}, }; #[derive(Debug, PartialEq)] /// Represents the header information from a C...
//! Definition of the LaTeX renderer. Subfunctions are implemented in other files. use super::LatexTarget; use crate::preamble::*; #[macro_use] mod blobs; mod gallery; mod html; mod iref; mod list; mod simple; mod table; mod template; use super::LatexArgs; /// Recursively renders a syntax tree to latex. pub struct ...
extern crate cc; extern crate walkdir; use std::env; use std::fs; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use walkdir::{DirEntry, WalkDir}; const ENV_LLVM_PREFIX: &'static str = "LLVM_PREFIX"; const ENV_LLVM_BUILD_STATIC: &'static str = "LLVM_BUILD_STATIC"; const ENV_LLVM_LINK_LLVM_DYLIB: ...
use std::io::SeekFrom; use pyo3::ffi::Py_ssize_t; use pyo3::PyObject; use pyo3::{IntoPy, PyResult, Python, ToPyObject}; use std::os::raw::c_char; fn to_other_io_error(message: String) -> std::io::Error { std::io::Error::new(std::io::ErrorKind::Other, message) } fn seek_file_object(file_object: &PyObject, pos: Se...
//! Use a color picker as an input element for picking colors. //! //! *This API requires the following crate features to be activated: `color_picker`* use std::hash::Hash; use color_picker::ColorBarDragged; use iced_native::{ button, column, event, overlay, row, text_input, Clipboard, Color, Element, Event, Layou...
extern crate flame; use crate::message_box; use crate::navigator::{self, Page}; use crate::screen::*; use crate::view; use crate::view::View; use crate::Key; use crate::read_buffer::Cursor; use std::cell::RefCell; use std::rc::Rc; use std::{thread, time}; use termion::event::Key as TermKey; struct StatusView { x:...
// #![allow(clippy::all)] // #![allow(dead_code)] // #![allow(unused_imports)] // #![allow(unused_variables)] // #![allow(unused_assignments)] #![allow(mutable_borrow_reservation_conflict)] #[macro_use] extern crate serde_derive; use chrono::prelude::*; use clap::Parser; use rayon::prelude::*; use time::PreciseTime; ...
use proc_macro2::Span; use quote::{quote,ToTokens}; use syn::{Expr, Ident, LitStr, parse::Parse, parse::ParseStream}; use tamasfe_macro_utils::attr::{AttrParam, AttrParams}; #[derive(Debug, Clone)] pub struct Tag { pub id: Option<LitStr>, pub name: Expr, pub description: Option<Expr>, pub display_name:...
// 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 writ...
use regex::Regex; #[derive(Debug)] pub enum BlockTypes { Paragraph, Blockquote, Header(u32), OrderedList, UnorderedList, Code, HorizontalRule, Raw // Generic // Table - not implemented // InlineHTML - not implemented } #[derive(Debug)] pub struct Block { pub text: String, pub block_type: Bl...
use std::collections::{BTreeSet, HashMap}; use std::rc::Rc; use std::cell::RefCell; use std::fs::File; use std::io::Write; use std::str; use syscall; use syscall::scheme::SchemeMut; use syscall::data::Packet; use syscall::flag::*; use syscall::error::*; use rand::random; use buffer::AudioBuffer; struct Endpoint { ...
//! # Server Agent for the file sharing platform //! This server application aims to handle incoming connections from the server agent. //! It needs to serve requested files when needed, and provide information back to the server. //! It has no direct connection to the user - but instead reads off a database that the c...
use crate::connection::GameConnection; use anyhow::{Error, Result}; use crate::bitstream::BitStream; #[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum NetPacketType { DataPacket = 0, PingPacket = 1, AckPacket = 2, InvalidPacketType = 3, } pub struct DNet { last_seq_recvd_at_send: [u32; 32], ...
// This file is part of ctap, a Rust implementation of the FIDO2 protocol. // Copyright (c) <NAME> <<EMAIL>> // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This fi...
use super::CliCommand; use anyhow::Result; use clap::{App, AppSettings, Arg, ArgMatches, SubCommand}; use repo_cli::prelude::*; use std::{path::PathBuf, str::FromStr}; pub struct ConfigCommand { name: Option<String>, value: Option<String>, local: bool, global: bool, remove: bool, edit: bool, ...
use std::ops::Index; #[derive(Debug, Copy, Clone)] pub struct Bucket<T> { /// source for fill rate, source is infinite if not specified source: Option<T>, /// fill rate, fractions per nanosecond rate: usize, /// capacity, in fractions cap: usize, /// currently contained value value: usi...
/// Viewing and analyzing assets use rocket::State; use rocket::response::Redirect; use rocket_dyn_templates::Template; use rocket::form::{Form, FromForm}; use super::rocket_uri_macro_login; use finql_data::{Asset, AssetHandler, QuoteHandler}; use qualinvest_core::accounts::AccountHandler; use crate::user::UserCooki...
use futures::sync::mpsc::{channel, Receiver, Sender}; use hyper; use hyper::Server; use std::collections::BTreeMap; use std::error::Error; use std::fmt; use std::net::{Ipv4Addr, SocketAddrV4}; use std::sync::RwLock; use graph::data::schema::Schema; use graph::prelude::{GraphQLServer as GraphQLServerTrait, *}; use gra...
#![allow(dead_code)] use crate::Reader; type HuffmanResult<T> = Result<T, HuffmanError>; pub enum HuffmanError { IoError(std::io::Error), CodeLenOutOfBounds, BadTerm, InvalidHuffHeader, InvalidCDICHeader, InvalidDictionaryIndex, } impl From<std::io::Error> for HuffmanError { fn from(e: st...
//! Status datastructures. use crate::config::DataPipe; #[cfg(feature = "micro-fmt")] use ufmt::{uDebug, uWrite, Formatter}; /// Wrapper for the status value returned from the device. /// Provides convenience methods and debug implemantions. #[derive(Copy, Clone, Eq, PartialEq)] pub struct Status(u8); /// Wrapper aro...
// Copyright 2017 TiKV Project Authors. Licensed under Apache-2.0. #[cfg(target_os = "linux")] mod cgroup; pub mod cpu_time; pub mod disk; pub mod inspector; pub mod thread; // re-export some traits for ease of use use std::sync::atomic::{AtomicU64, Ordering}; use fail::fail_point; #[cfg(target_os = "linux")] use la...
use std::collections::HashMap; use crate::debugger_command::DebuggerCommand; use crate::dwarf_data::{DwarfData, Error as DwarfError}; use crate::inferior::Inferior; use rustyline::error::ReadlineError; use rustyline::Editor; pub struct Debugger { target: String, history_path: String, readline: Editor<()>, ...
// use web_sys::console::log_1; use std::f64::INFINITY; use super::{AttributeManager, Object}; use crate::audio::AudioPlayer; use crate::game::{Asset, Direction, StatusManager, Position, World}; use crate::game::status_manager::Status; use crate::utils::check_collision; use crate::game::constants::{ PROJECTILE_SIZE...
use super::palette::PaletteColor; /// The GameBoyColor-specific GPU register addresses. pub mod regs { pub const VRAM_BANK: usize = 0xFF4F; /// Register defining the index of the palette to read/write from 'BGP_DATA'. pub const BGP_INDEX: usize = 0xFF68; /// Adress from where the background palette of ...
use crypto_market_type::MarketType; use crypto_msg_type::MessageType; use crate::{Order, OrderBookMsg, TradeMsg, TradeSide}; use serde::{Deserialize, Serialize}; use serde_json::Value; use simple_error::SimpleError; use std::collections::HashMap; const EXCHANGE_NAME: &str = "bitstamp"; // see "Live ticker" at https...
use std::ops::Index; use std::ops::IndexMut; use std::ops::{ Mul, MulAssign, }; use crate::Vec2; use crate::Vec3; use serde::{ Deserialize, Serialize, }; #[derive(Copy, Clone, PartialEq, PartialOrd, Debug, Serialize, Deserialize)] pub struct Mat3 { pub x_column: Vec3, pub y_column: Vec3, pub z_column: Vec3, }...
use itertools::{repeat_n, EitherOrBoth, Itertools}; use std::{ cell::RefCell, collections::HashSet, convert::TryFrom, fmt, hash::{Hash, Hasher}, }; use crate::hashset; #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum Val { T, // 1 F, // 0 S, // Simplified } #[derive(Debug, ...
use std::collections::HashMap; use std::io::{stdin, Read}; use std::str::FromStr; fn power_level(x: u32, y: u32, gsn: i32) -> i32 { let rack_id = (x as i32) + 10; let mut power_level = rack_id * (y as i32); power_level += gsn; power_level *= rack_id; power_level = (power_level % 1000) / 100; po...
use std::rc::Rc; use assassin::quote::Quote; extern crate greenback; use greenback::Greenback as Money; #[derive(Clone)] pub struct Order { symbol: Rc<str>, name: Rc<str>, buy: bool, open: bool, quantity: i32, limit: Money, strike_price: Money, // date: DateTime<Utc>, // TODO: flesh t...
use std::cell::Cell; use std::fmt::{self, Debug, Formatter}; use std::io; use rand::{Rng, StdRng}; pub struct Distribution { limit: u32, // TODO: Figure out how to get rid of interior mutability rng: Cell<StdRng>, // TODO: Decide if there should be a limit to the size of the table, so we don't use a m...
use std::io::{BufferedReader,File,MemReader}; use chart::Chart; use indicators::Indicator; use range_bound_variable::RangeBoundVariables; use parser_utils; use utilities; // ===== CHARTS ==================================================================================== fn parse_indicator(lua_chart_name: &str, ...
// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/vhdirk/gir-files.git) // DO NOT EDIT use crate::SeekWhence; use glib::object::IsA; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "GMimeStream")] pub struct Stream(Object<ffi::GMimeStr...
//! Mixed ILP backend pub mod trans; use fxhash::FxHashMap as HashMap; pub(crate) use good_lp::{ variable, Constraint, Expression, ProblemVariables, ResolutionError, Solution, Solver, SolverModel, Variable, VariableDefinition, }; use log::debug; use std::fmt::{self, Debug, Formatter}; /// An integer linear p...
extern crate elapsed; extern crate num_cpus; extern crate rustraylib; use elapsed::measure_time; use std::sync::Arc; use rustraylib::Camera; use rustraylib::ColorVector; use rustraylib::PosVector; use rustraylib::RenderData; use rustraylib::Renderer; use rustraylib::Scene; use rustraylib::nffparsing; use rustraylib:...
use futures::executor::{self, Notify, Spawn}; use futures::prelude::*; use js_sys::{Function, Promise}; use std::cell::{Cell, RefCell}; use std::rc::Rc; use std::sync::Arc; use wasm_bindgen::prelude::*; /// Converts a Rust `Future` into a JavaScript `Promise`. /// /// This function will take any future in Rust and sch...
use webcore::value::Reference; use webcore::try_from::TryInto; use webapi::event_target::{IEventTarget, EventTarget}; use webapi::node::{INode, Node}; use webapi::element::{IElement, Element}; use webapi::html_element::{IHtmlElement, HtmlElement}; /// An enum which determines whether /// [SlotElement::assigned_nodes](...
use indoc::indoc; mod common; use common::{build_image, connect, tag_for_test, PHP_VERSIONS}; #[test] fn test_gd_features() { // Test to assert that these prerequisite GD features are available: // 1. JPEG support // 2. FreeType support // 3. PNG support let dockerfile = indoc!( r#"ARG PH...
use nalgebra_glm as glm; use vk_tracer::{ prelude::*, shaderc::{OptimizationLevel, ShaderKind}, utils::{FpsLimiter, ShaderCompiler}, RenderPlanHandle, RenderTargetHandle, RendererHandle, SwapchainHandle, }; use winit::{ event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent}, ev...
use std::collections::HashMap; use std::io::Read; use std::process; use hyper::header::Header; use regex::Regex; use reqwest::header::{Cookie, Location, SetCookie}; use reqwest::{Client, RedirectPolicy}; /// Log in to Pinboard and get a login cookie that can be used on subsequent /// requests. /// fn get_login_cooki...
//! SemanticEngine implementation for [the racer library](https://github.com/phildawes/racer) //! use engine::{SemanticEngine, Definition, Context, CursorPosition, Completion}; use racer::core::{Session, FileCache}; use racer::scopes::{coords_to_point, point_to_coords}; use std::path::Path; use std::sync::Mutex; pu...
extern crate rustc_serialize; use rustc_serialize::json; use std::fmt; use std::env; use std::fs::File; use std::io::Read; use std::thread; use std::sync::{Mutex, Arc}; use std::process::Command; extern crate ansi_term; use ansi_term::Colour::{Red, Green, Yellow, Blue, Purple, Cyan}; struct WorkConf { project:...
// Copyright 2017-2019 <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 wr...
// //! Copyright 2020 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...
pub(crate) const BASE: u32 = 65521; const NMAX: usize = 5552; const CHUNK_SIZE: usize = 16; #[derive(Copy, Clone, Debug)] pub struct State { state: (u32, u32), } impl State { pub fn new(initial: u32) -> Self { Self { state: (initial & 0xffff, initial >> 16), } } pub fn fin...
use { Align, Backend, Color, Colorable, FontSize, Frameable, FramedRectangle, IndexSlot, Positionable, Range, Rect, Scalar, Sizeable, TextEdit, Widget, }; use event; use input; use widget; /// A widget for displaying and mutating a small, one-line field of te...
use crate::irc::tags::ParsedTag; use crate::messages::tags::HasTags; use crate::{irc::*, MaybeOwned, MaybeOwnedIndex, Validator}; use pipe_trait::Pipe; use std::time::Duration; use twitchchat_macros::irc_tags; use wrap_result::WrapOk; /// The parameters for a room being in follower-only mode #[derive(Debug, Copy, Clon...
#![allow(non_camel_case_types)] extern crate alloc; /// [struct GNU::GIOChannel](https://github.com/GNOME/glib/blob/master/glib/giochannel.h) /// /// Based on a comment in [#RFC-1449 Add language support for bitfields](https://github.com/rust-lang/rfcs/pull/1449#issuecomment-318482265). /// /// Layout (only the flags...
use std::io::{Read, Write}; use picvudb::data::{Date, Dimensions, Duration, Location, LocationSource, Orientation}; use crate::analyse::google::GoogleCache; use crate::analyse::tz::ExplicitTimezone; use crate::analyse::warning::{Warning, WarningKind}; #[derive(Debug)] pub struct Thumbnail { pub filename: String, ...
use diesel::prelude::*; use diesel::result::Error; use rocket_contrib::{Json, Value, Template}; use rocket::http::{Header, Status, RawStr}; use rocket::request::{FromFormValue}; use diesel::helper_types::Filter; use models::*; use guards::*; use db::DbConn; #[derive(Debug)] pub enum ParentFilter { Id...
use colored::*; use prettytable::format; use prettytable::{Cell, Row, Table}; use std::env::current_dir; use std::fs::create_dir_all; use std::path::PathBuf; use anyhow::{Context, Result}; use clap::ArgMatches; use tempdir::TempDir; use crate::cfg::{load_local_cfg, LocalSetupCfg, SetupCfg, SetupsCfg}; use crate::cli...
use kiss3d::camera::ArcBall; use kiss3d::event::{Action, WindowEvent}; use kiss3d::light::Light; use kiss3d::text::Font; use kiss3d::window::Window; use nalgebra::{Point2, Point3}; use rand::distributions::Uniform; use rand::Rng; use rstar::{root, RStarInsertionStrategy, RTree, RTreeNode, RTreeParams, AABB}; mod butto...
use serde::Serialize; use std::collections::HashMap; use std::str::FromStr; #[derive(Debug, PartialEq, Clone, Serialize)] pub enum Expression { LetBinding { id: Identifier, value: Box<Expression>, body: Box<Expression>, }, Ternary { condition: Box<Expression>, true_b...
use std::{ collections::HashMap, net::{IpAddr, Ipv4Addr}, }; use ipnetwork::IpNetwork; use ipfs_bitswap::Block; use rand::RngCore; use cid::Cid; use multihash::{Code, MultihashDigest}; use serde::{Deserialize, Serialize}; use serde_with::{serde_as, DisplayFromStr}; /// Get the IP address of this containe...
use std::{iter::Peekable, str}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] enum Quotes { Single, Double, None, } /// Serves as a buffer for storing a string until that string can be terminated. /// /// This example comes from the shell's REPL, which ensures that the user's input /// will only be s...
// Copyright (c) 2016-2017 <NAME> <<EMAIL>> // // 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...
#![allow(clippy::print_stderr)] // test framework #![allow(clippy::print_stdout)] // test framework use std::collections::HashSet; /// This helper function issues an HTTP request to the Prometheus-exposition /// format metrics endpoint, validates that it completes successfully and /// returns the response body. pub a...
// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0. //! Handles simple SQL query executors locally. //! //! Most TiDB read queries are processed by Coprocessor instead of KV interface. //! By doing so, the CPU of TiKV nodes can be utilized for computing and the //! amount of data to transfer can be redu...
//- // Copyright 2017 <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 t...
use futures::sync::oneshot; use futures::Future; use net2::TcpStreamExt; use slab::Slab; use std::rc::Rc; use std::{net, time}; use tokio::executor::current_thread; use tokio_reactor::Handle; use tokio_tcp::TcpStream; #[cfg(any(feature = "tls", feature = "alpn"))] use futures::future; #[cfg(feature = "tls")] use nati...
use crate::{app, config, eww_state::*, ipc_server, script_var_handler, util, EwwPaths}; use anyhow::*; use std::{collections::HashMap, os::unix::io::AsRawFd, path::Path}; use tokio::sync::mpsc::*; pub fn initialize_server(paths: EwwPaths) -> Result<()> { do_detach(&paths.get_log_file())?; println!( r#...
use crate::utils; use std::{fmt, time}; /// A duration with second precision. /// /// Stored field is in seconds. #[derive(Debug, Clone, Default, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Duration(u64); impl Duration { /// Construct a duration from the given number of seconds. pub fn seconds(seconds: ...
use super::Lexer; use crate::{ data::{CompileResult, Locatable, Token}, ErrorHandler, Location, }; use crate::{Files, Source}; use std::path::{Path, PathBuf}; use std::rc::Rc; // TODO: this API is absolutely terrible, there's _no_ encapsulation pub(super) struct FileProcessor { /// The preprocessor collabo...
// Copyright 2018 The Grin Developers // // 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...
#![recursion_limit="256"] #![feature(rustc_private)] mod components; mod intent; mod search_regex; mod structs; use anyhow::Error; use serde_json::json; use std::string::ToString; use yew::format::{Json}; use yew::services::fetch::{FetchService, FetchTask, Request, Response}; use yew::{html, Component, ComponentLink,...
use pin_utils::unsafe_pinned; use std::pin::Pin; use std::task::{Context, Poll}; use std::time::Duration; use futures::prelude::*; use crate::timer::delay; use crate::{Delay, Instant, TimerHandle}; /// A stream representing notifications at fixed interval /// /// Intervals are created through the `Interval::new` or ...
use self::preserver::idents_to_preserve; use super::compute_char_freq::CharFreqInfo; use crate::analyzer::analyze; use crate::analyzer::ProgramData; use crate::option::MangleOptions; use crate::util::base54::base54; use fxhash::FxHashMap; use fxhash::FxHashSet; use swc_atoms::JsWord; use swc_common::SyntaxContext; use ...