text
stringlengths
7.05k
33.9k
use std::collections::HashMap; use std::convert::TryFrom; use std::ffi::CStr; use std::os::unix::io::RawFd; use crate::LOGGER; use slog::info; use goblin::elf::{header, section_header, Elf, SectionHeader, Sym}; use itertools::Itertools; use crate::bpf::*; use crate::error::*; use crate::set_memlock_limit; use crate:...
// // YANG - YANG core rules and enums. // Copyright (C) 2021 <NAME> // use std::collections::HashMap; use std::fmt; use super::error::*; use super::parser::*; use super::stmt::*; // Statement Parser initialization. lazy_static! { pub static ref STMT_PARSER: HashMap<Keyword, StmtParserFn> = { let mut m...
#[cfg(test)] extern crate bytes; extern crate rand; extern crate tars_stream; extern crate uuid; use bytes::Bytes; use rand::random; use std::collections::BTreeMap; use tars_stream::prelude::*; use uuid::Uuid; #[derive(Clone, Debug, PartialEq, PartialOrd)] struct TestStruct { a: i8, // tag 0 b: u16, ...
use crate::offline::print::pretty_print; use crate::*; use bitcoin::blockdata::opcodes; use bitcoin::blockdata::script::Builder; use bitcoin::consensus::serialize; use bitcoin::hashes::Hash; use bitcoin::secp256k1::{self, Message, Secp256k1, SignOnly}; use bitcoin::util::bip143::SighashComponents; use bitcoin::util::bi...
use std::path::{Path, PathBuf}; use std::fs::metadata; use std::borrow::Cow; use walkdir::{DirEntry, WalkDir, Error as WalkDirError}; use ansi_term::Colour; #[derive(Debug, Clone, PartialEq)] pub enum FileType { File, Dir, } #[derive(Debug, Clone, PartialEq)] pub struct Entry { pub path: PathBuf, pub...
use async_compat::CompatExt; use distant_core::{ Request, Session, SessionChannelExt, SessionDetails, SessionInfo, Transport, XChaCha20Poly1305Codec, }; use log::*; use smol::channel::Receiver as SmolReceiver; use std::{ collections::BTreeMap, io::{self, Write}, net::{IpAddr, SocketAddr}, path::...
#![cfg(feature = "parser")] //! Module for parsing the text representation of Azuki TAC into real code. //! //! An ANTLR specification of Azuki TAC's text representation can be found in //! `/docs/src/tac/AzukiTac.g4`. use std::{borrow::Cow, collections::BTreeMap, str::FromStr}; use crate::{ builder::FuncEditor, ...
mod vulkan; use crate::RendererError; use ash::{vk, Device, Instance}; use imgui::{Context, DrawCmd, DrawCmdParams, DrawData}; use mesh::*; use ultraviolet::projection::orthographic_vk; use vulkan::*; /// Convenient return type for function that can return a [`RendererError`]. /// /// [`RendererError`]: enum.Renderer...
use coarse_prof::profile; use malen::{ al::{self, ReverbNode, ReverbParams, Sound, SpatialPlayNode, SpatialPlayParams}, geom::{self, Circle, Shape}, particles::{Particle, Particles}, text::{Font, Text}, Color3, Color4, Context, Event, FrameError, InitError, Key, Profile, ProfileParams, }; use nalge...
// Copyright 2018 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT // http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD // https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied, // modified, or di...
use std::{f32, f64}; use std::ops::{Index}; #[cfg(test)] use std::collections::HashMap; use generate::{SoundGenerator, SoundParameters}; const TOTAL_SEMITONES: f32 = 120f32; const NOISESIZE: usize = 64; const TARGET_SAMPLE_RATE: f32 = 44100.0; const DECAY_TIME: f32 = 4096.0 / TARGET_SAMPLE_RATE; const...
use std::collections::HashMap; use std::sync::Arc; use std::task::Poll; use std::time::Duration; use failure::Error; use futures::{future::poll_fn, SinkExt, Stream}; use tokio::sync::oneshot; use crate::{ error::WampError, pollable::PollableValue, transport::{Transport, TransportableValue as TV}, uri:...
/* * Copyright 2019 The Starlark in Rust Authors. * Copyright (c) Facebook, Inc. and its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/lic...
use d4_framefile::mapped::{MappedDirectory, MappedStreamFrame}; use d4_framefile::mode::ReadOnly; use d4_framefile::Directory; use super::record::Record; use super::record_block::RecordBlock; use super::SimpleKVMetadata; use crate::stab::{RecordIterator, STablePartitionReader, STableReader}; use crate::Header; use st...
// Copyright 2021 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later ...
#[cfg(feature = "parallel")] use rayon::prelude::*; use std::env; use std::ffi::OsString; use std::path::{Path, PathBuf}; use std::process::Command; use std::process::Stdio; fn x86_triple(os: &str) -> (&'static str, &'static str) { match os { "darwin" | "ios" => ("-fmacho32", "-g"), "windows" | "u...
/// Shared channels. /// /// This is the flavor of channels which are not necessarily optimized for any /// particular use case, but are the most general in how they are used. Shared /// channels are cloneable allowing for multiple senders. /// /// High level implementation details can be found in the comment of the pa...
// Copyright 2019 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::Error, fuchsia_inspect::{ self, format::{ block::{Block, PropertyFormat}, block_type::BlockTy...
//! # Event //! //! The `event` module provides the functionality to read keyboard, mouse and terminal resize events. //! //! * The [`read`](fn.read.html) function returns an [`Event`](enum.Event.html) immediately //! (if available) or blocks until an [`Event`](enum.Event.html) is available. //! //! * The [`poll...
// This file is part of Substrate. // Copyright (C) 2017-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...
// // Sysinfo // // Copyright (c) 2015 <NAME> // use core_foundation::url::CFURLRef; use libc::{c_char, c_int, c_long, c_uchar, c_uint, c_ushort, c_void, size_t}; extern "C" { // #[no_mangle] pub static kCFAllocatorDefault: CFAllocatorRef; // #[no_mangle] // pub static kODSessionDefault: ODSessionRef;...
//! Multiverse //! //! This is a multi temporal store, where the timeline is accessible by HeaderId //! and multiple timelines are possible. //! //! For now this only track block at the headerhash level, and doesn't order them //! temporaly, leaving no way to do garbage collection use crate::chaintypes::{ChainLength, ...
use anyhow::Context; use anyhow::Result; use chashmap_async::CHashMap; use futures::future::BoxFuture; use futures::FutureExt; use futures::Stream; use futures::StreamExt; use model::CfdEvent; use model::EventKind; use model::FundingRate; use model::Identity; use model::Leverage; use model::OpeningFee; use model::Order...
use winapi::um::shellapi::{NIIF_NONE, NIIF_INFO, NIIF_WARNING, NIIF_ERROR, NIIF_USER, NIIF_NOSOUND, NIIF_LARGE_ICON, NIIF_RESPECT_QUIET_TIME}; use winapi::um::shellapi::{Shell_NotifyIconW, NOTIFYICONDATAW}; use super::{ControlBase, ControlHandle}; use crate::win32::base_helper::to_utf16; use crate::win32::window_helper...
pub mod event; pub mod generic_proto; pub mod message; use crate::config::ProtocolId; use crate::protocol::generic_proto::{GenericProto, GenericProtoOut}; use crate::utils::interval; use crate::{DiscoveryNetBehaviour, Multiaddr, PROTOCOL_NAME}; use crate::network_state::Peer; use bytes::{Bytes, BytesMut}; use future...
// Copyright 2017 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. //! Bindings for the Zircon fdio library #![deny(warnings)] #[allow(bad_style)] pub mod fdio_sys; pub use self::fdio_sys::fdio_ioctl as ioctl_raw; use {...
// Copyright 2015-2021 Swim 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 ...
#[cfg(feature = "hotload")] extern crate dynamic_reload; extern crate sdl2; extern crate cgmath; extern crate rand; extern crate imgui; //#[cfg(not(feature = "hotload"))] //extern crate minigame; #[cfg(feature = "hotload")] use dynamic_reload::{DynamicReload, Lib, Symbol, Search, PlatformName, UpdateState}; use std:...
use std::fmt; use rand::{thread_rng, Rng}; use std::io::{stdin, stdout, Write}; const P1_PLAY: bool = false; // player 1 is set to `false` for automated play to start const P2_PLAY: bool = true; // player 2 is set to `true` for manual play to start const P1: char = 'X'; // player 1's piece const P2: c...
//! Validation of quantifier-free ALL arithmetic SMT formulas. // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 use super::Constant; use amzn_smt_ir::{ logic::{ all::{Op, ALL}, ArithOp, }, try_break, visit::{ControlFlow, SuperVi...
/* Copyright (c) 2015-2020 The imgui-rs Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish...
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
#![feature(btree_drain_filter)] #![feature(map_first_last)] #![feature(map_try_insert)] use std::{ collections::{BTreeMap, BTreeSet, HashMap, HashSet}, env, fs, ops::{Neg, Sub}, }; #[allow(unused_imports)] use itertools::Itertools; use nom::{ bytes::complete::tag, character::complete::{char, digi...
#[macro_use] extern crate anyhow; #[macro_use] extern crate serde_derive; #[macro_use] extern crate lazy_static; pub mod error; pub mod conventional; pub mod git; pub mod hook; pub mod log; pub mod settings; use crate::conventional::commit::verify; use crate::error::ErrorKind::Semver; use crate::error::PreHookError;...
#![warn(missing_debug_implementations, rust_2018_idioms, unreachable_pub)] #![forbid(unsafe_code)] // deny warnings in CI #![cfg_attr(gotham_restful_deny_warnings, allow(renamed_and_removed_lints))] #![cfg_attr(gotham_restful_deny_warnings, deny(warnings))] // clippy doesn't like our code style #![cfg_attr(feature = "c...
#[macro_use] extern crate lazy_static; extern crate clap; extern crate dirs; extern crate regex; extern crate reqwest; use std::error::Error; use std::fs::File; use std::io::{BufRead, BufReader, BufWriter, Write}; use std::{env, io}; use clap::{App, Arg}; use regex::Regex; mod todo; use crate::todo::Todo; mod confi...
use std::path::{Path, PathBuf}; use std::fs::{self, File}; use std::io::{self, Write}; use std::os::unix; use quire::validate as V; use regex::Regex; use scan_dir::{self, ScanDir}; use serde_json::{Value as Json, from_reader}; #[cfg(feature="containers")] use unshare::{Command}; #[cfg(feature="containers")] use crate...
#[cfg(feature = "transport-custom")] pub mod custom_transport; pub mod event; use anyhow::{anyhow, bail, Error, Result}; #[cfg(feature = "transport-custom")] use custom_transport::Transport; use event::{Attachment, Event, MinEvent}; use futures_util::{future, FutureExt}; use reqwest::{header::HeaderMap, Client, Status...
use anyhow::{anyhow, bail, Context, Result}; use clap::{Clap, ValueHint}; use std::{convert::TryInto, io::prelude::*, path::PathBuf, str::FromStr, unreachable}; mod imageops; #[derive(Clap, Debug)] #[clap(long_about = r" Image-to-text converter ⠀⠀⠀⠀⠀⠀⠀⢠⣄⣠⣶⣤⣿⣤⣶⣄⣠⡄⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⣄⣸⣿⣾⡿⠿⠛⢿...
//! The translation machinery used to lift items into the context of the other crate for //! comparison and inference. use rustc::hir::def_id::DefId; use rustc::ty::{ParamEnv, Predicate, Region, TraitRef, Ty, TyCtxt}; use rustc::ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder}; use rustc::infer::InferCtxt; use rus...
use super::github_v3; use std::convert::{TryFrom, TryInto}; use crate as cincinnati; use self::cincinnati::plugins::prelude::*; use self::cincinnati::plugins::prelude_plugin_impl::*; use tokio::sync::Mutex as FuturesMutex; pub static DEFAULT_OUTPUT_WHITELIST: &[&str] = &[ "version", "channels/.+\\.ya+ml", ...
use gdk; use glib::object::Cast; use gtk::{ self, AdjustmentExt, BoxExt, ContainerExt, GridExt, LabelExt, ProgressBarExt, ScrolledWindowExt, ToggleButtonExt, WidgetExt, WidgetExtManual, GtkWindowExt, }; use sysinfo::{self, ComponentExt, NetworkExt, ProcessorExt, SystemExt}; use std::cell::RefCell; use std::ite...
use csv; use rust_htslib::bam; use serde_json; use std::collections::{HashMap, HashSet}; use std::cmp; use std::io::{BufReader, Read}; use std::str; use std::string::String; use utils; pub const RAW_FEATURE_BARCODE_TAG: &'static [u8] = b"fr"; pub const PROC_FEATURE_BARCODE_TAG: &'static [u8] = b"fb"; pub const FEA...
//! Wrapper around the Eden SCM directed acyclic graph implementation, which //! allows for efficient graph queries. use std::borrow::Borrow; use std::cmp::Ordering; use std::collections::HashMap; use std::convert::TryFrom; use std::iter::FromIterator; use eden_dag::ops::DagPersistent; use eden_dag::DagAlgorithm; use...
// Copyright (c) 2020 DDN. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. pub mod about; pub mod activity; pub mod dashboard; pub mod filesystem; pub mod filesystems; pub mod fs_dashboard; pub mod jobstats; pub mod login; pub mod logs; pub m...
//! Object file builder. //! //! Creates ELF image based on `Compilation` information. The ELF contains //! functions and trampolines in the ".text" section. It also contains all //! relocation records for linking stage. If DWARF sections exist, their //! content will be written as well. //! //! The object file has sym...
use assert_cmd::prelude::*; use futures::prelude::*; use http::{header::HeaderName, HeaderValue}; use influxdb_iox_client::connection::Connection; use sqlx::{migrate::MigrateDatabase, Postgres}; use std::{ net::SocketAddrV4, path::Path, process::{Child, Command}, str, sync::{ atomic::{Atomic...
// 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...
use std::{ fmt::{Debug, Display, Formatter}, ops::{Index, Range, RangeBounds}, }; use itertools::Itertools; use crate::{utils, Bell, IncompatibleStages, InvalidRowError, Row, RowBuf, Stage}; use super::DbgRow; /// A heap-allocated buffer of [`Row`]s which are required to have the same [`Stage`]. Collecting...
use std::num::NonZeroUsize; use std::time::Duration; use fnv::FnvHashMap; use futures::task::Poll; use wasm_timer::Instant; use crate::peers::PeersEncoding; use crate::rpc::IdBytes; use crate::{ kbucket::{Key, ALPHA_VALUE, K_VALUE}, rpc::{ io::VERSION, message::{Command, Message, Type}, ...
// Copyright 2020 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 { crate::zstd, anyhow::{Error, Result}, byteorder::{LittleEndian, ReadBytesExt}, log::info, serde::{Deserialize, Serialize}, st...
use codespan::{FileId, Files}; use codespan_reporting::diagnostic::{Diagnostic, Severity}; use codespan_reporting::term; use codespan_reporting::term::termcolor::{BufferWriter, ColorChoice, StandardStream}; use std::fs; use std::path::PathBuf; use std::process::Command; mod directives; mod snapshot; use self::directi...
#![forbid(unsafe_code)] use chipc_arena::Arena; use chipc_ast::{ Annotated, Ast, Expr as AstExpr, ExternItem, FunctionModifierKind, GenericArg as AstGenericArg, Item as AstItem, Literal as AstLiteral, PathStart as AstPathStart, StatementKind, StrLit, Type as AstType, VisibilityRestriction, }; use chipc_hir::{ ...
pub mod block_entity; pub mod player; use crate::ecs; use crate::ecs::{Entity, Filter, Manager, System}; use crate::entity::player::PlayerRenderer; use crate::entity::slime::{SlimeModel, SlimeRenderer}; use crate::entity::zombie::{ZombieModel, ZombieRenderer}; use crate::render::{Renderer, Texture}; use crate::world::...
use std::{ cmp::Ordering, collections::{BinaryHeap, HashMap}, mem::swap, time::Duration, }; use nalgebra::{vector, Isometry, UnitQuaternion}; use network::{Message, MessageSender}; use persistent::{Configuration, World}; use physics::{character_collider, RigidBodyType}; use protocol::{ DynamicSetup...
//! Detects a string literal, like `"Hello \"Rust\""` or `r#"Hello "Rust""#`. use super::super::lexeme::LexemeKind; const PLAIN: LexemeKind = LexemeKind::StringPlain; const RAW: LexemeKind = LexemeKind::StringRaw; const UNDETECTED: (LexemeKind, usize) = (LexemeKind::Undetected, 0); /// Detects a string literal, like...
//! Support for logging in the background. //! //! The [`AsyncLogger`] can wrap a logger and do the logging in a separate thread. Note that to not //! lose logs on shutdown, the logger needs to be flushed, either manually or using the //! [`FlushGuard`]. //! //! To integrate with the [`Pipeline`], the [`Background`] ca...
use rand; use rand::Rng; use std::collections::VecDeque; use common::{ParamType, MoveDestination}; use piston_window::*; pub enum Content { Number(u8), Mine(bool), // bool is true when this is the mine that caused you to loose the game. None, } struct Cell { content: Content, revealed: bool, m...
use crate::{AllocId, HeapPointer, Result, RuntimeError, RuntimeErrorTy}; use std::{alloc, collections::HashMap, mem, pin::Pin, ptr, slice}; mod collectable; pub use collectable::*; /// Gets the memory page size #[inline(always)] #[cfg(target_family = "unix")] pub(crate) fn page_size() -> usize { let val = unsafe ...
/*! Stress analysis in voxel worlds. * * Gravity constant is 1.0, so is the unit area. * * * ## Algorithm * * The algorithm calculates the static load in a system. * Static means that the system is in equilibrium * and the result applies to a single moment in time. * * Some assumptions for simplicity: * - a...
//! This example will actually be used during the dev process. extern crate fluffy_penguin; extern crate rand; use fluffy_penguin::cge::Network; use fluffy_penguin::genetic_algorithm::individual::Specimen; use fluffy_penguin::genetic_algorithm::Population; use rand::{thread_rng, Rng}; use std::fs; use std::path::Path...
use async_trait::async_trait; use futures::{ channel::oneshot, future::RemoteHandle, stream::{ self, Stream, StreamExt, }, }; use itertools::partition; use std::{ fmt, pin::Pin, sync::{ Arc, Mutex, }, task::{ Context, Poll, ...
use std::{ io::{self, Write}, ops, }; use super::{Backend, ClearType, MoveDirection, Size}; use crate::{ layout::Layout, style::{Attributes, Color}, symbols, }; #[derive(Debug, Clone, Copy, PartialEq, Eq)] struct Cell { value: Option<char>, fg: Color, bg: Color, attributes: Attribu...
// Copyright (c) 2018-2020 MobileCoin Inc. // The separated integration tests do not use all common code. // TODO: consider breaking out new_mesh and new_cyclic into separate integration code source. #![allow(dead_code)] use mc_common::{ logger::{log, o, Logger}, HashMap, HashSet, NodeID, }; use mc_consensus_...
// Built-in deps use std::convert::TryInto; use std::str::FromStr; // External deps use crate::franklin_crypto::bellman::pairing::bn256::Bn256; use crate::franklin_crypto::bellman::pairing::ff::ScalarEngine; use crate::franklin_crypto::bellman::pairing::ff::{ BitIterator, Field, PrimeField, PrimeFieldRepr, }; use c...
use std::cmp::{min, Ordering}; use std::iter::Iterator; use std::mem::size_of; use integer_encoding::{VarInt, VarIntWriter}; use crate::bloom::BloomFilterPolicy; use crate::Error; const U32_SIZE: usize = size_of::<u32>(); pub type BlockContents = Vec<u8>; /// A Data `Block` is an immutable ordered list of key/valu...
/* 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...
//! Manages entity ID allocation and deallocation. use std::any::Any; use std::collections::{BTreeSet, HashMap}; use std::sync::Arc; use parking_lot::Mutex; use rand::prelude::SliceRandom; use rand::Rng; use super::raw::Raw; use crate::entity::raw::Atomic; use crate::util::{self, DbgTypeId}; use crate::Archetype; p...
//! The implementation for Version 1 UUIDs. //! //! Note that you need to enable the `v1` Cargo feature //! in order to use this module. use crate::{Uuid, Version}; use atomic::Atomic; /// The number of 100 ns ticks between the UUID epoch /// `1582-10-15 00:00:00` and the Unix epoch `1970-01-01 00:00:00`. const UUID...
/*! A example on how to use the `PlottingCanvas` for rendering figures, plots, and charts in native-windows-gui. To run: `cargo run --example plotting_d --features "plotting"` */ extern crate native_windows_derive as nwd; extern crate native_windows_gui as nwg; use nwd::NwgUi; use nwg::stretch::{ geometry...
use crate::imports::Imports; use crate::instance::{Instance, InstanceHandle, RuntimeMemoryCreator}; use crate::memory::{DefaultMemoryCreator, Memory}; use crate::table::Table; use crate::traphandlers::Trap; use crate::ModuleRuntimeInfo; use crate::Store; use anyhow::Result; use std::alloc; use std::any::Any; use std::c...
// Copyright 2020 ZomboDB, LLC <<EMAIL>>. All rights reserved. Use of this source code is // governed by the MIT license that can be found in the LICENSE file. extern crate build_deps; use bindgen::callbacks::MacroParsingBehavior; use eyre::{eyre, WrapErr}; use pgx_utils::pg_config::{PgConfig, PgConfigSelector, Pgx};...
use std::ffi; use std::io; use std::iter::repeat; use std::mem; use std::slice; use bytes::BytesMut; use slog; use crate::transport::{Decoder, Encoder}; use uhid_sys as sys; quick_error! { #[derive(Debug)] pub enum StreamError { Io(err: io::Error) { from() } UnknownEventTy...
use std::cmp; use std::fmt::{self, Display, Formatter}; use std::num::ParseIntError; use std::str::{from_utf8_unchecked, FromStr}; use std::time::{Duration, SystemTime, UNIX_EPOCH}; use crate::Error; /// HTTP timestamp type. /// /// Parse using `FromStr` impl. /// Format using the `Display` trait. /// Convert timesta...
//! Define `StaticlibArtifact` to allow compiling and instantiating to be //! done as separate steps. use crate::engine::{StaticlibEngine, StaticlibEngineInner}; use crate::serialize::{ModuleMetadata, ModuleMetadataSymbolRegistry}; use enumset::EnumSet; use std::collections::BTreeMap; use std::error::Error; use std::m...
//! Items related to the **Frame** type, describing a single frame of graphics for a single window. use crate::color::IntoLinSrgba; use crate::vk::{self, DeviceOwned}; use std::error::Error as StdError; use std::sync::Arc; use std::{fmt, ops}; pub mod raw; pub use self::raw::{AddCommands, RawFrame}; /// The vulkan ...
use crate::abi; use crate::abi::internal::{ add_sign_to_message, add_sign_to_message_body, create_tvc_image, result_of_encode_message, }; use crate::abi::{Abi, Error, FunctionHeader, Signer}; use crate::boc::internal::get_boc_hash; use crate::client::ClientContext; use crate::encoding::{account_decode, account_enco...
//! # Machiavelli //! //! A simple machiavelli card game *(work in progress)* use std::io::{ stdin, Write }; pub mod sequence_cards; pub mod table; pub mod sort; pub mod encode; pub mod lib_server; pub mod lib_client; pub use sequence_cards::*; pub use table::*; /// number of cards to take when resetting pub const ...
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. use crate::compiler::compile_async; use crate::compiler::ModuleMetaData; use crate::errors::DenoError; use crate::errors::RustOrJsError; use crate::js_errors; use crate::msg; use crate::state::ThreadSafeState; use crate::tokio_util; use deno; us...
// Copyright 2017 Google Inc. All rights reserved. // // 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...
//! Support for the management of the schemas and tables we create in //! the database for each deployment. The Postgres schemas for each //! deployment/subgraph are tracked in the `deployment_schemas` table. //! //! The functions in this module are very low-level and should only be used //! directly by the Postgres st...
use std::future::Future; use std::sync::{ atomic::{AtomicU32, Ordering}, Arc, }; use serde::Deserialize; use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt}; use tokio::net::{TcpListener, TcpStream}; use tokio::sync::{broadcast, mpsc, Semaphore}; use tokio::time::{timeout, Duration}; use tokio_rustls::rustls...
use easy_error::{bail, Error}; use fxhash::FxHashSet; use std::mem::take; use swc_common::pass::{Repeat, Repeated}; use swc_common::DUMMY_SP; use swc_ecmascript::ast::*; use swc_ecmascript::utils::ident::IdentLike; use swc_ecmascript::visit::FoldWith; use swc_ecmascript::{ utils::{Id, HANDLER}, visit::{noop_fol...
use super::{ lattice::Lattice, trainer::UnigramTrainer, trie::{Trie, TrieBuilder}, }; use crate::tokenizer::{Model, Result, Token}; use crate::utils::cache::Cache; use std::collections::HashMap; use std::convert::TryInto; use std::fs::read_to_string; use std::path::{Path, PathBuf}; type TokenMap = HashMap...
//! Special utility that allows you to fix paths to resources. It is very useful if you've //! moved a resource in a file system, but a scene has old path. use crate::{make_scene_file_filter, Message}; use rg3d::{ asset::ResourceData, core::{ color::Color, futures::executor::block_on, p...
// Copyright 2016 The xi-editor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
// Copyright 2021 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 crate::spinel::Subnet; use anyhow::{Context as _, Error}; use core::num::NonZeroU16; use core::ops::{Deref, DerefMut}; use packet::ParsablePacket; use ...
#![feature(stmt_expr_attributes)] #![allow(non_snake_case)] #[cfg(not(target_family = "windows"))] use std::os::unix::ffi::OsStrExt; #[cfg(target_family = "windows")] use std::os::windows::ffi::OsStrExt; use onnxruntime_sys::*; // https://github.com/microsoft/onnxruntime/blob/v1.4.0/csharp/test/Microsoft.ML.OnnxRunt...
use bytes::{BufMut, Bytes, BytesMut}; use crossbeam::channel; use futures::{ channel::mpsc::{self, Receiver, Sender}, StreamExt, }; use futures_timer::Delay; use kvproto::{ metapb, pdpb::{self, Member, RegionHeartbeatRequest, RegionHeartbeatResponse, StoreStats}, }; use parking_lot::Mutex; use protobuf:...
use std::cmp::max; use std::cmp::min; use std::collections::BTreeMap; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; use tuikit::prelude::{Event as TermEvent, *}; ///! Handle the selections of items use crate::event::{Event, EventHandler, UpdateScreen}; use crate::global::current_run_num; use cra...
/// Specifies how to process the `ConverseRequest` messages. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConverseConfig { /// *Required* Specifies how to process the subsequent incoming audio. #[prost(message, optional, tag="1")] pub audio_in_config: ::core::option::Option<AudioInConfig>, /...
use std::collections::HashMap; use std::fmt::Write; use super::lir::types::*; use super::error::*; struct GlobalRegistry { var_ids: HashMap<String, usize>, } impl GlobalRegistry { fn new(vars: &[String]) -> Self { GlobalRegistry { var_ids: vars.iter().enumerate() .map(|(i...
//! GBuffer Layout: //! //! RT0: sRGBA8 - Diffuse color. //! RT1: RGBA8 - Normal (xyz) + specular (w) //! RT2: RGBA8 - Ambient light + emission //! RT3: R8UI - Decal mask use crate::{ core::{ algebra::{Matrix4, Vector2, Vector4}, arrayvec::ArrayVec, color::Color, math::Rect, ...
use std::{ fs::File, io::{self, Read}, path::{PathBuf, Path}, }; use std::ffi::OsStr; use super::{Layer, read_xb, Position, DosChar, ParseStates, read_binary, display_ans, display_PCBoard, display_avt, TextAttribute, Size, UndoOperation, Palette, SauceString, Line, BitFont, SaveOptions }; #[repr(u8)] #[...
use super::metadata::*; use crate::plan::TransitiveClosure; use crate::policy::space::CommonSpace; use crate::policy::space::SFT; use crate::util::constants::BYTES_IN_PAGE; use crate::util::heap::layout::heap_layout::VMMap; use crate::util::heap::PageResource; use crate::util::malloc::*; use crate::util::metadata::side...
// Copyright 2015 <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 those...
use gre::base_a4_landscape; use noise::*; use std::f64::consts::PI; use svg::node::element::path::Data; use svg::node::element::*; use clap::*; pub struct Opts { pub seed: f64, pub opacity: f64, pub opacity_fade: f64, pub sdivisions: usize, pub lines: usize, pub sublines: usize, pub osc_amp:...
use crate::{static_cast_i32, static_cast_u32, Stage1Parse}; #[cfg(target_arch = "x86")] use std::arch::x86::{ __m128i, _mm_add_epi32, _mm_and_si128, _mm_cmpeq_epi8, _mm_cmpgt_epi8, _mm_loadu_si128, _mm_max_epu8, _mm_movemask_epi8, _mm_or_si128, _mm_set1_epi8, _mm_set_epi32, _mm_setr_epi8, _mm_setzero_si128,...
use anyhow::{Context, Result}; use filesystem; use std::collections::BTreeMap; use std::fs; use std::path::{Path, PathBuf}; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)] #[serde(untagged)] pub enum UnixUser { Uid(i32), Name(String), } #[derive(Debug, Clone, Serialize, Parti...
// Copyright 2020 The xi-editor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...