text
stringlengths
3.09k
13.9k
// Generated from definition com.github.openshift.api.apps.v1.DeploymentStrategy /// DeploymentStrategy describes how to perform a deployment. #[derive(Clone, Debug, Default, PartialEq)] pub struct DeploymentStrategy { /// ActiveDeadlineSeconds is the duration in seconds that the deployer pods for this deployment ...
// extern crate audrey; extern crate deepspeech; extern crate serde; extern crate serde_json; use std::env::args; use std::fs; use std::path::Path; use std::{thread, time}; use byteorder::{ByteOrder, LittleEndian}; use deepspeech::Model; use std::sync::mpsc; use std::sync::mpsc::SyncSender; use std::env; use std::...
extern crate bitflags; use ::std::io::{BufReader, Read,}; use ::std::fmt::{Display, Formatter, Error}; use mysql::packets::{Header, ReadablePacket}; use mysql::packets::protocol_types::*; use mysql::packets::protocol_reader::ProtocolTypeReader; pub enum GeneralResponses{ Okay(OkPacket41), Er...
//! Provides a trait for `Parser` instances. Each parser implements //! this `Parser`. Must implement the `parse`, `name`, and `eg` //! methods. #![allow(clippy::upper_case_acronyms)] use std::fmt; use crate::{ChuiResult, ChuiError}; use super::{Move, Color}; pub mod algebraic; pub mod long_algebraic; pub mod rever...
use configuration::CFG; use map::MAP; use math::*; use physics::{Body, Shape, Collision}; use spatial_hashing::SpatialHashing; use graphics::{self, Layer, Transformed}; use audio::Audio; #[derive(Debug, Clone)] struct Effect { pos: [f64;2], angle: f64, timer: f64, } pub struct App { walls: SpatialHash...
use super::*; use llvm_sys::execution_engine::*; use llvm_sys::prelude::*; use std::ffi::CString; use std::marker::PhantomData; use std::os::raw::c_char; #[derive(Debug)] pub struct ExecutionEngine<'ctx> { inner: LLVMExecutionEngineRef, modules: Vec<LLVMModuleRef>, _context: PhantomData<&'ctx Context>, } ...
//! Types and constants shared between 32-bit and 64-bit wasi. Types involving //! pointer or `usize`-sized data are excluded here, so this file only contains //! fixed-size types, so it's host/target independent. use crate::WasiCtx; wiggle::from_witx!({ witx: ["WASI/phases/snapshot/witx/wasi_snapshot_preview1.wit...
// Copyright (c) 2017, <NAME> //! Abstract syntax tree for roc-lang //! //! Lua syntax specification; //! from the Lua 5.3 Reference Manual http://www.lua.org/manual/5.3/manual.html //! //! Here is the complete syntax of Lua in extended BNF. As usual in extended //! BNF, {A} means 0 or more As, and [A] means an option...
#![forbid(unsafe_code, bad_style, nonstandard_style, future_incompatible)] #![forbid(rust_2018_idioms, rust_2021_compatibility)] #![deny(missing_debug_implementations)] #![deny(missing_docs)] #![cfg_attr(test, allow(dead_code))] #![cfg_attr(test, deny(warnings))] //! # random-access-memory //! Continuously read,write ...
use crate::config::{CitationStyle, Config}; use crate::format; use biblatex::Bibliography; use linked_hash_map::{Entry, LinkedHashMap}; use once_cell::sync::Lazy; use regex::{Captures, Regex}; use std::collections::HashMap; use std::path::{Path, PathBuf}; use yarner_lib::{Document, Node, TextBlock}; const REF_PATTERN:...
use std::{ error, fmt::Write, io, net::{SocketAddr, ToSocketAddrs}, result, sync::Arc, vec::Vec, }; use tokio::{ io::{AsyncBufReadExt, AsyncWriteExt}, net::UdpSocket, sync::RwLock, task, }; use super::gain; use super::repl; use crate::vban; pub struct Runner { rx_addr:...
use crate::transfer::to_eth::{get_add_ckb_headers_func, get_msg_hash, get_msg_signature}; use crate::util::ckb_tx_generator::Generator; use crate::util::ckb_util::covert_to_h256; use crate::util::eth_util::{ convert_eth_address, parse_secret_key, relay_header_transaction, Web3Client, }; use anyhow::{anyhow, bail, R...
use std::{rc::Rc, env::var}; use std::net::TcpStream; use std::time::{Duration, Instant}; use native_tls::TlsStream; use tungstenite::stream::Stream; use tungstenite::{Message, WebSocket}; use log::*; use rand::{thread_rng, Rng}; pub mod channel_point_redemption; pub mod follower; use channel_point_redemption::point...
use linregress::{FormulaRegressionBuilder, RegressionDataBuilder}; use std::collections::BTreeMap; use std::fmt; use std::fmt::Display; use std::time::Duration; use std::time::Instant; static TIME_LIMIT_SINGLE: Duration = Duration::from_secs(10); static TIME_LIMIT_ALGO: Duration = Duration::from_secs(30); // Paramete...
use reqwest::StatusCode; use std::net::SocketAddr; use crate::util::CHANNEL_SECRET; fn parse_token(token: &str, validate_expiry: bool) -> anyhow::Result<()> { let secret = biscuit::jws::Secret::bytes_from_str(CHANNEL_SECRET); let token = biscuit::JWT::<biscuit::RegisteredClaims, biscuit::Empty>::new_encoded(&...
#![cfg(windows)] extern crate winapi; #[macro_use] extern crate detour; extern crate widestring; use std::{ thread, sync::{Mutex, mpsc}, rc::Rc, ffi::CString, ptr }; use winapi::{ um::{ winnt::LPCWSTR, winhttp::{HINTERNET, INTERNET_PORT}, libloaderapi::{GetModuleHandleA...
// Copyright 2012 Google Inc. // Copyright 2020 <NAME> // // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /* Find the intersection of a line and cubic by solving for valid t values. Analogous to line-quadratic intersection, solve line-cubic intersection by repre...
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; use crossterm::{ event::EnableMouseCapture, execute, terminal::enable_raw_mode, terminal::EnterAlternateScreen, }; use livesplit_core::TimeSpan; use std::io::{stdout, Write}; use std::{convert::TryInto, error::Error}; use crate::{wl_split_timer::TimeFormat,...
use std::fmt; use std::fs::OpenOptions; use std::io; use std::io::{BufReader, Read, Write}; mod defines; pub struct Iso { udf: bool, patched: bool, path: String, data: Vec<u8>, } pub enum ActionResult { PatchOK, UnpatchOK, WriteOK, } // Public Functions impl Iso { pub fn new(path: &st...
use std::sync::Arc; use std::collections::HashMap; use std::io::{self, BufRead}; use crossbeam_channel::{Sender, Receiver}; use r_htslib::*; use utils::compress::get_reader; use super::snp::{RawSnp, Snp, SnpBlock}; use crate::config::{IType, Config, DbInput}; use crate::process::AtomicServer; use crate::snp::SnpBuil...
use num_traits::{CheckedAdd, One, Zero}; use crate::pattern::char::Char; use crate::pattern::index::shift_index; use crate::pattern::integer::{parse_integer, ParsableInt}; use crate::pattern::parse::{BaseResult, Error, ErrorKind, Result}; use crate::pattern::reader::Reader; use crate::pattern::symbols::{RANGE_OF_LENGT...
//! Rust Bindings for [Sequential Line Search](https://koyama.xyz/project/sequential_line_search/). //! //! Sequential Line Search is a generic human-in-the-loop optimization algorithm that optimizes for //! the user's preference, by repeatedly asking them to select their favorite on a slider. //! //! The [SLSFramework...
use super::*; use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; #[derive(Debug, Clone)] pub struct NodeTypeVocabulary { /// This is the vector with the node types of each node /// Moreover, for the node x it's node type is ids[x] /// it's an option since the node might not have ...
use crate::species::Species; use crate::util::Region; use rusqlite::{Connection, Error, Statement}; use std::collections::HashMap; use std::convert::TryInto; #[derive(Debug, Eq, Hash, PartialEq)] pub struct PlantSpecies { id: u32, name: String, } /// simple context struct to manage the DB connection and prepa...
#[macro_use] extern crate matrixops; extern crate cursive; extern crate num_rational; extern crate num_traits; use cursive::Cursive; use cursive::view::{Offset, Position}; use cursive::views; use cursive::traits::Identifiable; use num_rational::Ratio; use num_traits::FromPrimitive; use std::cell::RefCell; use std::str...
use std::collections::HashMap; use std::time::Instant; use std::env; use std::process; use pcap::Device; use clap::ArgMatches; mod utils; struct Config { threshold: u32, wait: u32, use_discord: bool, discord_channel_id: String, discord_token: String } impl Config { fn parse(matches: &ArgMatc...
//! # Examples //! //! Spawn a process outside of the sandbox, only works in a Flatpak. //! //! ```no_run //! use enumflags2::BitFlags; //! use ashpd::flatpak::{FlatpakProxy, SpawnFlags, SpawnOptions}; //! use zbus::{fdo::Result, Connection}; //! use std::collections::HashMap; //! //! fn main() -> Result<()> { //! ...
//! For performing functions related to authentication for the API. use std::{ fmt, sync::{Arc, Mutex}, time, }; use anyhow::Result; use jsonwebtoken as jwt; use serde::Serialize; // We use 9 minutes for the life to give some buffer for clock drift between // our clock and GitHub's. The absolute max is 10...
#[macro_use] extern crate serde_derive; extern crate docopt; extern crate dirs; extern crate rusty_x; extern crate skim; extern crate ansi_term; use ansi_term::Colour::Yellow; use ansi_term::{ANSIString, ANSIStrings}; use std::default::Default; use std::io::Cursor; use std::path; use docopt::Docopt; use skim::{Sk...
use std::fs::File; use std::io::BufWriter; use ndarray::prelude::*; use ndarray::Array; use ndarray_linalg::*; use rand::distributions::*; use rand_distr::Normal; use rand_xoshiro::Xoshiro256StarStar; use read_and_write::*; pub struct EnsembleKalmanFilterMember { pub x: Array2<f64>, pub v: Array2<f64>, ...
// Copyright 2017 <NAME>. See the COPYRIGHT file at the top-level // directory of this distribution. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // https://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or https://opensource.org/licenses/MIT> or the Unlicense // <LIC...
use std::collections::HashMap; // file processing use std::fs::{self,File}; use std::path::PathBuf; // Run command use std::env::args; use std::process::Command; // Local use menu::{get_conf_dir,term,ask}; // JSON use serde::{Serialize,Deserialize}; use serde_json as json; use itertools::Itertools; fn main() { le...
use scopeguard::defer; use std::{io, mem, time::Duration}; use winapi::{ shared::{ minwindef::FILETIME, ntdef::{FALSE, NULL}, }, um::{ handleapi::CloseHandle, processthreadsapi::{ GetCurrentProcess, GetCurrentThreadId, GetProcessTimes, GetSystemTimes, GetThreadTim...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct PartyRiskLimitsAckGrp { /// NoPartyRiskLimits #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "1677")] pub party_risk_limits: Option<fix_common::RepeatingValues<PartyRiskLimit>>, ...
use rand::Rng; use crate::utils::maths::{Vector, mapping, sub_vectors}; const MAX_SPEED: f64 = 10.; const MAX_FORCE: f64 = 1.; // pub struct Particle { // index: usize, // pos: Vector, // des: Vector, // vel: Vector, // acc: Vector, // size: f64, // width: f64, // height: f64, // } ...
/// Matching helper implemented for `Fn(String) -> bool` /// Used to check if the a file is of the desired mime type pub trait MimeTypeMatcher { /// Checks if the given file is of the desired mime type /// The type is registered with this matcher in the [MimeTypeMapper]. fn match_type(&self, file: &String) ...
pub struct Name { name: u64, } impl Name { #[allow(clippy::too_many_arguments)] pub fn new( arbitrary_address_capable: bool, industry_group: u8, vehicle_system_instance: u8, vehicle_system: u8, function: u8, function_instance: u8, ecu_instance: u8, ...
extern crate order; extern crate redis; use std::time::SystemTime; use redis::connection::Connection; use redis::connection::PubSub; use order::order::Order; use order::order::order_type::OrderType; use order::order::order_executor::{ Executor, OrderExecutor }; use order::order::order_execution_type::OrderExecutionType...
// --- Day 14: Docking Data --- // As your ferry approaches the sea port, the captain asks for your help again. The computer system // that runs this port isn't compatible with the docking program on the ferry, so the docking // parameters aren't being correctly initialized in the docking program's memory. // After a...
// STD Dependencies ----------------------------------------------------------- use std::ascii::AsciiExt; // Discord Dependencies ------------------------------------------------------- use discord::model::{ ChannelId, UserId, User as DiscordUser, Member as DiscordMember, VoiceState as DiscordVoic...
extern crate regex; use regex::Regex; use std::cmp; use std::collections::HashSet; use std::fs::File; use std::io::prelude::*; use std::io::BufReader; #[derive(Eq, Hash, PartialEq, Debug, Clone)] struct Point { x: i64, y: i64, z: i64, } #[derive(Eq, Hash, PartialEq, Debug, Clone)] struct Moon { pos: ...
use sha2::Sha256; use hmac::{Hmac, NewMac, Mac}; use serde::Serialize; use crate::espocrm_types::Params; type HmacSha256 = Hmac<Sha256>; /// Used to indicate the required GenericType is not needed /// Used when calling [request()](EspoApiClient::request) with the GET method pub type NoGeneric = (); #[deri...
use std::convert::TryFrom; use log::info; use wasm_bindgen_futures::spawn_local; use yew::prelude::*; use libchordr::prelude::{Credentials, Error, Password, Username}; use webchordr_common::errors::WebError; use webchordr_persistence::session::SessionService; use crate::components::detail_view::DetailView; use crate...
use crate::inbox::ConnectionImpl; use crate::serialize::OutBoxFeedbackMsg; use slog::info; mod marks; use self::marks::{Epoch, EpochHistory, MarkHistory, MarkedInstant}; /// Calculate and maintain flow measurements. pub struct BundleFlowState<'dp, Q: crate::inbox::datapath::Datapath + 'static> { pub conn: Option<...
use crate::{ config::db::Connection, constants, models::{ common::{DbQuery}, chat_room::{LastMessage, ChatRoom} }, }; use cdrs::{ query::*, frame::{ IntoBytes, }, types::{ AsRustType, AsRust, IntoRustByName, ByName, IntoRustByIndex, ByIndex, ...
use nalgebra as na; pub type Point2 = na::Point2<f32>; pub type Point3 = na::Point3<f32>; pub type Point4 = na::Point4<f32>; pub type Mat3 = na::Matrix3<f32>; pub type Mat4 = na::Matrix4<f32>; pub type Vec3 = na::Vector3<f32>; #[derive(Clone, Copy, Debug, PartialEq)] pub struct ScreenPoint { pub x: f32, pub y...
use once_cell::sync::OnceCell; use rayon::prelude::*; use regex::Regex; use std::collections::HashMap; use std::io::{self, Read}; use std::str::FromStr; // Global variable storing all bags from problem input static BAGS: OnceCell<Vec<Bag>> = OnceCell::new(); // Global variables storing regexes, so we don't recompile ...
use serde::{Deserialize, Serialize}; use std::cell::RefCell; use std::collections::{HashMap, HashSet, hash_map::Entry}; use std::rc::Rc; use crate::{Type, UpValue, Value}; /// The serialized version of a pointer. pub type FlatValueID = usize; /// A value packed with pointers replaced with [FlatValueID], /// which po...
use ff::Field; use rand_core::RngCore; use super::super::{Coeff, Polynomial}; use super::{Blind, Params}; use crate::arithmetic::{ best_multiexp, compute_inner_product, eval_polynomial, parallelize, CurveAffine, FieldExt, }; use crate::transcript::{EncodedChallenge, TranscriptWrite}; use group::Curve; use std::io...
//! Please refer to the `fondant` crate for usage instructions extern crate proc_macro; use ::std::ffi::{OsStr, OsString}; use ::std::path::Path; use proc_macro::TokenStream; use proc_macro2::Span; use quote::quote; use syn::{parse_macro_input, DeriveInput, Ident, Lit, Meta, MetaNameValue}; #[derive(Debug, Default)]...
use cgmath::prelude::*; use cgmath::{BaseFloat, Matrix4, Quaternion, Rad, Vector3, Vector4}; use std::{cmp::Ordering, ops::Mul}; /// Axis aligned bounding box. #[derive(Copy, Clone, Debug)] pub struct AABB<S> { min: Vector3<S>, max: Vector3<S>, } impl<S> AABB<S> { /// Create a new AABB. pub fn new(min...
//! ECDH-1PU key derivation use sha2::Sha256; use zeroize::Zeroize; use super::{ concat::{ConcatKDFHash, ConcatKDFParams}, KeyDerivation, KeyExchange, }; use crate::{ buffer::{WriteBuffer, Writer}, error::Error, }; /// An instantiation of the ECDH-1PU key derivation #[derive(Debug)] pub struct Ecdh1P...
// use std::slice::windows; use std::collections::{HashMap, HashSet}; use std::sync::Arc; use rayon::ThreadPoolBuilder; use dashmap::{DashMap, DashSet}; // Black are to be ignored const PXB: &str = "0.000000 0.000000 0.000000"; const WIB: [&str; 9] = [PXB, PXB, PXB, PXB, PXB, PXB, PXB, PXB, PXB]; /// Picks up informa...
use futures::{stream, StreamExt}; use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; use std::fs; use std::path::PathBuf; use std::sync::Arc; use crate::Result; #[derive(Debug, Clone)] pub struct FileToUnzip { archive: PathBuf, output: PathBuf, } impl FileToUnzip { pub fn new(archive: impl Into<...
//! # Module grammatical //! //! Ce module permet la gestion de la partie grammaticale (syntaxique) et un partie sémantique des requêtes reçues. //! //! Ce module ne doit normalement dépendre d'aucun autre, car il reçoit du texte, et renvoie du texte. Cependant une tolérance doit être faite sur les retours, autorisant ...
use crate::{ CONFIG, credentials::adult_prove::CredentialAdultProve, error::{Error, Result}, model::{CreatePassbaseIdentity, PassbaseIdentity}, service::{ did::DidService, vc::{Credential, CredentialService, Credentials}, }, }; use chrono::{Datelike, NaiveDate, Utc}; use serde_js...
use std::{ ops::Range, sync::atomic::{AtomicUsize, Ordering}, }; use crate::{ managers::{MeshManager, ObjectManager}, util::registry::ResourceRegistry, }; use glam::{Mat4, UVec2}; use rend3_types::{MeshHandle, RawSkeletonHandle, Skeleton, SkeletonHandle}; use wgpu::{CommandEncoder, Device}; /// Inter...
#![allow(non_snake_case)] // mod style; use std::collections::BTreeMap; use dioxus::prelude::*; use dioxus::fermi::UseAtomRef; #[derive(Debug, Clone)] struct ToastManagerItem { info: ToastInfo, timestamp: i64, hide_after: usize, } #[derive(Default, Debug)] pub struct ToastManager { list: BTreeMap<u...
use super::*; use std::cmp::Ordering; use std::hash::{Hash, Hasher}; use std::mem; /// Representation of an FBAS. /// /// ## Example /// ``` /// use fbas_analyzer::{Fbas, QuorumSet}; /// /// let fbas = Fbas::from_json_str( /// r#"[ /// { /// "publicKey": "n0", /// "quorumSet": { "threshold": 1,...
use crate::connection::{Authentication, Connection}; use crate::connection_manager::{BrokerAddress, ConnectionManager}; use crate::error::ServiceDiscoveryError; use crate::executor::{Executor, TaskExecutor}; use crate::message::proto::{command_lookup_topic_response, CommandLookupTopicResponse}; use futures::{future::tr...
use clap::{App, Arg}; use minimonkey::{add_admin_permission, revoke_admin_permission}; use minimonkey::{add_login_permission, revoke_login_permission}; use minimonkey::{add_publish_permission, revoke_publish_permission}; use minimonkey::{add_subscribe_permission, revoke_subscribe_permission}; use minimonkey::{Provision...
#[macro_use] extern crate nom; use nom::digit; use std::cell::RefCell; use std::collections::{HashMap, VecDeque}; const INPUT: &str = include_str!("input/day18.txt"); type Register = char; #[derive(Debug)] enum Value { Register(Register), Immediate(i64) } #[derive(Debug)] enum Instruction { Snd(Value),...
/** * BSD 2-Clause License * * Copyright (c) 2021, <NAME> * All rights reserved. * * 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, thi...
use super::{backend::*, event::SystemEv}; /// An event without any content #[derive(Default, Clone, PartialEq, Debug)] pub struct CommonEvent {} /// Position relative to viewport left-top #[derive(Default, Clone, PartialEq, Debug)] pub struct ViewportPosition<T: Clone> { pub x: T, pub y: T, } /// Mouse butto...
use super::{ image_texture_conversion::image_to_texture, Extent3d, SamplerDescriptor, TextureDimension, TextureFormat, }; use crate::render_resource::{SamplerId, TextureId, TextureViewId}; use bevy_reflect::TypeUuid; use thiserror::Error; pub const TEXTURE_ASSET_INDEX: u64 = 0; pub const SAMPLER_ASSET_INDEX: u...
// Solves discrete logarithm problem by "baby-step giant-step" algorithm. // // // # References // // - <https://en.wikipedia.org/wiki/Baby-step_giant-step> // - <http://blog.miskcoo.com/2015/05/discrete-logarithm-problem> use std::io; use std::io::prelude::*; use std::collections::HashMap; /// Finds `x` in /// ///...
//! Main interface for executing queries against a neo4j database //! //! # Examples //! //! ## Execute a single query //! ``` //! # use rusted_cypher::{GraphClient, GraphError}; //! # fn main() { doctest().unwrap(); } //! # fn doctest() -> Result<(), GraphError> { //! # let graph = GraphClient::connect("http://neo4j:n...
//! Implementation of the standard remotekey management API. use crate::{initialized_validators::Error, InitializedValidators, ValidatorStore}; use account_utils::validator_definitions::{SigningDefinition, ValidatorDefinition}; use eth2::lighthouse_vc::std_types::{ DeleteRemotekeyStatus, DeleteRemotekeysRequest, De...
//! Implements a merge tree to merge an arbitrary number of sorted map outputs. See //! https://drive.google.com/open?id=1grB87a0w9fQ2k7i04N3VJvYlw2BldxWNcHublW_ygJs. //! Genericized in order to build arbitrary merge trees. #![allow(dead_code)] use std::cmp::{Ord, Ordering}; use std::iter; /// See module description...
use std::collections::HashMap; use std::fmt::Debug; use async_trait::async_trait; use log::{error, info, warn}; use crate::bollard::container::{InspectContainerOptions, RemoveContainerOptions}; use crate::bollard::Docker; pub use crate::errors::TestcontainerError; use crate::{DropAction, ImageSettings, Qualifier, Tas...
use std::pin::Pin; use std::sync::Arc; use futures::stream::Stream; use futures::task::{Context, Poll}; use futures::{FutureExt, StreamExt}; use tokio::task::spawn_blocking; use nimiq_block::Block; use nimiq_blockchain::Blockchain; use nimiq_network_interface::prelude::{Network, NetworkEvent, Peer}; use crate::conse...
use backend::*; struct RoomBuilder {} impl RoomBuilder { fn new() -> Box<Self> { Box::new(Self {}) } } fn noise_map( seed: u64, octaves: i32, gain: f32, lacunarity: f32, freq: f32, frames: &mut Vec<(Map, String)>, x_scale: f32, y_scale: f32, title: &str, ) { le...
/* Copyright (c) 2021, <NAME> SPDX-License-Identifier: BSD-3-Clause */ use std::mem::size_of; use std::os::raw::c_void; use crate::error::PipelineError; use crate::vc::*; #[derive(Debug, Default, Copy, Clone)] pub struct Component { pub component: i32, pub in_port: u32, pub out_port: u32, } #[derive(Debu...
use super::system_prelude::*; use crate::solid_tag::SolidTag; #[derive(Default)] pub struct FeatureSystem; impl<'a> System<'a> for FeatureSystem { type SystemData = ( Entities<'a>, Write<'a, Music>, ReadStorage<'a, Collision>, ReadStorage<'a, Enemy>, ReadStorage<'a, Indicat...
use wasm_bindgen::prelude::*; use std::collections::HashSet; use super::*; use super::gfx::*; #[wasm_bindgen] #[derive(Debug, Clone)] pub struct Point { pub x: f32, pub y: f32, } #[wasm_bindgen] #[derive(Debug, Clone)] pub struct Color { pub r: f32, pub g: f32, pub b: f32, } impl From<Vector3<f...
use super::*; use super::point::Point; use super::line::LineSegment; use super::quadratic_bezier::QuadraticBezier; use super::cubic_bezier::CubicBezier; use num_traits::{float::Float}; /// A Wrapper Class for Bezier curves that makes them rational, allowing /// representation of conics by the use of weights for th...
use std::cmp::{max, min}; use super::parse::*; use colored::*; #[derive(Debug)] enum DiffElement<T> { Equal(T), Insert1(T), Insert2(T), Different(T, T), } fn edit_distance<T: PartialEq + Clone>(text1: &Vec<T>, text2: &Vec<T>, cmp: fn(&T, &T) -> u64, icost: u64, compute_back : bool) -> (u64, Option<Ve...
#![cfg_attr(not(feature = "std"), no_std)] //! # ws-frame //! //! A library for decoding WebSocket //! ([RFC6455](https://tools.ietf.org/html/rfc6455)) frames. //! //! # Example //! ``` //! use ws_frame::{Frame, Opcode}; //! //! let buf = [0b10100010, 0b00000001, 0b00000010]; //! let mut f = Frame::empty(); //! //! if...
//! Physical devices and adapters. //! //! The `PhysicalDevice` trait specifies the API a backend must provide for dealing with //! and querying a physical device, such as a particular GPU. An `Adapter` is a struct //! containing a `PhysicalDevice` and metadata for a particular GPU, generally created //! from an `Inst...
//! UI theme API. //! //! This API aims to be very generalized, hence the stringly-typed semantics. //! However, there are some predefined string values should be handled (see `painters` and `colors`). //! //! Themes can be extended upon be implementing a new theme type which uses composition and delegation to extend a...
use crate::attrib::{get_field_attr_once, AttrError}; use proc_macro::TokenStream; use quote::{format_ident, quote}; use std::fmt; use syn::{Attribute, DataStruct, Field, Fields, Ident, LitBool, Type}; // accepted sub keys for the "vertex" key const KNOWN_SUBKEYS: &[&str] = &["sem", "instanced", "normalized"]; #[deriv...
use graph::data::subgraph::schema::SUBGRAPHS_ID; use graph::prelude::{SubscriptionServer as SubscriptionServerTrait, *}; use http::{HeaderValue, Response, StatusCode}; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::Mutex; use tokio::net::TcpListener; use tokio_tungstenite::accept_hdr_async; use tokio_tung...
use std::{ cmp::Ordering, fmt::{self, Debug, Display, Write}, }; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Tree<K, V, F> { roots: Vec<Node<K, V>>, format: F, } impl<K, V, F> Tree<K, V, F> { pub fn new(format: F) -> Self where F: FnMut(&mut dyn Write, &K, ...
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT // An iOS package is laid out like: // // Foobar.app # Actually a directory // Foobar # The main binary executable of the app // Info.plist # ...
//! Parallel iterator types for [inclusive ranges][std::range], //! the type for values created by `a..=b` expressions //! //! You will rarely need to interact with this module directly unless you have //! need to name one of the iterator types. //! //! ``` //! use rayon::prelude::*; //! //! let r = (0..=100u64).into_p...
//! Get cpu usage for current procss and specified thread. //! //! A method named `cpu` on `ThreadStat` and `ProcessStat` //! can retrive cpu usage of thread and process respectively. //! //! The returning value is unnormalized, that is for mutil-processor machine, //! the cpu usage will beyond 100%, for example return...
extern crate rand; use rand::distributions::{Distribution, Weighted, WeightedChoice}; use rand::prelude::*; const DATA: [(&str, f64); 8] = [ ("aleph", 1.0 / 5.0), ("beth", 1.0 / 6.0), ("gimel", 1.0 / 7.0), ("daleth", 1.0 / 8.0), ("he", 1.0 / 9.0), ("waw", 1.0 / 10.0), ("zayin", 1.0 / 11.0)...
use crate::compactor::*; use crate::helper; use crate::messages::EventSummary; use crate::protos::event::Event; use chrono::{DateTime, Duration, NaiveDateTime, Utc}; use protobuf::Message; use std::collections::{BTreeMap, HashMap}; use std::convert::TryFrom; use std::convert::TryInto; use std::fs; use std::fs::File; us...
// Rust JSON-RPC Library // Written in 2015 by // <NAME> <<EMAIL>> // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to // the public domain worldwide. This software is distributed without // any warranty. // // You should have ...
// Copyright (c) The Diem Core Contributors // Copyright (c) The Move Contributors // SPDX-License-Identifier: Apache-2.0 use move_ir_types::location::{sp, Loc}; use move_symbol_pool::Symbol; use crate::{ attr_derivation::{async_deriver::derive_for_async, evm_deriver::derive_for_evm}, parser::ast::{ A...
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
// Copyright 2022 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use anyhow::Context as _; use assembly_config::{FileEntry, ImageAssemblyConfig}; use assembly_validate_util::{BootfsContents, PkgNamespace}; use fuchsia_pk...
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
use futures::channel::oneshot; use futures::future::join; use futures::StreamExt; use h2_support::assert_ping; use h2_support::prelude::*; #[tokio::test] async fn recv_single_ping() { h2_support::trace_init!(); let (m, mut mock) = mock::new(); // Create the handshake let h2 = async move { let ...
//! The sorter module provides a sort function which will sort a collection of //! `Packer` columns by arbitrary columns. All sorting is done in ascending //! order. //! //! `sorter::sort` implements Quicksort using Hoare's partitioning scheme (how //! you choose the pivot). This partitioning scheme typically significa...
// wengwengweng //! Integration with Imgui pub use libimgui::Window; pub use libimgui::Ui; pub use libimgui::Condition; pub use libimgui::im_str; use crate::*; use math::*; use input::*; use gfx::*; // TODO: clean up width / height / DPI // TODO: DrawCmd impl Vertex { fn from_imgui(v: &libimgui::DrawVert) -> Self...
//! Converting between JavaScript `Promise`s to Rust `Future`s. //! //! This crate provides a bridge for working with JavaScript `Promise` types as //! a Rust `Future`, and similarly contains utilities to turn a rust `Future` //! into a JavaScript `Promise`. This can be useful when working with //! asynchronous or othe...
use crate::{ helpers::{get_document, get_file_stem}, package::{Build, Os, Package}, releases::ReleaseType, settings::{get_setting, ARCHIVE_DATE_RE}, }; use async_trait::async_trait; use chrono::NaiveDateTime; use derive_deref::{Deref, DerefMut}; use select::predicate::Name; use serde::{Deserialize, Seri...
//! This is more of a test than anything but put here as an example of how //! you could use custom event callbacks. //! //! Due to buggy and/or intentionally crippled drivers, this example may not //! work on NVIDIA hardware. Until NVIDIA's implementation is corrected this //! example will likely fail on that platform...
extern crate rgep; extern crate myopic; extern crate rand; extern crate statrs; #[cfg(test)] extern crate float_cmp; use std::collections::HashMap; use rand::prelude::*; use rgep::*; use rgep::context::*; use domains::arith::{mult_expr, add_expr, const_expr, var_expr}; fn popcount(word: u32) -> u32 { let mut b...