text
stringlengths
3.09k
13.9k
#![deny(missing_docs, unsafe_code)] #![allow(unused_imports, unused_variables)] //! Proc-macro crate of `rusty-fork`. use proc_macro::TokenStream; use quote::ToTokens; use syn::{AttributeArgs, Error, ItemFn, Lit, Meta, NestedMeta, ReturnType}; /// Run Rust tests in subprocesses. /// /// The basic usage is to simply ...
use anyhow::Result; use itertools::Itertools; use regex::Regex; use rust_htslib::bcf; use rust_htslib::bcf::{Format, Read}; use serde::{Deserialize, Serialize}; use std::collections::{HashMap, HashSet}; use std::path::Path; use std::str; #[derive(Serialize, Deserialize, Debug)] struct Dgidb { #[serde(rename = "mat...
extern crate cfg_if; extern crate wasm_bindgen; mod utils; use cfg_if::cfg_if; use std::fmt; use wasm_bindgen::prelude::*; cfg_if! { // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global // allocator. if #[cfg(feature = "wee_alloc")] { extern crate wee_alloc; #[global_...
use crate::format::{MapOperation, blockchain_sha1, blockchain_sha256, IntegrityError}; use crate::map_trait::MapTrait; use serde::de::DeserializeOwned; use crate::{LoadFileError, Integrity}; use serde::Serialize; use std::io::{BufReader, BufRead}; use crc::crc32; /// Make line with insert operation for write to file. ...
use alloc::{collections::BTreeMap, vec::Vec}; use core::cell::RefCell; use finite_set::Finite; use hypervisor_event_server_config::ClientNodeConfig; use hypervisor_event_server_types::*; use icecap_std::prelude::*; use super::*; pub struct EventServerConfig { pub host_notifications: Vec<ClientNodeConfig>, pu...
// The Computer Language Benchmarks Game // https://salsa.debian.org/benchmarksgame-team/benchmarksgame/ // // contributed by the Rust Project Developers // contributed by <NAME> // contributed by TeXitoi // contributed by <NAME> extern crate rayon; use std::cmp::min; use std::io::{BufRead, Result, Write, stdin, stdo...
mod util; use std::cell::RefCell; use std::collections::HashMap; use std::collections::VecDeque; use std::rc::Rc; type Queue = Rc<RefCell<VecDeque<i64>>>; #[derive(Clone, Debug)] enum Value { NUMBER(i64), REGISTER(char), } impl Value { fn is_number(&self) -> bool { match &self { Valu...
use std::collections::HashMap; // 结构体定义--元组结构 struct Teacher(String, u8); fn main() { println!("Hello, world!"); // const const MAX_SIZE: u8 = 1; println!("MAX_SIZE: {MAX_SIZE}"); // 声明一个 元组 let a_tuple = (1, 1.23, '2', true, "hello"); // 获取元组中的元素 let a_number = a_tuple.0; let a...
use std::fs; use std::path::{Path, PathBuf}; use crate::arc; use crate::fighter::Fighter; use crate::wii_memory::WiiMemory; use crate::wiird_runner; use anyhow::{bail, Error}; use fancy_slice::FancySlice; /// This is very cheap to create, it just contains the passed paths. /// All the actual work is done in the `lo...
use std::{ collections::BTreeMap, io::{self, Read}, }; use crate::{ BinaryString, BrickColor, Color3, ColorSequence, ColorSequenceKeypoint, NumberRange, NumberSequence, NumberSequenceKeypoint, Rect, UDim, UDim2, Variant, VariantType, Vector2, Vector3, }; use super::{type_id, AttributeError}; /// ...
use crate::{ context::CompileContext, transformation::record_type_information_compiler, CompileError, }; use hir::{analysis::types::type_comparability_checker, ir::*, types}; const LHS_NAME: &str = "$lhs"; const RHS_NAME: &str = "$rhs"; pub fn transform(module: &Module, context: &CompileContext) -> Result<Module,...
#[macro_use] extern crate prettytable; use std::fs::File; use std::sync::mpsc; use std::sync::mpsc::Receiver; use std::thread::sleep; use std::time::Duration; use std::{env, thread}; use clap::Parser; use indicatif::{ProgressBar, ProgressStyle}; use migration::{migrations, Migrator}; use utils::get_replibyte_version;...
use std::cmp::{Ordering, PartialOrd}; use std::mem::swap; use std::ops::{Add, Div, Mul, Neg}; use std::{ cmp::min, fmt::{Display, Formatter, Result}, }; pub fn calculate_gcd(mut u: u64, mut v: u64) -> u64 { if u == 0 { return v; } else if v == 0 { return u; } let i = u.trailing_zeros(); u >>= i;...
#![allow(dead_code)] extern crate psyk; extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; extern crate aphid; extern crate bytes; extern crate futures; // #[macro_use] extern crate tokio_core; extern crate tokio_io; use std::env; use std::net::SocketAddr; use psyk::network::clien...
/* ____ _____ ____ _____ * | _ \|___ /| _ \___ / * | |_) | |_ \| | | ||_ \ * | _ < ___) | |_| |__) | * |_| \_\____/|____/____/ * * Solar system 3D with astrology transit * * MIT License * * Copyright (c) 2019 <NAME> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of ...
//! Calculate the crc64 checksum of the given data, starting with the given crc. //! //! Implements the CRC64 used by Redis, which is the variant with "Jones" coefficients and init value of 0. //! //! Specification of this CRC64 variant follows: //! //! ```text //! Name: crc-64-jones //! Width: 64 bites //! Poly: 0xad9...
use arbitrary::{Arbitrary, Unstructured}; use mkit::{ self, cbor::{Cbor, FromCbor}, Cborize, }; use std::{ cmp, fmt::{self, Display}, fs, io::{self, Read, Seek}, ops, result, vec, }; use crate::{entry, state, util, Error, Result}; pub struct Worker<S> { index: Vec<Index>, entr...
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors // SPDX-License-Identifier: MIT use std::{borrow::Cow, cell::Cell}; use crate::hash::{hash_entry, EntryHash, HashingError}; use crate::{kv_store::HashId, ContextKeyValueStore}; use self::{ storage::{BlobStorageId, Storage, TreeStorageId}, ...
use fixed_buffer::FixedBuf; use futures_io::{AsyncRead, AsyncWrite}; use futures_lite::{AsyncReadExt, AsyncWriteExt}; use std::pin::Pin; use std::task::{Context, Poll}; pub enum CopyResult { Ok(u64), ReaderErr(std::io::Error), WriterErr(std::io::Error), } impl CopyResult { #[allow(clippy::missing_error...
use ark_poly_commit::LinearCombination; use ark_std::{cfg_into_iter, format, marker::PhantomData, vec, vec::Vec}; #[cfg(feature = "parallel")] use rayon::prelude::*; use crate::prover::Prover; use crate::{Domain, Error, Field}; use super::Widget; pub(crate) struct ArithmeticWidget<F: Field, D: Domain<F>> { wire...
use super::{message::Request, ConsensusMessage, Error, Queue}; use crate::{ block_storage::BlockStorage, consensus::{LeaderTerm, SignatureList, TransactionApplier}, peer::{message as peer_message, Sender}, transaction_checker::TransactionChecker, world_state::WorldStateService, }; use futures::{stre...
use crate::GameState; use bevy::prelude::*; use crate::loading::TextureAssets; use rand::distributions::Standard; use rand::prelude::Distribution; use rand::{random, thread_rng, Rng}; pub struct MapPlugin; #[derive(SystemLabel, Eq, PartialEq, Hash, Clone, Debug)] pub enum MapSystemLabels { DespawnMapAndCamera, }...
// بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم // This file is part of Setheum. // Copyright (C) 2019-2021 Setheum Labs. // 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 a...
use std::alloc::System; use stats_alloc::{StatsAlloc, INSTRUMENTED_SYSTEM}; use abin::{Bin, BinSegment, NewStr, StrBuilder, StrFactory, StrSegment}; use utils::*; #[global_allocator] static GLOBAL: &StatsAlloc<System> = &INSTRUMENTED_SYSTEM; const STACK_MAX_LEN: usize = 3 * core::mem::size_of::<usize>() - 1; pub m...
//! This module implements the CIELUV color specification, which was adopted concurrently with //! CIELAB. CIELUV is very similar to CIELAB, but with the difference that u and v are roughly //! equivalent to red and green and luminance is then used to calculate the blue part. use color::{Color, XYZColor}; use coord::C...
use { crate::leader_schedule::LeaderSchedule, solana_runtime::bank::Bank, solana_sdk::{ clock::{Epoch, Slot, NUM_CONSECUTIVE_LEADER_SLOTS}, pubkey::Pubkey, }, std::collections::HashMap, }; /// Return the leader schedule for the given epoch. pub fn leader_schedule(epoch: Epoch, bank:...
use crate::pyobject::{PyObjectRef, PyResult, TryFromObject}; use crate::vm::VirtualMachine; use std::io; pub(crate) fn make_module(vm: &VirtualMachine) -> PyObjectRef { #[cfg(windows)] { let _ = unsafe { winapi::um::winsock2::WSAStartup(0x0101, &mut std::mem::zeroed()) }; } decl::make_module(v...
use std::collections::HashMap; use lru::LruCache; use skulpin::skia_safe::{TextBlob, Font as SkiaFont, Typeface, TextBlobBuilder, Data}; use font_kit::{source::SystemSource, metrics::Metrics, properties::Properties, family_name::FamilyName}; use skribo::{LayoutSession, FontRef as SkriboFont, FontFamily, FontCollection...
/// Collect messages from /dev/kmsg /// /// https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg use std::{ io::{self, Read}, time, }; use chrono::{TimeZone, Utc}; use event::{fields, LogRecord}; use serde::{Deserialize, Serialize}; use serde_yaml::Value; use tokio::io::AsyncReadExt; use crate::confi...
use crate::{vm::Opcode, JsString, Value}; use std::{convert::TryInto, fmt::Write, mem::size_of}; /// This represents wether an object can be read from [`CodeBlock`] code. pub unsafe trait Readable {} unsafe impl Readable for u8 {} unsafe impl Readable for i8 {} unsafe impl Readable for u16 {} unsafe impl Readable fo...
use std::collections::HashMap; use std::collections::HashSet; use std::fmt; /// A primary key for the node. Use an opaque id rather than an address as the /// id because addresses aren't unique. They can be reused over time, and if a /// host wipes its drives and comes back fresh, it might have the same address /// ...
// Copyright 2020-2021 <NAME> // SPDX-License-Identifier: Apache-2.0 use crate::{Btrit, RawEncoding, RawEncodingBuf, Trit, TritBuf, Trits, Utrit}; use num_traits::{AsPrimitive, CheckedAdd, CheckedSub, FromPrimitive, Num, Signed}; use core::cmp::PartialOrd; /// An error that may be produced during numeric conversion...
// 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 crate::error::NdkError; use crate::manifest::AndroidManifest; use crate::ndk::{Key, Ndk}; use crate::target::Target; use std::ffi::OsStr; use std::fs; use std::path::{Path, PathBuf}; use std::process::Command; pub struct ApkConfig { pub ndk: Ndk, pub build_dir: PathBuf, pub apk_name: String, pub as...
use futures::compat::Future01CompatExt; use std::{ collections::HashMap, hash::Hash, sync::{self, Arc}, }; type AsyncMutex = futures_locks::Mutex<()>; impl<T> Drop for MutexMapGuard<T> where T: Hash + Eq + Clone, { fn drop(&mut self) { // Drop guard: release lock, decrement internal refere...
#![feature(is_sorted)] use std::collections::HashMap; use std::sync::Arc; use std::time::{Duration, Instant}; use anyhow::Result; use log::{error, info, warn}; use tokio::sync::watch; mod discord; mod greendragon; mod lab; mod storage; // A number used to identify a build. Note that this isn't expected to identify ...
/*! Memory element descriptions. This module describes memory integers and processor registers used to hold and manipulate [`bitvec`] data buffers. The [`BitMemory`] trait adds descriptive information to the unsigned integers available in the language. The [`BitRegister`] trait marks the unsigned integers that corre...
use std::{cell::RefCell, iter}; use either::Either; use log::{debug, trace}; use rustc_middle::mir::{visit::Visitor, *}; use rustc_span::Span; use super::{mutation::ModularMutationVisitor, FlowResults}; use crate::{ block_timer, indexed::impls::LocationSet, mir::utils::{BodyExt, OperandExt, SpanExt}, source_m...
use crate::config::Flavor; use crate::error::DownloadError; use crate::network::request_async; use async_std::task; use chrono::prelude::*; use isahc::ResponseExt; use serde::{Deserialize, Serialize}; const CATALOG_URL: &str = "https://github.com/ajour/ajour-catalog/raw/master/catalog-2.0.json"; type Etag = Option<S...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct PartyRiskLimitsReport { /// MsgType = CM #[serde(flatten)] pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'C', 'M'>, /// ApplicationSequenceControl #[serd...
use super::*; use super::util::*; macro_rules! config_values { ($($perm_name:ident => $perm_token:ident),* $(,)*) => { fn perm_to_name(token: BotPermission) -> &'static str { match token { $(BotPermission::$perm_token => stringify!($perm_name),)* } } ...
// 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...
// Copyright 2019 The Exonum Team // // 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...
pub mod in_memory; pub mod lmdb; use std::collections::HashMap; use std::fmt; use std::hash::BuildHasher; use std::time::Instant; use contract_ffi::key::Key; use contract_ffi::value::account::PublicKey; use contract_ffi::value::{ProtocolVersion, Value, U512}; use engine_shared::logging::{log_duration, log_metric, GAU...
// Copyright 2017-2019 `multipart-async` Crate Developers // // 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 file may not be // copied, modified, or distribute...
use nile::{Tile, TilePath, TILE_PATHS}; use yew::prelude::*; use yewdux::{ component::WithDispatch, prelude::{DispatchProps, Dispatcher}, }; use super::state::{Action, GameStore, Rotation}; use crate::components::{ carbon_icon::{CarbonIcon, Size}, utils::update_if_changed, Button, RackTile, }; pub...
use { std::{ collections::HashSet, }, serde::{ ser::{Serialize, Serializer, SerializeSeq}, de::{self, Deserialize, Deserializer, Visitor, SeqAccess} }, bitflags::bitflags, itertools::Itertools, }; #[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, serde::Serialize, serde:...
use super::*; use crate::{data::*, logging::*, *}; use bytes::Bytes; use futures::{ prelude::*, stream::{SplitSink, SplitStream}, }; use serde::{de::DeserializeOwned, Serialize}; use std::{ marker::PhantomData, net::{IpAddr, Ipv4Addr}, time::Duration, }; use tokio::{net::*, time}; use tokio_util::{c...
use std::net::SocketAddr; use std::rc::Rc; use std::time::Duration; use error_chain::ChainedError; use futures::{Async, Future, IntoFuture, Poll, Sink, Stream}; use futures::{future, stream}; use futures::unsync::mpsc::unbounded; use tokio_core::net::TcpStream; use tokio_core::reactor::{Handle, Timeout}; use tokio_io:...
use crate::app_state::AppState; use crate::fetch_text; use crate::managers::scene::SceneManager; use crate::managers::{ EventManager, InputManager, InterfaceManager, OrbitManager, ResourceManager, SystemManager, }; use crate::STATE; use std::collections::HashMap; pub struct Engine { pub res_man: ResourceManage...
mod data; mod errors; mod model; use data::*; use errors::*; use std::convert::TryInto; use structopt::StructOpt; type Websocket = tungstenite::WebSocket<tungstenite::stream::MaybeTlsStream<std::net::TcpStream>>; #[derive(StructOpt)] struct Opt { video_hash_id: Option<String>, #[structopt(long)] limit: O...
use std::collections::{BTreeMap, HashSet}; use std::fmt; use std::mem; use std::str::FromStr; use failure::{format_err, Error, Fail}; use geometry::{BoundingBox, Point}; use crate::iterhelper::repeated_element; pub(crate) fn main() -> Result<(), Error> { use crate::input_to_string; let la: LumberArea = inp...
use std::fmt; use std::fmt::Display; /// Ordinal(T) wraps a value to be represented as an ordinal number. /// /// Since inner value is private, and provided implementations are just /// for a selected number of types, incl. i32, i64, u32, u64 and others /// it could be used only with numeric types that are Integers //...
#![allow(dead_code)] #![allow(unused_variables)] pub use lazy_static::*; use std::env::{ Args }; use regex::{ Regex }; use std::process::exit; const ERR_RED: &'static str = "\x1b[0;31mError\x1b[0m"; #[derive(Debug)] pub enum Quantity { Single, Multiple, } #[derive(Debug)] pub enum ArgumentType { Requir...
#![cfg_attr(debug_assertions, allow(dead_code, unused_imports))] #![allow(unused_imports)] use tracing::{debug, error, info}; mod active_session_pipe; #[cfg(feature = "enable_client")] mod client; mod core; mod lock_request; mod msg; mod recoverable_session_pipe; #[cfg(feature = "enable_server")] mod redirect; mod reg...
use std::io::{stdin, Read}; use std::fmt::{Display, Error, Formatter}; use std::collections::{HashMap, HashSet}; #[derive(Debug, Eq, PartialEq, Hash, Clone)] struct Grid(Vec<Vec<bool>>); impl Grid { fn new(string: &str) -> Grid { let mut outer_vec = Vec::new(); let lines = string.split('/'); ...
use azure_core::Context; use serde::{Deserialize, Serialize}; // Using the prelude module of the Cosmos crate makes easier to use the Rust Azure SDK for Cosmos. use azure_data_cosmos::prelude::*; use futures::stream::StreamExt; use std::borrow::Cow; use std::error::Error; // This is the stuct we want to use in our sam...
extern crate bincode; extern crate chrono; extern crate dotenv; extern crate fd_lock; extern crate serde; extern crate serde_json; extern crate systemstat; use chrono::prelude::{DateTime, Datelike, Utc}; use dotenv::dotenv; use fd_lock::RwLock; use serde::{Deserialize, Serialize}; use std::fs::OpenOptions; use std::io...
use serde::{ Deserialize, Serialize, }; use crate::BlockHeader; use crate::VecDataBlock; /// Data types representable in NgPre. #[derive(Serialize, Deserialize, PartialEq, Debug, Clone, Copy)] #[serde(rename_all = "lowercase")] pub enum DataType { UINT8, UINT16, UINT32, UINT64, INT8, ...
use std::sync::Arc; use vulkano::sync::GpuFuture; use vulkano::instance::Instance; use vulkano::instance::InstanceExtensions; use vulkano::instance::PhysicalDevice; use vulkano::instance::Features; use vulkano::instance::debug::Message; use vulkano::instance::debug::DebugCallback; use vulkano::instance::debug::MessageT...
use core::fmt::{Debug, Formatter, Result as FmtResult}; use core::time::Duration; use futures_util::StreamExt; use crate::actor::{Actor, ActorState, Handler}; use crate::object::{AnyObjectContainer, FutureObjectContainer}; use crate::receiver::Receiver; use crate::sender::WeakSender; use crate::util::{ channel::O...
use cursive::event::Key; use cursive::traits::*; use cursive_table_view::{TableView, TableViewItem}; use cursive::view::Margins; use cursive::views::{Dialog, SelectView}; use cursive::Cursive; use log::info; use std::cell::RefCell; use std::cmp::Ordering; use std::sync::Arc; use crate::app::App; use crate::func::im...
extern crate mumble_link; extern crate regex; use mumble_link::*; use regex::Regex; use std::io::{BufRead, BufReader, Read, Write}; use std::process::{Command, Stdio}; use std::path::PathBuf; // Function to convert errors to error strings so we can return that as a result. fn errstr<T>(e: T) -> String where T: ToStri...
use std::time::Duration; use metric_message::{ Counter, Gauge, Histogram, MetricWrapper, }; use metrics::{ GaugeValue, Key, Recorder, SetRecorderError, Unit, }; use prost::Message; use rdkafka::{ client::{ ClientContext, DefaultClientContext, }, producer:...
/* artifact: the requirements tracking tool made for developers * Copyright (C) 2018 <NAME> <@vitiral, <EMAIL>> * * The source code is Licensed under either of * * * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or * http://www.apache.org/licenses/LICENSE-2.0) * * MIT license ([LICENSE-MIT](L...
// This module may become a plugin in the future, but for now let's avoid the complexity // of dynamic loading. //! Compiler tactic for the metamath C language. //! //! See [`mmc.md`] for information on the MMC format. //! //! [`mmc.md`]: https://github.com/digama0/mm0/blob/master/mm0-rs/mmc.md mod parser; mod proof;...
use rand::Rng as _; use rand::SeedableRng as _; use ray_tracing_one_weekend::*; use rayon::prelude::*; use std::sync::Arc; fn ray_color<T>(r: &Ray, world: &T, depth: i32) -> Color where T: Hittable, { if depth <= 0 { return Color::new(0.0, 0.0, 0.0); } if let Some(rec) = world.hit(r, 0.001, f64...
use std::cmp::Ordering; use std::fs::File; use std::io; use std::io::BufRead; use itertools::{Itertools}; use compare::{Compare, natural}; use std::cmp::Ordering::{Less, Equal, Greater}; struct AuntSue { number: Option<i64>, children: Option<i64>, cats: Option<i64>, samoyeds: Option<i64>, pomerania...
use ash::vk; use fontdue::{Font, FontSettings, layout::{GlyphRasterConfig, Layout, LayoutSettings, TextStyle, WrapStyle}}; use std::{fs::File,io::Read}; use std::collections::HashMap; use std::ops::{Deref, DerefMut}; #[repr(C)] struct Vulkan { _opaque: [u8; 0] } impl Deref for Vulkan { type Target = Ft; f...
// Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 // Copyright 2015-2020 Parity Technologies (UK) Ltd. // This file is part of Parity Ethereum. //! Local Transactions List. use std::{fmt, sync::Arc}; use crate::pool::{ScoredTransaction, VerifiedTransaction as Transaction}; use c...
/* origin: FreeBSD /usr/src/lib/msun/src/e_acos.c */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunSoft, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freel...
use super::FunctionAnalyzer; use crate::data::{ast, error::SemanticError, hir::*, lex::Locatable, Location}; impl FunctionAnalyzer<'_> { #[inline(always)] fn expr(&mut self, expr: ast::Expr) -> Expr { self.analyzer.expr(expr) } pub(crate) fn parse_stmt(&mut self, stmt: ast::Stmt) -> Stmt { ...
use crate::assets::gltf::MeshAssetData; use crate::game_asset_lookup::{ GameLoadedAssetLookupSet, GameLoadedAssetMetrics, MeshAsset, MeshAssetInner, MeshAssetPart, }; use crate::phases::{OpaqueRenderPhase, ShadowMapRenderPhase}; use ash::prelude::VkResult; use atelier_assets::loader::handle::AssetHandle; use atelie...
use makepad_render::*; #[derive(Clone, DrawQuad)] #[repr(C)] pub struct DrawFloatSlider { #[default_shader(self::shader_slider)] base: DrawQuad, norm_value: f32, hover: f32, down: f32 } pub enum FloatSliderEvent { Change {scaled_value: f32}, DoneChanging, None } #[derive(Clone)] pub s...
use lazy_static::lazy_static; lazy_static! { /// When playing a sound effect, it takes one of these arrays depending on the selected sound effect /// index, then it toggles the speaker for (1/sample) seconds. Eg. for index 1, the speaker might be /// up for 1/1100 seconds, then down for 1/1200 seconds, then up for ...
// SPDX-License-Identifier: Apache-2.0 // This is WIP code, so I'm gonna hush a bunch of errors #![allow(dead_code)] use crate::config::{DeployConfig, HandleFrom}; use anyhow::{bail, Context, Result}; use wasmtime_wasi::sync::WasiCtxBuilder; /// The error codes of workload execution. #[derive(Debug)] pub enum Error ...
pub mod checker_result; pub mod executable_mock; use crate::context::Context; use crate::test_spec; use crate::test_spec::Test; use crate::tracer::stdio_redirecting::{Redirect, Redirector}; use crate::tracer::{tracee_memory, SyscallMock}; use crate::utils::short_temp_files::ShortTempFile; use crate::R; use checker_res...
extern crate iron; extern crate persistent; extern crate router; extern crate hyper; extern crate hyper_native_tls; extern crate serde; #[macro_use] extern crate serde_derive; extern crate serde_json; extern crate select; extern crate params; use iron::prelude::*; use iron::status; use iron::typemap::Key; use std::co...
#[cfg(feature = "interpolation")] use crate::deps::arraydeque::{ behavior, ArrayDeque, }; use crate::{ deps::na::{ Point3, Translation3, UnitQuaternion, Vector3, }, engine::GraphicsNode, theme::Color, world::{ Block, Object, Plane, ...
//! Utilities for tracking time. //! //! pub use self::instant::Instant; use futures::{future::poll_fn, select_biased, FutureExt}; use naive_timer::Timer; #[doc(no_inline)] pub use std::time::Duration; use std::{ future::Future, sync::{Arc, Mutex}, task::Poll, }; mod instant; pub(crate) struct TimeRuntim...
// Copyright 2022 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file contains bindings to convert from JSON to C++ base::Value objects. // The code related to `base::Value` can be found in 'values.rs' // and 'v...
use std::cmp::max; use std::time::{Duration, Instant}; /// Timestamp in us pub type TimeStamp = i32; /// Duration in us, e.g. RTT pub type TimeSpan = i32; #[derive(Copy, Clone, Debug)] pub struct TimeBase(Instant); impl TimeBase { pub fn new(start_time: Instant) -> Self { Self(start_time) } #[al...
extern crate git2; extern crate rustc_version; use std::fs::File; use std::io::Write; use std::path::Path; use git2::{DescribeFormatOptions, DescribeOptions, ErrorCode, Repository}; const ASCII_LOGO: &'static str = r#" `:+shmNNNNMMMMMMMMNMMNNNNNNmmdyo/. .+hNMMMMMMMMMMMN hNN...
/* Copyright 2019 Supercomputing Systems AG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
use std::env; use proc_macro::TokenStream; use quote::{quote, quote_spanned}; use syn::spanned::Spanned; use syn::{parse_macro_input, Data, DeriveInput, Error, Fields, Ident, Index}; fn lipo_crate() -> impl quote::ToTokens { if env::var("CARGO_PKG_NAME").unwrap() == "lipo" { quote! { crate } } else { ...
//! Data types for working with trees of files. //! //! The main type here is `FileTree` which represents //! such as the file listing for a store path. use memchr::memchr; use serde::{Deserialize, Serialize}; use serde_bytes::ByteBuf; use std::collections::HashMap; use std::io::{self, Write}; use std::str; use crate:...
use std::collections::HashMap; use chain::{Transaction, TransactionOutput, OutPoint}; use db::TransactionOutputProvider; use miner::{DoubleSpendCheckResult, HashedOutPoint, NonFinalDoubleSpendSet}; use verification::TransactionError; use super::super::types::{MemoryPoolRef, StorageRef}; /// Transaction output observer...
//! Error types. //! //! Some events are handled are errors so that they propagate upwards naturally, although //! technically they're not really errors: //! //! - [`ErrorKind::Unsat`] //! - [`ErrorKind::Timeout`] //! - [`ErrorKind::Unknown`] (when hoice gave up on solving the clauses) //! //! As such, one should **not...
use cosmwasm_std::{Addr, Uint128}; use cw20::Cw20ReceiveMsg; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct InstantiateMsg { /// LINK token address pub link: String, /// Amount of LINK paid to each oracle per ...
use sqlx::types::Decimal; use query_builder::{ AggregateFunction, AggregateFunctionCall, GroupConcatFunctionCall, NormalAggregateFunctionCall, OrderByItem, }; use crate::view::{ AddTag, AggregateViewItem, AggregateViewTag, ExprViewBoxWithTag, OffsetOfTag, SetBit, TagList, TagsOfValueView, True, Value,...
use super::{ actions::{ActionType, Action}, cards::{CardDeck, CardHand} }; use std::cmp::{min, max}; pub const NUM_ROUNDS: u32 = 1000; pub const STARTING_STACK: u32 = 200; pub const BIG_BLIND: u32 = 2; pub const SMALL_BLIND: u32 = 1; /// Encodes overall game progress #[derive(Debug, Clone, Copy)] pub struct G...
use super::*; pub struct TeleportIndicationSprite; pub struct TeleportIndicationComponent { timer: Timer, } pub fn remove_indications( mut commands: Commands, time: Res<Time>, mut indication_query: Query<(Entity, &mut TeleportIndicationComponent, &mut Children)>, indication_sprite_query: Query<&Te...
// #![feature(clone_from_slice)] extern crate hyper; extern crate libc; extern crate rustc_serialize; extern crate uuid; mod pwdb; use std::io::{self, Write}; use std::error::Error; use std::collections::{HashMap, BTreeMap}; use hyper::Server; use hyper::server::Request; use hyper::server::Response; use hyper::serv...
extern crate chrono; use std::sync::Arc; use std::net::*; use std::thread; use std::io::*; use std::str; use std::collections::HashMap; use std::path::PathBuf; use std::fs::File; use self::chrono::Local; use config; macro_rules! get { ( $expr : expr ) => { match $expr { Some(v) => v, ...
use crate::settings::Settings; use notify::DebouncedEvent; use notify::{watcher, RecursiveMode, Watcher}; use std::process::Command; use std::sync::mpsc::{channel, Receiver, Sender}; use std::sync::{Arc, Mutex}; use std::time::Duration; use walkdir::WalkDir; struct Job { path: std::path::PathBuf, config: Arc<S...
use timely::order::TotalOrder; use timely::dataflow::*; use timely::dataflow::operators::probe::Handle as ProbeHandle; use differential_dataflow::operators::*; use differential_dataflow::operators::arrange::ArrangeBySelf; use differential_dataflow::lattice::Lattice; use {Arrangements, Experiment, Collections}; // --...
use super::renderer; use gl::types::{GLint, GLsizeiptr, GLuint, GLvoid}; use rusttype::{point, Font, Scale}; #[derive(Copy, Clone, Debug)] struct Vertex { x: f32, y: f32, tx: f32, ty: f32, color: renderer::Color, } pub struct Text { vertices: Vec<Vertex>, vao: GLuint, vbo: GLuint, t...
//! SEC1 EC private key document. use crate::{DecodeEcPrivateKey, EcPrivateKey, EncodeEcPrivateKey, Error, Result}; use alloc::{borrow::ToOwned, vec::Vec}; use core::{convert::TryFrom, fmt}; use der::{Decodable, Encodable}; use zeroize::{Zeroize, Zeroizing}; #[cfg(feature = "pem")] use { crate::{pem, private_key:...
use libc::c_void; use libc::c_char; use std::slice::from_raw_parts; // for writing obj file use std::fs::File; use std::io::prelude::*; use std::io::LineWriter; use std::path::Path; //#[link(name = "animalclub")] #[allow(dead_code)] extern "C" { fn my_init(); fn my_exit(); //fn breed(seed: c_int, dna1: *m...
use std::hash::{Hash, Hasher}; use std::cmp::PartialEq; use std::mem; use std::rc::Rc; use std::cell::RefCell; use std::any::Any; use glium::glutin::{VirtualKeyCode, MouseButton, MouseScrollDelta, TouchPhase}; use Engine; use entity::Entity; use entity::component::PhysicsData; use util::{self, HashMap, HashSet}; #[de...