text
stringlengths
3.09k
13.9k
//! Types for the Global Descriptor Table and segment selectors. use bit_field::BitField; use core::fmt; use structures::tss::TaskStateSegment; use PrivilegeLevel; /// Specifies which element to load into a segment from /// descriptor tables (i.e., is a index to LDT or GDT table /// with some additional flags). /// /...
mod events; use crate::prelude::*; use crate::animation::physics; use crate::control::callback; use crate::display::camera::Camera2d; use crate::display::object::traits::*; use crate::display::Scene; use events::NavigatorEvents; use events::PanEvent; use events::ZoomEvent; // ====================== // === Navigat...
use ray::Ray3; use scene; use randomutil; use material; use hitable::Hitable; use cgmath::{ Vector3, InnerSpace, Zero, ElementWise, }; use std::{ io, path, fs, env, f32, thread, }; use std::sync::{ Arc, Mutex, }; use std::io::Write; use rand::{ Rng, thread_rng, }...
use std::{ future::Future, pin::Pin, task::{Context, Poll}, }; use futures::future::FusedFuture; use crate::{ requests::{HasPayload, Output, Request, Requester}, types::ChatId, }; /// Send requests automatically. /// /// Requests returned by `<AutoSend<_> as `[`Requester`]`>` are [`Future`]s /// ...
mod error; mod checksum; mod cmd_line; use std::fs::{OpenOptions, File}; use std::io::{Write, BufRead, BufReader, Read}; use std::path::{PathBuf, Path}; use std::sync::mpsc::channel; use anyhow::Result; use itertools::{join, Itertools}; use structopt::StructOpt; use threadpool::ThreadPool; use walkdir::{WalkDir, DirE...
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 use std::{io, result}; use kvm_ioctls::{DeviceFd, VmFd}; // Unfortunately bindgen omits defines that are based on other defines. // See arch/arm64/include/uapi/asm/kvm.h file from the linux kernel. const...
pub fn set_panic_hook() { // When the `console_error_panic_hook` feature is enabled, we can call the // `set_panic_hook` function at least once during initialization, and then // we will get better error messages if our code ever panics. // // For more details see // https://github.com/rustwasm/...
// 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 ...
use super::search_graph::DepthFirstNumber; use chalk_ir::debug; use chalk_ir::interner::Interner; use chalk_ir::{Canonical, ConstrainedSubst, Goal, InEnvironment, Substitution, UCanonical}; use std::fmt; pub type UCanonicalGoal<I> = UCanonical<InEnvironment<Goal<I>>>; /// The `minimums` struct is used while solving t...
use core::marker::PhantomData; use embassy::util::PeripheralBorrow; use embassy_extras::unborrow; use gpio::Pin; use crate::{gpio, pac, peripherals}; #[non_exhaustive] pub struct Config { pub baudrate: u32, pub data_bits: u8, pub stop_bits: u8, } impl Default for Config { fn default() -> Self { ...
/// This module contains source for the `generate` command. use exercise::Result; use serde_json::Value as JsonValue; use std::{ collections::HashMap, fs::{self, File, OpenOptions}, io::Write, path::Path, process::{Command, Stdio}, }; const GITIGNORE_CONTENT: &str = include_str!("defaults/gitignore...
//! Proposal Vote Record Account use borsh::maybestd::io::Write; use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; use shared::account::{get_account_data, MaxSize}; use solana_program::account_info::AccountInfo; use solana_program::program_error::ProgramError; use solana_program::{program_pack::IsInitializ...
//! S3 secret hunter in Rust. Avoid bandwidth costs, run this within a VPC! //! //! # Usage //! ```text //! berkshire_hog [FLAGS] [OPTIONS] <S3URI> <S3REGION> //! //!FLAGS: //! --caseinsensitive Sets the case insensitive flag for all regexes //! --entropy Enables entropy scanning //! ...
use crate::env::JniEnv; use crate::error::JniError; use crate::java_class::JavaClassExt; use crate::java_class::{FromObject, JavaClassSignature}; use crate::java_methods::JavaObjectArgument; use crate::object::Object; use crate::result::JavaResult; use crate::string::String; use crate::token::{Exception, NoException}; ...
// Copyright (c) 2017 tyr developers // // Licensed under the Apache License, Version 2.0 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT // license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. All files in the project carrying such notice may not be copied, // mo...
mod event; // mod tests; use std::{collections::HashMap, convert::Infallible, fmt::Debug}; use semver::Version; use tracing::{debug, error, warn}; use crate::{ components::{chainspec_loader::Chainspec, Component}, effect::{ announcements::DeployAcceptorAnnouncement, requests::StorageRequest, EffectBu...
use git2::{BranchType, Oid, Reference, Repository, Status, StatusOptions}; use lazy_static::lazy_static; use crate::configs::git_repo::Config; use crate::context::Context; use crate::segments::Segment; lazy_static! { static ref STATUS_CONFLICTED: Status = Status::CONFLICTED; static ref STATUS_UNSTAGED: Status...
// Copyright Materialize, Inc. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License...
use itertools::Itertools; use regex::Regex; use std::{collections::{HashSet, HashMap}, env, fs, cell::RefCell, rc::Rc}; const RULE_RE_STR: &str = r"(\d+): (.+)"; enum Rule<'a> { RuleRef(Vec<Vec<u8>>), Char(&'a str), } use Rule::*; type RulePossibilities = HashMap<u8, HashSet<String>>; type RuleTable<'a> = H...
use std::convert::TryFrom; #[cfg(feature = "symstore")] use super::symstore::SymbolStore; use super::offset_table::Win32OffsetFile; use super::{Win32Offsets, Win32OffsetsArchitecture}; use crate::kernel::{Win32Guid, Win32Version}; use crate::win32::Win32KernelInfo; use memflow::error::{Error, ErrorKind, ErrorOrigin...
// Copyright 2018 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
use tract_hir::internal::*; use crate::tfpb::tensorflow::tensor_shape_proto::Dim; use crate::tfpb::tensorflow::{TensorProto, TensorShapeProto}; use crate::tfpb::tensorflow::DataType; use std::convert::TryFrom; impl TryFrom<DataType> for DatumType { type Error = TractError; fn try_from(t: DataType) -> TractRe...
use js_sys::Error; use std::{fmt, str}; use wasm_bindgen::prelude::*; fn position(c: u8) -> u8 { c - b'a' } fn mask(c: u8) -> u32 { 1 << position(c) as u32 } #[wasm_bindgen] #[derive(Clone)] pub struct Word { letters: [u8; 5], bitmap: u32, } #[wasm_bindgen] impl Word { #[wasm_bindgen(constructor...
// Copyright (c) 2018-2020 MobileCoin Inc. //! PeerKeepalive is used to start a thread that periodically pings nodes we have not received an //! SCP statement from in a while. This allows nodes who have temporarily lost connectivity and //! came back online to re-sync with their peers. use crate::{ background_wor...
use rust_hdl_core::prelude::*; use rust_hdl_synth::yosys_validate; use rust_hdl_widgets::spi_master::{SPIConfig, SPIMaster, SPIWires}; use rust_hdl_widgets::spi_slave::SPISlave; #[derive(LogicBlock)] struct SPITestAsync { clock: Signal<In, Clock>, bus: SPIWires, master: SPIMaster<64>, } impl Logic for SPI...
use std::collections::HashMap; use std::slice::Iter; use bincode2; use cosmwasm_std::{ReadonlyStorage, StdError, StdResult, Storage}; use cosmwasm_storage::{PrefixedStorage, ReadonlyPrefixedStorage}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::geohash::{neighbors, GeoLocationTime}; use c...
use actix_web::{http::StatusCode, Error, HttpResponse}; #[derive(Clone, Debug, serde::Serialize)] pub struct MatrixError { #[serde(skip)] pub status: StatusCode, pub errcode: ErrorCode, pub error: String, } impl MatrixError { pub fn new(status: StatusCode, errcode: ErrorCode, error: &str) -> Self ...
// Copyright 2020 Shift Cryptosecurity 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 ...
use std::str::FromStr; #[derive(Clone)] struct Value { number: usize, depth: usize, } #[derive(Clone)] struct SnailfishNumber { values: Vec<Value>, } impl FromStr for SnailfishNumber { type Err = String; fn from_str(s: &str) -> Result<Self, Self::Err> { let mut snailfish_numbers = Snailf...
use std::cmp; use ns2_stat::input_types::{GameStats, WinningTeam}; use ns2_stat::Games; use crate::helpers; #[allow(dead_code)] mod balanced_partitioning { /// Computes the absolute difference of `a` and `b`. fn abs_diff(a: usize, b: usize) -> usize { if a < b { b - a } else { ...
use crate::{ container::Container, network::Network, node::Node, process::{Process, ProcessState, Stoppable}, system::System, Config, RUNTIME_ENV, }; use anyhow::{bail, Context, Result}; use log::debug; use serde_json::{json, to_string_pretty}; use std::{ fmt::{self, Display, Formatter}, ...
use std::{ collections::HashSet, io::Write, path::{Path, PathBuf}, sync::{Arc, Mutex}, time::Duration, }; use termcolor::{ColorChoice, ColorSpec, StandardStream, WriteColor}; use watchdir::{Event, FileType}; use crate::theme::Theme; macro_rules! write_color { ( $writer:expr, reset ...
use domo::public::dataset::{DataSet, Schema, Column}; use domo::public::Client; use log::debug; mod error; use error::Error; pub async fn find_or_create_campaign_dataset(dc: &Client) -> Result<String,Error> { let datasetname = "ActiveCampaign-Campaigns"; let mut myds: Option<String> = None; let mut offset...
use super::error::{QueryError, QueryExecutionError}; use crate::{data::graphql::SerializableValue, prelude::CacheWeight}; use graphql_parser::query as q; use serde::ser::*; use serde::Serialize; use std::collections::BTreeMap; use std::convert::TryFrom; use std::sync::Arc; fn serialize_data<S>(data: &Option<q::Value>,...
/// This is a tiny library to convert from codepoint offsets in a utf-8 string to byte offsets, and /// back. /// /// Its super weird that rust doesn't have anything like this in the standard library (as far as I /// can tell). You can fake it with char_indices().nth()... but the resulting generated code is /// *awful*...
//! PUBLISH use std::io::{self, Read, Write}; use crate::control::{ControlType, FixedHeader, PacketType}; use crate::packet::{DecodablePacket, PacketError}; use crate::qos::QualityOfService; use crate::topic_name::TopicName; use crate::{control::variable_header::PacketIdentifier, TopicNameRef}; use crate::{Decodable,...
use crate::data::channel; use std::convert::TryFrom; use std::fmt::{self, Display}; use std::str::FromStr; /// A wildcard Channel specifier. /// /// This type represents a value suitable for use with [wildcard subscribe] /// feature. /// /// Currently you can have up to three levels deep with your channel segment /// ...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{chained_bft::common::Round, state_replication::ExecutedState}; use canonical_serialization::{CanonicalSerialize, CanonicalSerializer, SimpleSerializer}; use crypto::{ hash::{CryptoHash, CryptoHasher, VoteDataHasher}, ...
use nix::sys::ptrace; use nix::sys::signal; use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus}; use nix::unistd::Pid; use std::process::Child; use crate::dwarf_data::{DwarfData}; // for milestone3 use std::collections::HashMap; // for milestone6 use nix::sys::signal::Signal; // for milestone6 #...
// Copyright 2017-2020 Parity Technologies (UK) Ltd. // This file is part of Tetcoin. // Tetcoin 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 l...
use cosmwasm_std::{Addr, Binary, Uint128}; use cw20::{Cw20ReceiveMsg, Expiration}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct InstantiateMsg { /// name of the Wrapping target token pub name: String, //...
extern crate tokio; extern crate quicr; #[macro_use] extern crate failure; #[macro_use] extern crate slog; extern crate slog_term; extern crate futures; #[macro_use] extern crate structopt; use std::net::ToSocketAddrs; use std::path::PathBuf; use futures::{Future, Stream}; use tokio::runtime::current_thread::Runtime;...
use structures::submission::FlairList; use structures::listing::Listing; use client::RedditClient; use responses::FlairSelectorResponse; use responses::user::{UserAbout as _UserAbout, UserAboutData}; use responses::listing::Listing as _Listing; use traits::Created; use errors::APIError; /// Interface to a Reddit user,...
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ //! Load a region from an AWS profile use crate::meta::region::{future, ProvideRegion}; use crate::provider_config::ProviderConfig; use aws_types::os_shim_internal::{Env, Fs}; use aws_types::region::Reg...
extern crate bls12_381; extern crate sha2; use std::{thread, str}; use std::net::{TcpListener, TcpStream, Shutdown}; use std::io::{Read, Write}; use std::fs; use bls12_381::{pairing, Scalar, G1Affine, G2Affine}; use hex::{encode, decode_to_slice}; use rand::Rng; use sha2::{Sha512, Digest}; fn keygen() -> (G1Affine, ...
use std::{ collections::{BTreeMap, HashMap}, fs::{self, File}, io::{Read, Seek}, path::Path, process::Command, sync::{Arc, Mutex}, thread::JoinHandle, time::Duration, }; use defmt_elf2table::{Location, Table}; use probe_rs::Session; use probe_rs_rtt::{DownChannel, Rtt, ScanRegion, UpCha...
// 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. //! Shared traits and methods to be used in test suite servers for tests that are executed as ELF //! components. use { crate::{ cases::TestCa...
use crate::{db, template}; use diesel::prelude::*; use failure::{format_err, ResultExt as _}; use hashbrown::{HashMap, HashSet}; use parking_lot::RwLock; use std::{ fmt, sync::{ atomic::{AtomicUsize, Ordering}, Arc, }, }; /// Local database wrapper. #[derive(Clone)] struct Database(db::Data...
//! `stork` is a simple futures-based library to recursively crawl //! sources in a search engine-like fashion. stork was designed from the //! ground to have a simple API that is easy to use and can be reused //! across multiple protocols, yielding each result giving end users the //! freedom to do BFS, DFS or any typ...
// //! Copyright 2020 Alibaba Group Holding Limited. //! //! Licensed under the Apache License, Version 2.0 (the "License"); //! you may not use this file except in compliance with the License. //! You may obtain a copy of the License at //! //! http://www.apache.org/licenses/LICENSE-2.0 //! //! Unless required by a...
use std::convert::{TryFrom, TryInto}; use std::mem; use std::panic::catch_unwind; use std::sync::{Arc, Mutex}; use bytes::{Buf, BufMut, Bytes, BytesMut}; use crate::error::*; use crate::serialization::*; pub(crate) const MARKER_SMALL: u8 = 0xCC; pub(crate) const MARKER_MEDIUM: u8 = 0xCD; pub(crate) const MARKER_LARG...
// This file originated from <NAME>'s Rust OS blog series. // Copyright 2015 <NAME>. Please see the original license: // https://github.com/phil-opp/blog_os/blob/master/LICENSE-MIT // This file has been modified from its original form. //! VGA Buffer Access //! //! This module provides the ability to write characters ...
use std::borrow::Cow; use std::fmt; use std::process::{Command, ExitStatus, Output}; use crate::errors::*; pub const STRIPPED_BINS: &[&str] = &[crate::docker::DOCKER, crate::docker::PODMAN, "cargo"]; pub trait CommandExt { fn print_verbose(&self, verbose: bool); fn status_result( &self, verbo...
use lazy_static::lazy_static; use std::env::{self, var}; use std::fmt::Display; const REDIS_URL_ENV_VAR: &str = "REDIS_URL"; const REDIS_PASSWORD_ENV_VAR: &str = "REDIS_PASSWORD"; const DATABASE_URL_ENV_VAR: &str = "DATABASE_URL"; const REDIS_PORT: &str = "6379"; const PG_PORT: &str = "5432"; const PG_DEFAULT_PASSWORD...
use hex; use sodiumoxide::crypto::auth; use sodiumoxide::crypto::hash::sha256::{Digest, hash}; use sodiumoxide::crypto::pwhash; use sodiumoxide::crypto::pwhash::scryptsalsa208sha256; use sodiumoxide::crypto::secretbox; use sodiumoxide::crypto::sign; use sodiumoxide::crypto::sign::ed25519::{PublicKey, SecretKey}; use so...
mod codec; mod events; mod inputs; mod outputs; mod proto; pub use self::codec::*; pub use self::events::*; pub use self::proto::*; use self::inputs::Inputs; use self::outputs::Outputs; use chashmap::CHashMap; use coco::Stack; use concurr::{slot_event, InsertJob, Job, Tokens}; use futures::{future, Future}; use num_c...
use crate::utils::*; use crate::Alignment; use unicode_width::UnicodeWidthStr as UniW; /// Wraps and aligns text. /// /// `width_or_options` can either be an integer or [textwrap::Options], /// see the documentation of `textwrap` for more information. /// /// There are four alignment modes : /// * `LEFT` doesn't mod...
// 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 { anyhow::Error, fuchsia_async as fasync, fuchsia_zircon::sys as zx_sys, fuchsia_zircon::{self as zx, HandleBased}, futures, st...
use std::convert::TryFrom; use std::{num::ParseIntError, cmp::PartialEq}; #[derive(Debug,Copy,Clone,PartialEq)] pub enum Protocol { HTTP, HTTPS, FTP, } impl TryFrom<Option<&str>> for Protocol { type Error = &'static str; fn try_from(s:Option<&str>) -> Result <Self,Self::Error> { ...
use lazy_static::lazy_static; use std::mem::MaybeUninit; use std::ops::Mul; use vector2d::Vector2D; const ATAN2_TABLE_BIT: u32 = 7; const ATAN2_N: usize = 1 << ATAN2_TABLE_BIT; const ATAN2_TABLE_OFFSET: usize = (ATAN2_N / 2 - 1) * (ATAN2_N / 2 - 2) / 2; const ATAN2_TABLE_LEN: usize = (ATAN2_N - 1) * (ATAN2_N - 2) / 2 ...
extern crate serde; use super::utils; use regex::Regex; #[derive(Debug, PartialEq)] pub enum VideoCodec { DIVX, XVID, H262, H263, H264, H265, } impl serde::Serialize for VideoCodec { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer, ...
//! Advent of Code - Day 12 "Subterranean Sustainability" Solution use error::Result; use indexmap::IndexMap; use regex::Regex; use sliding_windows::{IterExt, Storage}; use std::collections::{BTreeMap, HashMap}; use std::convert::TryFrom; use std::io::BufRead; pub fn find_solution<T: BufRead>(reader: T, second_star: b...
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use clap::Arg; use std::io; use std::io::{Error, ErrorKind, Read}; use mersenne_twister::MersenneTwister; use rand::distributions::{IndependentSample, Range}; use rand::{Rng, SeedableRng}; use std::cmp::min; use Connection; use Distribution; use LoadgenProto...
use super::*; use regex::Regex; use std::str::FromStr; const MAX_DIMENSION: u32 = 32; #[derive(Clone, Copy)] pub struct Border { forward: u32, backward: u32, } impl Border { fn from<I>(on_pixels: I) -> Self where I: ExactSizeIterator<Item = bool>, { let mut forward = 0; le...
use crate::options::{FtpsClientAuth, TlsFlags}; use rustls::{internal::pemfile, Certificate, NoClientAuth, NoServerSessionStorage, PrivateKey, ProtocolVersion, RootCertStore, ServerConfig, Ticketer}; use std::error::Error; use std::fmt; use std::fmt::Formatter; use std::fs::File; use std::io::BufReader; use std::path::...
use std::ops::{BitAnd, BitOr, BitXor}; #[derive(Clone, Copy, Debug, Default)] pub struct RippleCarryAdder { adders: [FullAdder; 8], } impl RippleCarryAdder { pub fn add(&mut self, a: u8, b: u8) -> Result<u8, &'static str> { for i in 0..self.adders.len() { /* The bits are extracted from the...
include!("../couchbase-sys/src/lib.rs"); // use ffi; use std::ffi::CString; use std::ffi::CStr; use std::str; // use libc; use std::mem::{ transmute, transmute_copy, }; use std::option::Option; // pub type lcb_store_callback = Option<extern "C" fn( // instance: lcb_t, // cookie: *const c_void, // ...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct QuoteAck { /// MsgType = CW #[serde(flatten)] pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'C', 'W'>, /// Contains the QuoteID(117) of a single Quote(35=...
use crate::colors::colors_manager::ColorsManager; use crate::config::{BucketIndexType, SortingHashType, SwapPriority}; use crate::hashes::HashableSequence; use crate::io::concurrent::intermediate_storage::{IntermediateReadsReader, SequenceExtraData}; use crate::io::concurrent::intermediate_storage_single::IntermediateS...
// This file is part of Sulis, a turn based RPG written in Rust. // Copyright 2018 <NAME> // // Sulis 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 yo...
extern crate int; extern crate bitrw; extern crate tbe; extern crate num_traits; pub trait UniversalSet { type T: int::UInt; fn size(self) -> Self::T; } /// pub trait OrderedSet { type T: int::UInt; /// 0 <= value_size() fn value_size(&self) -> Self::T; /// 0 <= size() <= value_size() fn s...
use super::super::geometry; use super::super::geometry::palette::Palette; use super::buffer; use super::command; use super::physical_device; use std::collections::HashMap; use std::os::raw::c_void; use ash::version::DeviceV1_0; const MAX_VERTICES: u64 = 10000; const MAX_INDICES: u64 = 1000000; pub struct MeshLocati...
use std::{ fs, ops::DerefMut, path::Path, sync::{ Arc, Mutex, MutexGuard, TryLockError, atomic::{Ordering, AtomicBool}, }, thread, }; use tantivy::{ directory::MmapDirectory, schema, Index, IndexWriter, Document, ReloadPolicy, query::QueryParser, collector::TopDocs, Tanti...
#![crate_name = "bindgen"] #![crate_type = "bin"] extern crate bindgen; #[macro_use] extern crate log; use bindgen::{Bindings, BindgenOptions, LinkType, Logger}; use std::io; use std::path; use std::env; use std::default::Default; use std::fs; use std::borrow::ToOwned; use std::process::exit; struct StdLogger; impl...
use geng::prelude::*; use std::collections::BTreeSet; pub mod game_state; pub mod lobby; mod menu; pub mod model; pub mod net; #[cfg(not(target_arch = "wasm32"))] pub mod server; pub use game_state::GameState; pub use lobby::*; use menu::*; pub use model::*; pub use net::*; #[cfg(not(target_arch = "wasm32"))] pub us...
use { crate::math::{Mat4, Vec2, Vec3, Vec4}, gfx_hal::pso::ShaderStageFlags, std::ops::Range, }; /// The push constant structs created by this macro implement Default and provide a reference to the /// underlying c-formatted data as a u32 slice. This makes it easy to use from our point of view and /// it p...
// Copyright 2018 The immense 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
use super::{protocol_adapter::GraphQLProtocolAdapter, GQLResponse}; use crate::{context::PrismaContext, PrismaResponse, PrismaResult}; use futures::FutureExt; use graphql_parser as gql; use indexmap::IndexMap; use query_core::{BatchDocument, CompactedDocument, Item, Operation, QueryDocument, QueryValue, ResponseData}; ...
use super::{ButtplugDeviceResultFuture, ButtplugProtocol, ButtplugProtocolCommandHandler}; use crate::core::errors::ButtplugDeviceError; use crate::device::{ButtplugDeviceEvent, DeviceSubscribeCmd, DeviceUnsubscribeCmd}; use crate::{ core::messages::{self, ButtplugDeviceCommandMessageUnion, DeviceMessageAttributesMap...
#![feature(proc_macro_hygiene)] use actix_web::{fs, middleware, server, App}; use clap::crate_version; use simplelog::{Config, LevelFilter, TermLogger}; use std::io::{self, Write}; use std::net::{IpAddr, Ipv4Addr, SocketAddr, ToSocketAddrs}; use std::thread; use std::time::Duration; use yansi::{Color, Paint}; mod arc...
extern crate crypto; use crate::crypto::symmetriccipher::BlockEncryptorX8; use crate::crypto::buffer::WriteBuffer; use crate::crypto::buffer::ReadBuffer; use crypto::aes::{self, KeySize}; use crypto::symmetriccipher::SynchronousStreamCipher; use std::iter::repeat; use crypto::blockmodes::CtrModeX8; use crypto::aessafe...
// Originally based on phpass, but they seemed to be // imitating the non-standard FreeBSD multipass md5, as described: // https://docs.rs/pwhash/0.3.0/pwhash/md5_crypt/index.html // except instead of: // $1${salt}${checksum} // We look like: // $P$[passes; 1][salt; 8]{checksum} pub mod error; use error::Error; use ran...
pub fn inner_arrays_1(arg: Vec<Vec<Vec<Vec<u8>>>>) -> Vec<Vec<Vec<Vec<u8>>>> { unimplemented!() } #[cfg(target_arch = "wasm32")] #[export_name = "inner_arrays_1"] #[no_mangle] #[doc(hidden)] #[allow(clippy::all)] pub unsafe fn __m_generated_wrapper_func_inner_arrays_1(arg_0: u32, arg_1: u32) { unsafe fn __m_gen...
use std::f32::consts; use std::sync::Arc; use crate::bounds::Bounds3f; use crate::interaction::{Interaction, SurfaceInteraction}; use crate::paramset::ParamSet; use crate::ray::Ray; use crate::sampling::concentric_sample_disk; use crate::shapes::Shape; use crate::{clamp, Normal3f, Point2f, Point3f, Transform, Vector3f...
use crate::{ common::{ help::lang, msg::{ reply, channel_message } }, collections::base::{ CONFUSION, CONFUSION_RU, OBFUSCATION, OBFUSCATION_RU }, collections::channels::AI_LEARN }; use serenity::{ prelude::*, model::{ channel::{ Message } , id::GuildId, id::UserId } }; use serenity::util...
use crate::util::compare_versions; use crate::util::leaf; use crate::Config; use crate::ScoopResult; use serde::Deserialize; use std::fs::OpenOptions; use std::fs::{DirEntry, File}; use std::io::Read; use std::path::Path; use std::path::PathBuf; /// A representation of an installed Scoop app. #[derive(Debug)] pub stru...
/* * Copyright 2019 Google LLC * Copyright 2021 CubeDev, 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required...
use anyhow::Context; pub(crate) struct Client { inner: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::Body>, user_agent: http::HeaderValue, } impl Client { pub(crate) fn new(user_agent: http::HeaderValue) -> Self { // Use this long form instead of just `hyper_rustls::Ht...
use feattle_core::persist::Persist; use feattle_core::Feattles; use std::sync::{Arc, Weak}; use std::time::Duration; use tokio::task::JoinHandle; use tokio::time::sleep; /// Spawn a tokio task to poll [`Feattles::reload()`] continuously /// /// A feattles instance will only ask the persistence layer for the current va...
use bcrypt::{DEFAULT_COST, hash, verify}; use gotham::handler::HandlerFuture; use gotham::handler::assets::FileOptions; use gotham::helpers::http::response::create_response; use gotham::middleware::state::StateMiddleware; use gotham::pipeline::single::single_pipeline; use gotham::pipeline::new_pipeline; use gotham::rou...
use crate::lonewolf::chapter::{Chapter, ChapterId}; use crate::lonewolf::choices::flatten_decision; use crate::lonewolf::combat::Memoz; use crate::lonewolf::data::order_chapters; use crate::lonewolf::mini::{max_hp, Flags}; use crate::lonewolf::mini::{CharacterConstant, CharacterVariable, Equipment, Flag, NextStep}; use...
use cargo::core::manifest::TargetSourcePath; use cargo::core::Edition; use failure::Fallible; use maplit::{btreeset, hashset}; use syn::visit::{self, Visit}; use syn::{Item, ItemMod, ItemUse, UseTree}; use std::collections::{BTreeSet, HashSet}; use std::path::Path; pub(crate) fn find_uses_lossy<'a>( src: &TargetS...
use std::fmt; use std::collections::{HashMap}; // ================================================== STRUCTS ================================================== #[derive(PartialEq, Copy, Clone)] enum SlotState { Emtpy, Filled } struct Image { infinite_slot: SlotState, slots: HashMap...
use std::boxed::Box; use std::default::Default; use std::ffi::{OsStr, OsString}; use std::fs::File; use std::mem; use std::path::Path; use std::ptr; use std::time::{Duration, Instant}; use std::thread; use flame; use sdl2; use sdl2::Sdl; use sdl2::audio::{AudioDevice, AudioSpecDesired}; use sdl2::keyboard::Scancode; ...
use crate::{ util::{range::NumRange, unit::Meter3}, world::{ generate::{Generate, TileBuilder, WorldBuilder}, hex::{HexAxialDirection, HexAxis, TilePoint, TilePointMap}, World, }, WorldConfig, }; use std::iter; /// Generate rainfall on each tile using a simulation of /// evapora...
//! //! The lexical token stream. //! pub mod comment; pub mod integer; pub mod string; pub mod symbol; pub mod word; use std::collections::VecDeque; use crate::lexical::error::Error; use crate::lexical::token::lexeme::identifier::Identifier; use crate::lexical::token::lexeme::literal::string::String as StringLitera...
extern crate utils; use std::error::Error; use std::io::{self, BufReader}; use std::io::prelude::*; use std::fs::File; use utils::*; #[derive(PartialEq, Eq, Clone)] struct Landscape { grid: Vec<Vec<char>>, w: usize, h: usize } impl Landscape { fn parse(input: &Vec<String>) -> Landscape { let ...
//! In-tree testing for deno integration. //! //! This module exists because this is way easier than using copying requires //! files. use anyhow::{Context, Error}; use std::{ collections::HashMap, fs::write, process::{Command, Stdio}, }; use swc_bundler::{Bundler, Load, Resolve}; use swc_common::{sync::Lrc...
// This file is part of Mathchain. // Copyright (C) 2017-2020 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...
#![no_main] #![no_std] use crazyflie2_stm_bootloader as _; // global logger + panicking-behavior + memory layout use cortex_m; use stm32f4xx_hal as hal; use crate::hal::{prelude::*, stm32, stm32::{interrupt, Interrupt}}; use stm32f4xx_hal::stm32::USART6; use core::cell::RefCell; use cortex_m::interrupt::Mutex; use...