text
stringlengths
3.09k
13.9k
use std::rc::Rc; use wasm_bindgen::prelude::*; use web_sys::{Element as HTMLElement, Text as HTMLText}; use super::{TEXT_ELEMENT, FIBER_FUNCTIONAL}; pub enum Node { Text(HTMLText), Element(HTMLElement), } pub struct Element { element_type: String, component_function: Option<Rc<js_sys::Function>>, ...
use crate::rapid::{ self, parsing::parse_repos_from_file, rapid_store::RapidStore, types::{Repo, Sdp, SdpPackage}, }; use super::MetadataQueryError; pub async fn query_metadata( rapid_store: &RapidStore, fullname: &str, ) -> Result<Option<(Repo, Sdp)>, MetadataQueryError> { let repo_tag = ...
use assert_cmd::{assert::OutputAssertExt, prelude::CommandCargoExt}; use goldenfile::Mint; use pretty_assertions::assert_eq; use std::{ collections::BTreeMap, ffi::OsStr, fs::File, io, path::{Path, PathBuf}, process::{Command, Output}, str, }; use std::{fs, io::Write}; const GOLDENFILES: &s...
use std::ops::Deref; use syn::{self, Member, Index, punctuated::Punctuated}; use proc_macro::Span; use proc_macro2::TokenStream as TokenStream2; use derived::Derived; use spanned::Spanned; #[derive(Debug, Copy, Clone)] pub enum FieldParent<'p> { Variant(Derived<'p, syn::Variant>), Struct(Derived<'p, syn::Dat...
use crate::executor::Executor; use crate::schema::{Schema, Type, TypeKind}; use futures::future; use graphql_parser::schema::{Definition, Document, SchemaDefinition}; use graphql_parser::Pos; use serde_json::{Error as JsonError, Value}; use std::collections::HashMap; use std::fmt; #[derive(Debug, Error)] pub enum Gate...
use std::sync::Arc; use std::sync::Mutex; use std::path::PathBuf; use async_trait::async_trait; use tantivy::Index; use tantivy::space_usage::SearcherSpaceUsage; use tantivy::IndexWriter; use tantivy::merge_policy::*; use tantivy::{Document}; use serde::{Deserialize, Serialize}; use crate::Result; /// Defines the ...
//! Game state handling module. use rltk::{GameState, Rltk}; use specs::prelude::*; use super::{ player_handle_input, ui_controller, DamageSystem, DialogInterface, DialogResult, FOVSystem, ItemCollectionSystem, ItemDropSystem, Map, MapDexSystem, MeleeCombatSystem, MonsterAI, Position, PotionDrinkSystem, R...
use super::{AreaStartingPosition, BuilderChain, BuilderMap, CullUnreachable, DLABuilder, DistantExit, DrunkardsWalkBuilder, MetaMapBuilder, TileType, VoronoiSpawning, XStart, YStart, PrefabBuilder, RoomBasedSpawner, BspDungeonBuilder, RoomDrawer, RoomExploder, CellularAutomataBuilder, RoomSort, RoomSort...
#![feature(box_syntax, box_patterns, splice, specialization)] #![cfg_attr(feature="clippy", feature(plugin))] #![cfg_attr(feature="clippy", plugin(clippy))] // The atom macro generates huge u64 literals #![cfg_attr(feature="clippy", allow(unreadable_literal))] extern crate rayon; extern crate rand; extern crate llvm_s...
//! Dumps the contents of the input archive in a debug format. //! //! Demonstrates //! //! * iteration through all fundamental types //! * accessing of fields and following of references //! //! LICENSE //! //! The code in this example file is released into the Public Domain. use osmflat::{iter_tags, FileResourceStor...
use super::types::{wasm_ref_t, wasm_valkind_enum}; use std::convert::{TryFrom, TryInto}; use std::ptr::NonNull; use wasmer::Val; #[allow(non_camel_case_types)] pub type wasm_valkind_t = u8; #[allow(non_camel_case_types)] #[derive(Clone, Copy)] pub union wasm_val_inner { pub(crate) int32_t: i32, pub(crate) int...
use diesel::{ deserialize::QueryableByName, dsl::sql, pg::Pg, ExpressionMethods, NullableExpressionMethods, PgTextExpressionMethods, QueryDsl, RunQueryDsl, }; use uuid::Uuid; use crate::{ config::db::postgres::PgPool, dto::task::TaskOutput, error::Result, model::task::{CreateTaskData, SearchTas...
use itertools::Itertools; use serde::{de::DeserializeOwned, Serialize}; use std::fs::{self, File}; use std::io::{self, BufReader, BufWriter, Read, Seek, SeekFrom, Write}; use std::path::Path; use crate::record::{Record, RecordData, RecordId}; pub struct Database<T: Serialize + DeserializeOwned, S: Read + Seek> { ...
extern crate ggez; use ggez::event::{Axis, Button, Keycode, Mod}; use ggez::graphics::{Color, Rect}; use ggez::*; use std::boxed::Box; use std::process; use std::vec::Vec; use actor::*; use bullet::*; use scene::*; use ship::*; pub struct HelloScene { player: Ship, up_pressed: bool, down_pressed: bool, ...
use crate::cart::{CGBType, Cartridge, Controller, GBType}; use crate::mbc; use crate::mbc::MBC; use std::{fs::File, io::Read, path::Path}; pub struct Memory { state: State, work_ram: Vec<u8>, high_ram: [u8; 0x7f], io: [u8; 0x80], work_ram_bank: usize, gb: GBType, } impl Memory { pub fn n...
//! Image elements to be embedded in other controls. use iup_sys; use Element; #[derive(Debug, Copy, Clone)] pub struct InPixels<'a, T: 'static>(pub &'a [&'a [T]]); /// This macro is meant to represent expressively pixels of a image. /// /// It's output should go in the `ImageElement::with` constructor. /// The outpu...
use ash::vk; use crate::core::GsDevice; use crate::buffer::{ GsBuffer, BufferBlock, BufferCopiable }; use crate::buffer::allocator::BufferAllocateInfos; use crate::memory::target::GsMemory; use crate::memory::types::GsMemoryType; use crate::memory::utils::{ MemoryMapStatus, MemoryRange, MemoryMapAlias, MemoryWriteP...
use crate::*; use serde::de::{Deserializer, SeqAccess, Visitor}; use serde::ser::SerializeSeq; use serde::{Deserialize, Serialize, Serializer}; use std::fmt; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct VppJsApiMessageInfo { pub crc: String, } #[derive(Debug, Clone)] pub struct VppJsApiMessage { ...
mod bars; mod display; mod format; mod theme; use clap::arg_enum; use clap::crate_authors; use colored::Color; use display::{Elements, Fail}; use macchina_read::Readouts; use structopt::StructOpt; #[macro_use] extern crate lazy_static; use macchina_read::traits::*; pub const AUTHORS: &str = crate_authors!(); pub co...
//! The stats module contains the stats loop that is performed on stats thread. //! use crossbeam::channel::Receiver; use crossterm::{ cursor, execute, style::{self, Color, PrintStyledContent}, terminal::{Clear, ClearType}, }; use std::fmt; use std::io::{self, Result as IoResult, Stderr, Write}; use std::t...
use super::{ super::{ bitwise::BITWISE_OR, hasher::{LINEAR_HASH, RETURN_STATE}, ExecutionTrace, Operation, Process, }, AuxTableTrace, }; use vm_core::{Felt, FieldElement, ProgramInputs, MIN_TRACE_LEN}; #[test] fn hasher_aux_trace() { // --- single hasher permutation with no stac...
use hlua::{AnyLuaValue, Lua, LuaTable}; use message_io::network::{NetEvent, Network, Transport}; use crate::messages::Message; use crossbeam_channel::{Sender, Receiver, unbounded, RecvTimeoutError}; use std::thread; use std::time::Duration; pub struct Participant<'a> { network: Sender<Message>, //message_...
//! A list of constants used by the RustNAO library. //! Constants are pulled from here: https://saucenao.com/status.html. pub const API_URL: &str = "https://saucenao.com/search.php"; #[derive(Clone)] pub struct Source<'a> { pub index: u32, pub name: &'a str, pub rating_regex: Option<&'a str>, } pub const H_MAGAZ...
use std::ops::{Deref, DerefMut, Range, Add, AddAssign}; use std::borrow::Borrow; use std::mem::{self, MaybeUninit}; use std::fmt; use std::error::Error; use std::path::PathBuf; use std::sync::Arc; use std::hash::{Hash, Hasher, BuildHasher}; use std::collections::{HashMap, hash_map::{Entry, OccupiedEntry}}; use lsp_type...
use indicatif::ProgressBar; use postgres::types::ToSql; use quick_xml::events::Event; use std::{collections::HashMap, error::Error, str}; use crate::db::{write_labels, DbOpt, SqlSerialization}; use crate::parser::Parser; #[derive(Clone, Debug)] pub struct Label { pub id: i32, pub name: String, pub contact...
//! Get virtual memory maps from another process //! //! This crate provides a function—[`get_process_maps`](linux_maps/fn.get_process_maps.html) //! that returns a Vec of [`MapRange`](linux_maps/struct.MapRange.html) structs. //! //! This code works on Linux, macOS, and Windows. Each operating system has a different /...
use std::collections::HashSet; use std::ops::{ Deref, DerefMut }; use futures::future::{BoxFuture, FutureExt}; use iref::{ Iri, IriBuf }; use json::JsonValue; use crate::{ Error, Id, Indexed, Object, ContextMut, context::{ self, Loader }, expansion }; /// Result of the document expansion algorithm. ///...
use std::sync::Arc; use std::path::PathBuf; use serde::{Serialize,Deserialize}; use plumb::{Pipe,PipeExt}; use quick_from::QuickFrom; use hyper::Body; use hyper::body::Buf; use http_mux::{route,mux}; use jsonwebtoken as jwt; use crate::database::Database; use crate::crypto; use crate::{PostLoginRequest, PostLoginResp...
//! Provides a basic abstraction to set video modes and copy pixels to and from the graphics //! controller’s frame buffer. The linear address of the hardware frame buffer is also exposed so //! software can write directly to the video hardware. use crate::status::Status; /// Represents a pixel when doing a Blt. /// ...
/* * Copyright (c) 2019. David "Tiran'Sol" <NAME> * All rights reserved. */ #[allow(non_snake_case)] mod schema; use anyhow; use diesel::pg::PgConnection; use diesel::prelude::*; use crate::types; use schema::mapSolarSystemJumps::dsl::*; use schema::mapSolarSystems::dsl::*; type DB = diesel::pg::Pg; /// Loads a...
#![no_std] #![no_main] #![feature(proc_macro_gen)] #![recursion_limit="1024"] extern crate atsamd21_hal as atsamd21; extern crate samd21_mini as bsp; extern crate cortex_m; extern crate cortex_m_rt as rt; #[macro_use] extern crate cortex_m_rtfm as rtfm; extern crate embedded_hal as hal; extern crate generic_array; #[...
use std::error::Error; use cgmath::Point3; use crate as lox; use crate::{ mesh, prelude::*, cast::NoCast, fat::MiniMesh, ds::SharedVertexMesh, io::IsFormat, map::DenseMap, }; use super::{RawStorage, Reader, Config, is_file_start}; // =======================================================...
use super::{message, Core, Error, InvalidTransaction, NotifyMap}; use crate::consensus::{Block, BlockHash, BlockNumber, Body, LeaderTerm, SignatureList}; use pinxit::{PeerId, Signed}; use prellblock_client_api::Transaction; use std::{ops::Deref, sync::Arc, time::SystemTime}; #[derive(Debug)] pub struct State { pub...
use std::convert::identity; use sdl2::event::Event; use sdl2::keyboard::Scancode; use geom::mesh::Mesh; use geom::solids::unit_cube; use math::Angle::{self, Deg}; use math::mat::Mat4; use math::transform::*; use math::vec::*; use render::*; use render::raster::Fragment; use render::scene::*; use render::shade::Shader...
use bitflags::bitflags; use discrab_codegen::CommandArg; use serde::{Deserialize, Serialize}; use serde_repr::{Deserialize_repr, Serialize_repr}; use crate::{ api::{channel::{attachment::Attachment, embed::Embed}, ApplicationCommandOptionValue}, api::ApplicationCommandType, core::abstraction::traits::Comma...
use advent_2020_common::{Error}; #[derive(Debug)] enum State { Initial, Add, Multiply, } pub fn first(input: &[String]) -> Result<u64, Error> { let mut accum: u64 = 0; for line in input { let line = line.replace(')', " ) ").replace('(', " ( "); let mut stack_values: Vec<(State, u...
//! Internal utility functions, types, and data structures. use crate::intersects::Intersects; use crate::kernels::*; use geo_types::{Coordinate, CoordinateType, Line}; /// Partition a mutable slice in-place so that it contains all elements for /// which `predicate(e)` is `true`, followed by all elements for which //...
use ethereum_types::{H160, U256, U512}; use std::convert::TryInto; use std::str::FromStr; /// converts array of bytes into fixed array of 32 or panic /// Fix of the size must be at compile time! use carefully, this function panics. pub fn into32(src: &[u8]) -> [u8; 32] { src.try_into() .expect(format!("sli...
use super::JuliaDoubleView; use super::MandelbrotDoubleView; use crate::views::prelude::*; use wgpu::{Device, CommandBuffer}; use winit::event::{MouseButton, ElementState}; pub struct DoubleViewManager { left: MandelbrotDoubleView, right: JuliaDoubleView, window_size: WindowSize, cursor_pos: Position, prev_curso...
use byteorder::{ByteOrder, LittleEndian}; use ckb_vm::{ decoder::build_decoder, machine::asm::AsmMachine, CoreMachine, Memory, SupportMachine, RISCV_GENERAL_REGISTER_NUMBER, }; use gdb_remote_protocol::{ Breakpoint, Error, Handler, MemoryRegion, ProcessType, StopReason, ThreadId, VCont, VContFeature, };...
use std::fs::File; use std::io::{BufReader, BufRead}; use std::collections::{HashSet, HashMap}; use super::utils::IterableInput; impl<'a> IterableInput<'a> { fn get_coordinates(&self) -> impl Iterator<Item=(usize, (usize, usize))> { let file = File::open(&self.path()).unwrap(); let mut reader = Bu...
#![feature(link_args)] #[macro_use(napi_module)] extern crate node_api; extern crate futures; extern crate tokio_core; use node_api::{NapiEnv, NapiValue, FromNapiValues, IntoNapiValue}; use node_api::error::*; use node_api::{create_function, get_named_property, set_named_property, create_object, create_...
extern crate proc_macro; extern crate proc_macro2; #[macro_use] extern crate quote; #[macro_use] extern crate syn; use proc_macro2::{Ident, Span, TokenStream}; use syn::{ parse::{Error, Result}, spanned::Spanned, Data, DeriveInput, Field, Fields, Meta, NestedMeta, }; /// Derive [`std::error::Error`][StdError]...
use crate::message::{Message, MessageHeader, Messageable}; use crate::AddressedMessageQueue; use parking_lot::Mutex; use std::collections::VecDeque; use std::sync::Arc; use tokio::io::{AsyncReadExt, AsyncWriteExt, ReadHalf, WriteHalf}; use tokio::net::TcpStream; use tokio::time::{sleep, Duration}; pub struct Connectio...
//! Utilities for handling and tagging generated output. use chrono::{offset::Local, DateTime}; use serde::{ser::SerializeMap, Deserialize, Deserializer, Serialize, Serializer}; /// `OutputManager` manages all things regarding naming and tagging output with settings and /// properties of its data. /// /// Each experi...
//! Hash compiler data structures for storing parsed modules //! //! All rights reserved 2021 (c) The Hash Language authors #![allow(dead_code)] use crate::ast; use dashmap::{lock::RwLock, DashMap, ReadOnlyView}; use hash_utils::counter; use std::{ collections::HashMap, path::{Path, PathBuf}, }; counter! { ...
use crate::tree::Tree; use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; /// A Merkle tree is a binary tree that has two main types of nodes: /// - leafs that contain a value (usually block) and it's hash; /// - nodes that contain a hash of a left and right nodes hashes concatenation; /// ...
use std::collections::HashMap; use syntect::parsing::syntax_definition::{ ContextReference, MatchOperation, MatchPattern, Pattern, SyntaxDefinition, }; use syntect::parsing::{Scope, SyntaxSet, SyntaxSetBuilder}; type SyntaxName = String; /// Used to look up what dependencies a given [SyntaxDefinition] has type Sy...
extern crate regex; use std::env; use regex::Regex; use std::path::{Path, PathBuf}; use std::fs; use std::fs::File; use std::io::Write; use std::process::{Command, Stdio}; #[derive(Debug)] struct PythonVersion { major: u8, minor: u8, patch: Option<String>, } fn main() { if !Path::new("pyenv/.git").ex...
fn input_data() -> Vec<&'static str> { vec![ "..#.#..#####.#.#.#.###.##.....###.##.#..###.####..#####..#....#..#..##..##", "#..######.###...####..#..#####..##..#.#####...##.#.#..#.##..#.#......#.###", ".######.###.####...#.##.##..#..#..#####.....#.#....###..#.##......#.....#.", ".#.....
use std::{cmp, f32}; use image::{GenericImageView, Pixel}; use lazy_static::lazy_static; use std::io::Cursor; use tract_onnx::{self, prelude::{SimplePlan, TypedFact, Tensor, tract_ndarray, Framework, Datum, InferenceFact, InferenceModelExt, tvec, TypedOp}}; // Image patch input: const MODEL_INPUT_CHANNELS: usize = 3; ...
//! Module for working with images and pixels. use crate::math::Vector3; use std::error::Error; use std::fs::File; use std::io::BufWriter; /// A pixel containing RGBA data in floating point format. Values range from 0 /// to 1, where 0 means black, and 1 means max color. For the alpha channel, 0 /// means fully trans...
use crate::acl::{parse_allowed_methods, AllowedMethods}; use crate::config::Config; use hyper::http::uri::{Authority, Scheme}; use hyper::{Body, Request, Uri}; use path_tree::PathTree; use std::net::SocketAddr; use std::str::FromStr; fn make_path(path: String) -> String { let path = path.replace("//", "/"); le...
#[doc = "Reader of register CSR"] pub type R = crate::R<u32, super::CSR>; #[doc = "Reader of field `OVR3`"] pub type OVR3_R = crate::R<bool, bool>; #[doc = "Reader of field `STRT3`"] pub type STRT3_R = crate::R<bool, bool>; #[doc = "Reader of field `JSTRT3`"] pub type JSTRT3_R = crate::R<bool, bool>; #[doc = "Reader of...
extern crate proc_macro; use proc_macro::TokenStream; use quote::{quote, format_ident}; use syn::parse::{Parse, ParseStream}; use syn::{ItemEnum, Visibility, Expr, Error}; use syn::{Ident, Token, braced, parse_macro_input, LitStr, LitInt}; struct VMCSFieldArguments { width: u64, access: LitStr, } impl Parse ...
//! Manages the catalogue of features provided by plugins use std::collections::HashMap; use std::fmt::{self, Display, Formatter}; use std::sync::Mutex; use itertools::Itertools; use lazy_static::lazy_static; use log::{debug, error, trace}; use maplit::hashset; use regex::Regex; use serde::{Deserialize, Serialize}; ...
use std::{collections::{BTreeMap, HashMap}, sync::Arc}; use chrono::{DateTime, Utc}; use futures::stream::StreamExt; use k8s_openapi::api::{apps::v1::{Deployment, DeploymentSpec}, core::v1::{Container, ContainerPort, ObjectReference, PodSpec, PodTemplateSpec}}; use k8s_openapi::apimachinery::pkg::apis::meta::v1::{Labe...
extern crate ezgl; extern crate gl; extern crate glutin; extern crate nalgebra; use ezgl::*; use glutin::dpi::*; use glutin::Event::WindowEvent; use glutin::*; use nalgebra::*; use std::path::*; pub fn get_root() -> PathBuf { PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()) } fn main() { // window...
// Copyright 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-MIT or ...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 #![forbid(unsafe_code)] //! `RateLimiter` converts any [`futures::stream::Stream`] into a rate-limited //! stream, allowing only a certain number of elements to be polled in a given time interval. //! //! RateLimiter uses the token-bu...
use std::fs; use serde::{Deserialize, Serialize}; use serde_yaml::{self}; use clap::{App, Arg, SubCommand}; use bcrypt; //Menu Stuff pub fn commands_n_args() { let matches = App::new("Delibird") .version("0.1") .about("Delibird is a log file monitor and exporter written completely in Rust") .arg(Arg::w...
use crate::directory::read_only_source::ReadOnlySource; use crate::directory::{AntiCallToken, TerminatingWrite}; use byteorder::{ByteOrder, LittleEndian}; use crc32fast::Hasher; use std::io; use std::io::Write; const COMMON_FOOTER_SIZE: usize = 4 * 5; #[derive(Debug, Clone, PartialEq)] pub struct Footer { pub tan...
//! # audisee //! //! This library provides several methods for extracting features from audio //! data. It provides a foundation upon which higher-level audio information //! systems can be built. #![warn( anonymous_parameters, missing_copy_implementations, missing_debug_implementations, missing_docs,...
//! Full-text search, powered by Tantivy. //! A folder for the index is stored in the config. //! You can see the Endpoint on `http://localhost/search` use atomic_lib::Db; use atomic_lib::Resource; use atomic_lib::Storelike; use tantivy::schema::*; use tantivy::Index; use tantivy::IndexWriter; use tantivy::ReloadPolic...
// 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 ...
//! the rustc crate store interface. This also includes types that //! are *mostly* used as a part of that interface, but these should //! probably get a better home if someone can find one. use crate::ty::TyCtxt; use rustc_ast as ast; use rustc_data_structures::sync::{self, MetadataRef}; use rustc_hir::def_id::{Crat...
//! Provides methods for obtaining validator signatures, including: //! //! - Via a local `Keypair`. //! - Via a remote signer (Web3Signer) use crate::http_metrics::metrics; use eth2_keystore::Keystore; use lockfile::Lockfile; use reqwest::Client; use std::path::PathBuf; use std::sync::Arc; use task_executor::TaskExec...
//! The `Slot` and `Epoch` types are defined as new types over u64 to enforce type-safety between //! the two types. //! //! `Slot` and `Epoch` have implementations which permit conversion, comparison and math operations //! between each and `u64`, however specifically not between each other. //! //! All math operation...
// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ContentFormats; use crate::Device; use crate::Display; use crate::Drag; use crate::DragAction; use crate::Surface; use glib::object::IsA; use glib::object::ObjectType as O...
use std::{ borrow::Cow, env::current_dir, path::{Component, PathBuf}, sync::Arc, }; use anyhow::{Context, Error}; use pathdiff::diff_paths; use swc_atoms::JsWord; use swc_common::{FileName, Mark, Span, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_loader::resolve::Resolve; use swc_ecma_utils::{quote_ide...
// Copyright 2018 <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 thos...
//! The parser takes a subset of markdown and returns an AST //! This enables the generic translation from md to html or other output formats //! The parser is getting implemented to follow the CommonMark reference spec //! as of version 0.29, available at https://spec.commonmark.org/0.29 /// Line Ending Consts cons...
// Copyright 2019 PingCAP, 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 i...
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
use super::svg::helpers::path_command_to_string; use super::utils::*; use shared::domain::jig::module::body::{ Transform, _groups::design::{PathCommand, Trace, TraceShape}, }; use std::f64::consts::PI; use utils::{ math::{mat4::Matrix4, quat, BoundsF64}, prelude::*, resize::ResizeInfo, }; use web_sy...
use crossterm_winapi::{ControlKeyState, EventFlags, KeyEventRecord, MouseEvent, ScreenBuffer}; use winapi::um::{ wincon::{ LEFT_ALT_PRESSED, LEFT_CTRL_PRESSED, RIGHT_ALT_PRESSED, RIGHT_CTRL_PRESSED, SHIFT_PRESSED, }, winuser::{ VK_BACK, VK_CONTROL, VK_DELETE, VK_DOWN, VK_END, VK_ESCAPE, VK_F...
//! Let your users split regions of your application and organize layout dynamically. //! //! [![Pane grid - Iced](https://thumbs.gfycat.com/MixedFlatJellyfish-small.gif)](https://gfycat.com/mixedflatjellyfish) //! //! # Example //! The [`pane_grid` example] showcases how to use a [`PaneGrid`] with resizing, //! drag a...
#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::time::Duration; use derive_more::{Add, Sub, Sum}; use crate::disk::disk_io_counters_per_partition; use crate::{Bytes, Count, Result}; #[cfg_attr(feature = "serde", serde(crate = "renamed_serde"))] #[cfg_attr(featu...
//! Utils to compare two files/strings line by line. use std::char; use std::io; use std::marker::Unpin; use std::path::Path; use tokio::fs::File; use tokio::io::{AsyncBufRead, AsyncBufReadExt, BufReader}; pub struct Comparer { ignore_white_space_at_eol: bool, ignore_empty_line_at_eof: bool, } impl Comparer ...
mod utils; use clap::{App, Arg}; static SC_VISIBLE_ALIAS_HELP: &str = "ct-test 1.2 Some help USAGE: ct test [FLAGS] [OPTIONS] FLAGS: -f, --flag [aliases: v_flg, flag2, flg3] -h, --help Print help information -V, --version Print version information OPTIONS: -o, --opt <opt> [al...
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license. use libc::c_char; use libc::c_int; use std::ffi::CStr; use std::ffi::CString; use std::sync::Mutex; use std::vec::Vec; use crate::platform::Platform; use crate::support::UniqueRef; use crate::support::UnitType; extern "C" { fn v8__V8__SetFla...
use db_connector::queue::*; use db_connector::signup::*; use db_connector::workspace::*; use db_connector::{create_db_pool, create_db_pool_env}; use chrono::naive::NaiveDateTime; use fake::faker::company::en::*; use fake::faker::internet::en::*; use fake::faker::lorem::en::*; use fake::faker::name::en::*; use fake::Fa...
use bitcoin::util::base58; use byteorder::{LittleEndian, WriteBytesExt}; use hex; use secp256k1::Signature; use serde_json; use sha2::{Digest, Sha256}; use std::iter; use enums::TransactionType; use identities::{private_key, public_key}; use super::super::SECP256K1; #[derive(Clone, Debug, Default, Deserialize, Seria...
use glib::signal; use gtk::prelude::*; use gtk::{BinExt, ImageExt, LabelExt, RangeExt}; use std::ops::Deref; use std::rc::Rc; use crate::app::components::utils::format_duration; use crate::app::components::{ utils::{Clock, Debouncer}, EventListener, }; use crate::app::state::{PlaybackAction, PlaybackEvent}; us...
// This file is part of Substrate. // Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the F...
use anyhow::{anyhow, Context, Result}; use dbus::arg; use derivative::Derivative; use log::debug; use std::collections::HashMap; use std::fmt; use std::path::PathBuf; use std::str::FromStr; use url::Url; fn show_pixel_count(image_data: &Vec<u8>, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { write!(f, "{} byt...
//! Provides the connection pool for asynchronous SQLx connections. //! //! Opening a database connection for each and every operation to the database can quickly //! become expensive. Furthermore, sharing a database connection between threads and functions //! can be difficult to express in Rust. //! //! A connection ...
//! Demonstrates the arc ball camera use amethyst::{ assets::{AssetStorage, Loader}, controls::{ArcBallControl, ArcBallControlBundle, HideCursor}, core::{ frame_limiter::FrameRateLimitStrategy, transform::{Transform, TransformBundle}, }, input::{is_key_down, is_mouse_button_down, In...
use std::{ fs::File, io::{BufReader, BufWriter}, process::{Command, ExitStatus}, }; #[cfg(unix)] use std::os::unix::process::ExitStatusExt; #[cfg(target_os = "linux")] use inferno::collapse::perf::{ Folder, Options as CollapseOptions, }; #[cfg(not(target_os = "linux"))] use inferno::collapse::dtrace:...
//! Demo for STM32H747I-DISCO eval board //! //! The ethernet ring buffers are placed in SRAM3, where they can be //! accessed by both the core and the Ethernet DMA. //! //! This demo doesn't use smoltcp - see the stm32h747i-disco-rtic demo #![deny(warnings)] #![no_main] #![no_std] use cortex_m; use cortex_m_rt as rt;...
use chain_addr::{Address, Discrimination}; use chain_impl_mockchain::{ certificate::VotePlan, chaintypes::ConsensusVersion, fee::LinearFee, testing::{ create_initial_vote_plan, data::CommitteeMembersManager, scenario::{proposal, template::VotePlanDefBuilder, vote_plan}, V...
use actix_web::{cookie::Cookie, get, post, web, web::Form, HttpResponse, Responder}; use chrono::{NaiveDateTime, Utc}; use serde::{Deserialize, Serialize}; use tera::Context; use crate::{ data::RubbleData, models::{ article::{Article, NewArticle}, setting::{Setting, UpdateSetting}, user...
use crate::{utils::nodes_panicked, Net, Spec}; use ckb_channel::{unbounded, Receiver, Sender}; use ckb_util::Mutex; use log::{error, info}; use std::any::Any; use std::panic; use std::path::PathBuf; use std::sync::{atomic::AtomicU16, Arc}; use std::thread::{self, JoinHandle}; use std::time::Instant; /// Commands #[der...
//! HTTP Upgrades //! //! See [this example][example] showing how upgrades work with both //! Clients and Servers. //! //! [example]: https://github.com/hyperium/hyper/blob/master/examples/upgrades.rs use std::any::TypeId; use std::error::Error as StdError; use std::fmt; use std::io::{self, Read, Write}; use bytes::{...
use crate::algorithm::{Algorithm, Creator}; use crate::utils::*; use crate::{Builder, Float, Vector}; use num_traits::NumCast; use rand::distributions::{Distribution, Standard, Uniform}; use rand::{distributions::StandardNormal, Rng}; use sphere::sphere_volume; /// Generates approximately uniform non-maximal Poisso...
// * This file is part of the uutils coreutils package. // * // * For the full copyright and license information, please view the LICENSE // * file that was distributed with this source code. // spell-checker:ignore zaaa zaab //! Compute filenames from a given index. //! //! The [`FilenameIterator`] yields filename...
use super::{ Assignment, BVOperator, BitVector, Formula, SmtSolver, Solver, SolverError, Symbol::{Constant, Input, Operator}, SymbolId, }; use std::collections::HashMap; use z3_solver::{ ast::{Ast, Bool, Dynamic, BV}, Config, Context, Model, SatResult, Solver as Z3Solver, }; pub struct Z3 {} impl ...
// 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...
// Copyright 2015 The coio Developers. // // 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 acco...
// Day 19: Beacon Scanner // http://adventofcode.com/2021/day/19 use scan_fmt::scan_fmt; use std::collections::HashMap; use std::collections::HashSet; use std::fmt; use std::fs; use std::time::Instant; use structopt::StructOpt; /// parse command line arguments #[derive(StructOpt)] struct Cli { #[structopt(default...