text
stringlengths
7.05k
33.9k
use std::{ collections::{BTreeMap, HashMap, VecDeque}, future::Future, io::{self, Cursor}, mem, pin::Pin, sync::{Arc, Mutex}, task::{Context, Poll, Waker}, }; use bytes::BytesMut; use futures::{io::AsyncRead, Stream}; use quinn::{IncomingBiStreams, IncomingUniStreams, RecvStream, SendStream...
// Copyright 2018 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::{anyhow, Context as _, Error}, async_lock::RwLock as AsyncRwLock, cobalt_client::traits::AsEventCode as _, cobalt_sw_delivery_...
use crate::objects::*; use rtbvh::aabb::Bounds; use rtbvh::{Ray, RayPacket4, AABB}; use std::fmt::Display; use glam::f32::Vec3A; #[cfg(feature = "object_caching")] use serde::{Deserialize, Serialize}; #[cfg_attr(feature = "object_caching", derive(Serialize, Deserialize))] #[derive(Debug, Copy, Clone, Eq, PartialEq)...
//! Functions to download or load directory objects, using the //! state machines in the `states` module. use std::{ collections::HashMap, sync::{Arc, Weak}, time::{Duration, SystemTime}, }; use crate::{ docid::{self, ClientRequest}, upgrade_weak_ref, DirMgr, DirState, DocId, DocumentText, Error, ...
//////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2018, the Perspective Authors. // // This file is part of the Perspective library, distributed under the terms // of the Apache License 2.0. The full license can be found in the LICENSE // file. use super::active_colu...
use crate::attr::Attributes; use crate::utils::err; use proc_macro2::Span; use proc_macro2::TokenStream; use proc_macro2::TokenTree; use quote::quote; use syn::punctuated::Punctuated; use syn::AttributeArgs; use syn::Error; use syn::Expr; use syn::Item; use syn::ItemFn; use syn::Result; use syn::Token; use syn::Type; ...
// This file imports semver 0.10.0's test suite, to protect against regressions. // https://github.com/steveklabnik/semver/blob/afa5fc853cb4d6d2b1329579e5528f86f3b550f9/src/version.rs#L384-L871 mod version { #[test] fn test_parse() { assert!(!semver::valid("")); assert!(!semver::valid(" ")); ...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 //! This module supports translations of specifications as found in the move-model to //! expressions which can be used in assumes/asserts in bytecode. use std::collections::{BTreeMap, BTreeSet}; use itertools::Itertools; use move_mo...
//! **Deprecation:** The [`blake2b_simd`](https://crates.io/crates/blake2b_simd) //! and [`blake2s_simd`](https://crates.io/crates/blake2s_simd) crates have //! better performance than this one, with the added benefit of being pure //! Rust. This library is deprecated. //! //! `blake2_c` is a safe Rust wrapper around t...
use std::convert::TryInto; use std::{collections::hash_map::Iter, fmt::Debug, io::prelude::*, iter, path::Path}; use std::{ collections::HashMap, fs::{self, File}, hash::Hash, io::BufReader, marker::PhantomData, mem, path::PathBuf, }; use anyhow::Result; use bincode::Serializer; use iter::M...
use Error; use std; use key; use super::{Encryption, pkcs_unpad}; use yasna; use yasna::BERReaderSeq; use openssl::symm::{encrypt, decrypt, Cipher}; use openssl::hash::MessageDigest; use openssl::rand::rand_bytes; use bit_vec::BitVec; use std::borrow::Cow; use key::SignatureHash; use openssl::pkey::Private; use openssl...
use uom::si::f64::{Angle, Length, Pressure, ThermodynamicTemperature, Velocity}; macro_rules! enum_with_str_repr { ( $(#[$enum_attr:meta])* $ident: ident { $( $(#[$variant_attr:meta])* $variant: ident => $val: literal $(| $alt: literal)*, )* ...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 01/05/2018 Last Modified: 13/10/2018 License: MIT */ use crate::na::{DMatrix, DVector}; use whitebox_raster::*; use whitebox_common::rendering::html::*; use crate::tools::*; use whitebox_vector::{FieldData, ShapeType, S...
// Copyright 2021 The sdcons 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 agree...
use permutohedron::heap_recursive; use rayon::prelude::*; use Mode::*; use Op::*; const DEFAULT_INPUT: isize = 1; const PRINT_OPS: bool = false; pub(crate) fn day7_part1() -> isize { max_thrust_in_serial_mode(day07_puzzle_input()) } pub(crate) fn day7_part2() -> isize { max_thrust_in_feedback_loop_mode(day07...
#[macro_use] mod utils; use std::{convert::TryInto, sync::Arc}; use wabt::wat2wasm; use wasmer::compiler::{compile_with, compiler_for_backend, Backend}; use wasmer::error::RuntimeError; use wasmer::units::Pages; use wasmer::wasm::{ DynFunc, Func, FuncSig, Global, Instance, Memory, MemoryDescriptor, Type, Value, };...
use std::{ fmt::{self, Debug}, ptr::NonNull, time::{Duration, Instant}, }; use num_enum::{IntoPrimitive, TryFromPrimitive}; use winapi::{ shared::{ minwindef::DWORD, ntdef::LONG, windef::{HWINEVENTHOOK, HWINEVENTHOOK__, HWND, HWND__}, }, um::{sysinfoapi::GetTickCount, wi...
use core::{ borrow::Borrow, fmt, iter::Sum, ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; use blst::*; use ff::Field; use group::Group; use rand_core::RngCore; use subtle::{Choice, ConstantTimeEq}; use crate::to_limb; use crate::{fp::Fp, fp12::Fp12, fp2::Fp2, fp6::Fp6, traits::Compres...
use std::{ collections::{hash_map::Entry, HashMap, HashSet}, net::SocketAddr, sync::Arc, task::Poll, }; use crate::{ bprotocol::{ self, CompactNodeInfo, CompactPeerInfo, FindNodeRequest, GetPeersRequest, Message, MessageKind, Node, }, routing_table::{InsertResult, RoutingTab...
//! The triangle primitive. mod points; mod scanline_intersections; mod scanline_iterator; mod styled; use crate::{ geometry::{Dimensions, Point}, primitives::{ common::{LineJoin, LineSide, LinearEquation, Scanline, StrokeOffset}, ContainsPoint, Line, PointsIter, Primitive, Rectangle, }, ...
#![allow(dead_code)] extern crate rand; extern crate num_cpus; extern crate byteorder; // see http://www.wikihow.com/Play-Kalaha for the description of the game use std::io::*; use std::fs::File; use std::cmp; //use std::io::prelude::*; use rand::Rng; use std::thread; use std::sync::*; use std::collections::*; use by...
// Copyright 2015 <NAME> and the gl-rs developers // // 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 ...
//! Decision feedback equalizer and slicer //! //! The decision feedback equalizer (DFE) performs the //! following operations: //! //! 1. Channel impulse response estimation //! 2. Hard decision slicing //! 3. Bits to bytes //! //! The [`Equalizer`] operates on //! two samples per symbol and collects estimated symbols...
use crate::types::tag::TagType; #[allow(unused_imports)] use std::collections::HashMap; #[allow(unused)] macro_rules! first_key { ($key:tt $(| $remaining:expr)*) => { $key }; } #[allow(unused)] pub(crate) use first_key; // This is used to create the key/ItemKey maps // // First comes the feature attribute, foll...
use crate::metrics::F64; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; use std::collections::BTreeMap; use std::fmt; pub enum Stats { Mean, COV, // coefficient of variation MDTM, // mean distance to mean } // TODO maybe use https://docs.rs/hdrhistogram/7.0.0/hdrhistogram/ #[derive(Default,...
#![allow(clippy::rc_buffer)] mod build_manifest; mod config; mod sign; mod smoke_test; use std::fs::{self, File, OpenOptions}; use std::io::{self, Read}; use std::path::{Path, PathBuf}; use std::process::Command; use std::time::Instant; use std::{collections::HashSet, env}; use crate::build_manifest::BuildManifest; ...
use std::mem; use num::{Zero, One, Signed}; use matrixmultiply; use alga::general::{ClosedMul, ClosedAdd}; use core::{Scalar, Matrix, Vector}; use core::dimension::{Dim, U1, U2, U3, U4, Dynamic}; use core::constraint::{ShapeConstraint, SameNumberOfRows, SameNumberOfColumns, AreMultipliable, DimEq}; use core::storage::...
// 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. //! This crate provides helper functions to collect test diagnostics. use { anyhow::Context as _, fidl::handle::AsHandleRef, futures::{ ...
// Copyright 2019 The Chromium OS 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 std::cmp::min; use std::fmt; use std::mem::size_of; use std::result::Result; use rand_core::{Error, ErrorKind, RngCore}; /// A random number gene...
use kicad_parse_gen::schematic as kicad_schematic; use std::collections::HashMap; use std::path::Path; use crate::error::{errorf, DynamicResult}; use crate::types::*; // All symbols in Eeschema files have a mandatory value field which is used for the primary // unit of the component (i.e. resistance for a resistor, c...
use crate::{ blockchain::chains::{Blockchain, EthereumChainId}, ethereum::EthereumAddress, migration::{ source::{ common::add_to_vault, json_data::{AddressBookItem, KeyFileV2}, }, types::{Migrate, MigrationError, MigrationResult}, }, storage::{ ...
/* * Copyright (c) 2016-2017 Boucher, Antoni <<EMAIL>> * * 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, mod...
/* /// Data Structures related to a user account. /// /// users.rs /// ├── User: Strict /// ├── UserDoc: Struct /// ├── UserVocab: Struct /// └── UserVocabList: Struct */ use chrono::Utc; use crate::{ DatabaseItem, scrape_text_from_url, auth::str_to_hashed_string, config::{USER_COLL_NAME, USER_DOC_COL...
use std::{ fs::{self, File}, io::prelude::*, ops::Deref, path::PathBuf, sync::{Arc, Mutex}, }; use std::clone::Clone; use std::sync::MutexGuard; use enigma_tools_m::keeper_types::{InputWorkerParams, EPOCH_CAP}; use ethabi::{Log, RawLog}; use failure::Error; use rmp_serde::{Deserializer, Serializer}...
use crate::math::{ quaternion::Quaternion, vector3::Vector3, }; const ELEMENT_NUM: usize = 16; type Elements = [f32; ELEMENT_NUM]; pub struct Matrix4 { } impl Matrix4 { pub fn create() -> Elements { let mut elements = [0.0; ELEMENT_NUM]; Self::identity(&mut elements); elements } pub fn identity(m: &mut E...
use crate::{ absm::{ canvas::{AbsmCanvas, AbsmCanvasMessage}, command::{AbsmCommand, AbsmCommandStack, AbsmEditorContext}, document::Document, inspector::Inspector, menu::{ context::{CanvasContextMenu, NodeContextMenu}, Menu, }, message...
//! libvpx FFI wrapper. use std::u16; use std::fmt; use std::ptr; use std::mem; use libc::{c_int, c_uint, c_long, c_void, c_uchar}; // Safe wrapper. #[derive(Debug)] pub struct Error(vpx_codec_err_t); impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { ...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
use crate::handle::{Handle, HandleRights}; use crate::sys::osdir::OsDir; use crate::sys::{fd, AsFile}; use crate::wasi::types; use crate::{Error, Result}; use std::convert::TryFrom; use std::ffi::{OsStr, OsString}; use std::fs::{self, Metadata, OpenOptions}; use std::os::windows::ffi::{OsStrExt, OsStringExt}; use std::...
/// Tx is the standard type used for broadcasting transactions. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Tx { /// body is the processable content of the transaction #[prost(message, optional, tag = "1")] pub body: ::core::option::Option<TxBody>, /// auth_info is the authorization related...
use colored::Colorize; use std::{net::IpAddr, path::PathBuf, str::FromStr, sync::Arc, time::Duration}; use crate::{ eth::{ backend::{ db::Db, fork::{ClientFork, ClientForkConfig}, genesis::GenesisConfig, mem::fork_db::ForkedDatabase, }, fees::...
use crate::httpc::HttpcImpl; use mio::Poll; use percent_encoding::{ percent_encode, utf8_percent_encode, PATH_SEGMENT_ENCODE_SET, QUERY_ENCODE_SET, USERINFO_ENCODE_SET, }; use pest::Parser; use crate::resolve::DnsCache; use smallvec::SmallVec; use std::ops::Deref; use std::str::FromStr; use std::time::Duration;...
use crate::get_fee; use crate::utils::*; use crate::MINER_ADDRESS; use crate::MINER_PRIVATE_KEY; use crate::OPERATION_TIMEOUT; use crate::STAKING_TOKEN; use crate::STARTING_STAKE_PER_VALIDATOR; use crate::TOTAL_TIMEOUT; use bytes::BytesMut; use clarity::{Address as EthAddress, Uint256}; use cosmos_gravity::query::get_a...
extern crate anyhow; extern crate clap; extern crate directories; extern crate policy_evaluator; extern crate pretty_bytes; #[macro_use] extern crate prettytable; extern crate serde_yaml; use anyhow::{anyhow, Result}; use clap::ArgMatches; use directories::UserDirs; use lazy_static::lazy_static; use std::{ collect...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct BusinessMessageReject { /// MsgType = j #[serde(flatten)] pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'j', ' '>, /// MsgSeqNum of rejected message #[se...
// Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 use bigdecimal::BigDecimal; use std::rc::Rc; use crate::ast::*; use crate::value::*; mod i64_aux { pub fn checked_exp(base: i64, exponent: i64) -> Option<i64> { let mut...
use crate::{ mesh::{Indices, Mesh}, pipeline::PrimitiveTopology, }; use bevy_math::{Vec2, Vec3}; /// A cylinder with hemispheres at the top and bottom pub struct Capsule { /// Radius on the xz plane. pub radius: f32, /// Number of sections in cylinder between hemispheres. pub rings: usize, ...
// Copyright 2017 <NAME> aka. Luxko // // 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 accordi...
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 use raw_window_handle::RawWindowHandle; use std::{collections::HashMap, ffi::CString, fmt, sync::Mutex}; use winapi::{ shared::{basetsd, minwindef, windef}, um::{commctrl, winuser}, }; use crate::{ acce...
//! X86_64-bit Instruction Set Architecture. use self::inst::EmitInfo; use super::TargetIsa; use crate::ir::{condcodes::IntCC, Function}; #[cfg(feature = "unwind")] use crate::isa::unwind::systemv; use crate::isa::x64::{inst::regs::create_reg_universe_systemv, settings as x64_settings}; use crate::isa::Builder as Isa...
use eframe::{egui, epi}; use crate::backend::BackendStatus; use crate::backend::DemoBackend; use crate::geometry::*; use crate::hero::*; use crate::static_assets::StaticAssets; use crate::utils::*; use crate::widgets::*; #[derive(Default)] pub struct HeroViewer { static_assets: StaticAssets, hero: Option<Hero...
// Copyright 2020, The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following // di...
// Copyright 2020 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...
//! The top-level functionality of Sapling use crate::ast::display_token::DisplayToken; use crate::ast::{size, Ast}; use crate::editable_tree::{Direction, Side, DAG}; use std::collections::hash_map::DefaultHasher; use std::hash::Hasher; use tuikit::prelude::*; mod command_log { //! A utility datastructure to stor...
//! Logic for converting `*Ast` types into their "main" counterparts. use nom::Err as NomErr; use std::{ collections::{HashMap, HashSet}, convert::TryFrom, fmt, }; use crate::{ arith::{CompleteConstraints, Constraint, ConstraintSet}, ast::{ ConstraintsAst, FunctionAst, ObjectAst, SliceAst...
/*! * A contract that acts like an account (can send, store and accept CCD), * but requires n > 1 ordained accounts to agree to the sending of CCD * before it is accepted. This is useful for storing CCD where the security * of just one account isn’t considered high enough. * * Transfer requests time out if not ag...
// Copyright 2020 - developers of the `grammers` project. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // https://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distr...
use crate::{ bindings::signal::siginfo_t, file_monitor::FileMonitorSharedWeakPtr, flags::Flags, log::LogLevel::LogDebug, perf_counters::{self, PerfCounters, TicksSemantics}, remote_ptr::{RemotePtr, Void}, scoped_fd::ScopedFd, session::{ address_space::{ address_space:...
// Copyright 2020 - <NAME> <<EMAIL>> // SPDX-License-Identifier: Apache-2.0 use crate::config::template::config_template; use config::defaults::*; use config::NymConfig; use serde::{Deserialize, Deserializer, Serialize}; use std::net::{IpAddr, SocketAddr}; use std::path::PathBuf; use std::str::FromStr; use std::time::...
//! Code related to dealing with Gists use chrono::Utc; use std::collections::HashMap; use color_eyre::Help; use crate::errors::LostTheWay; use crate::gist::{CreateGistPayload, Gist, GistClient, GistContent, UpdateGistPayload}; use crate::language::Language; use crate::the_way::{cli::SyncCommand, snippet::Snippet, Th...
// Copyright 2015-2018 Capital One Services, 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law o...
// Copyright 2020 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 clap::Clap; use io::Write; use json::JsonValue; use log::{info, warn}; use num_format::{Locale, ToFormattedString}; use rusqlite::types::ValueRef; use rusqlite::{params, OpenFlags, OptionalExtension}; use std::{env, fs, io, path, process}; use crate::bad_command; use crate::util; use crate::util::Result; #[derive...
use std::fmt::{Display, Result, Formatter}; use std::sync::Arc; use enum_dispatch::enum_dispatch; use crate::core::geometry::vector::{Vector3f, vec3_coordinate_system}; use crate::core::pbrt::{Float, INV4_PI, PI}; use crate::core::geometry::point::Point2f; use crate::core::geometry::ray::Ray; use crate::core::spectrum:...
use std::{error::Error, fmt::Display, fmt::Formatter}; use serde_derive::Deserialize; use crate::{ line::Line, symbols::{hexagram::*, trigram::*}, }; /// A `Trigram` is a tuple of three [`Line`](../line/enum.Line.html)s. It can be converted into /// a [`TrigramName`](enum.TrigramName.html) by calling `get_na...
use crate::feature_writer::{prop_type, FeatureWriter}; use crate::header_generated::{ColumnType, Crs, CrsArgs, GeometryType}; use crate::packed_r_tree::{calc_extent, hilbert_sort, NodeItem, PackedRTree}; use crate::{Column, ColumnArgs, Header, HeaderArgs, MAGIC_BYTES}; use flatbuffers::FlatBufferBuilder; use geozero::e...
use anyhow; use csv::Reader; use itertools::Itertools; use serde::Deserialize; use std::collections::{HashMap, HashSet}; use std::env; use std::fs::File; use std::io::Read; use rand::seq::SliceRandom; use rand::thread_rng; type Username = String; type GhUsername = String; #[derive(Debug, Deserialize)] struct Student...
#![doc = include_str!("../README.md")] #![warn( //clippy::cargo_common_metadata, clippy::branches_sharing_code, clippy::cast_lossless, clippy::cognitive_complexity, clippy::get_unwrap, clippy::if_then_some_else_none, clippy::inefficient_to_string, clippy::match_bool, clippy::missing_...
pub mod clearchat; pub mod clearmsg; pub mod globaluserstate; pub mod hosttarget; pub mod join; pub mod notice; pub mod part; pub mod ping; pub mod pong; pub mod privmsg; pub mod reconnect; pub mod roomstate; pub mod usernotice; pub mod userstate; pub mod whisper; // TODO types: CLEARMSG, ROOMSTATE, USERSTATE, GLOBALUS...
use std::{ pin::Pin, str, time::{Duration, SystemTime, UNIX_EPOCH}, }; use actix_service::{Service, Transform}; use actix_web::{ dev::{Body, ServiceRequest, ServiceResponse}, http::{ header::{HeaderValue, ACCEPT, AUTHORIZATION, CONTENT_TYPE, LOCATION, PRAGMA}, Method, }, web...
use crate::lang::argument::{Argument, ArgumentDefinition, ArgumentType}; use crate::lang::command::{BoundCommand, Command, CrushCommand, OutputType, Parameter, ArgumentDescription}; use crate::lang::command_invocation::CommandInvocation; use crate::lang::data::dict::Dict; use crate::lang::errors::{argument_error_legacy...
use dox::mem; pub type c_char = i8; pub type wchar_t = i32; pub type off_t = i64; pub type useconds_t = u32; pub type blkcnt_t = i64; pub type socklen_t = u32; pub type sa_family_t = u8; pub type pthread_t = ::uintptr_t; pub type nfds_t = ::c_uint; s! { pub struct sockaddr { pub sa_len: u8, pub sa...
/// Only allow processing this many inputs in a domain before we handle timer events, acks, etc. const FORCE_INPUT_YIELD_EVERY: usize = 32; use super::ChannelCoordinator; use crate::coordination::CoordinationPayload; use async_bincode::AsyncDestination; use async_timer::Oneshot; use bincode; use dataflow::{ payloa...
use std::cmp::max; use std::convert::TryInto; use std::mem::size_of; use failure::{bail, ensure, err_msg, Fallible, ResultExt}; use prost::Message; use rand::Rng; use static_assertions::const_assert_eq; use crate::commands::{DecryptOptions, EncryptOptions}; use crate::credentials::{ComplexCredential, Credential}; use...
use crate::image_handler::ImageSet; use gdk::ScrollDirection; use gdk_pixbuf::InterpType; use gtk; use gtk::prelude::{GtkWindowExt, Inhibit, LayoutExt, WidgetExtManual}; use gtk::{ContainerExt, ImageExt, WidgetExt}; use std::cell::RefCell; use std::path::PathBuf; use std::rc::Rc; const LEFT_KEY: u16 = 113; const RIGHT...
#![allow(non_snake_case)] use crate::{Result}; use std::collections::HashMap; use std::net::{IpAddr, Ipv4Addr}; use xml::reader::XmlEvent; use xml::{EventReader, ParserConfig, EmitterConfig}; use crate::gen_setters; use crate::map; // use std::str; #[test] fn test_completeXml() { let mut reader = Parser...
#![allow(dead_code)] #![allow(unused)] use bytes::Bytes; use serde::{Deserialize, Serialize}; use sha2::digest::generic_array::sequence::Lengthen; use std::collections::HashMap; use std::future::Future; use std::io::Read; use std::ops::Deref; use std::ops::DerefMut; use std::path::{Path, PathBuf}; use std::pin::Pin; us...
use anyhow::{anyhow, bail, Error}; use std::cmp; use std::env; use walrus::ir::Value; use walrus::{ ir::MemArg, ExportItem, FunctionId, GlobalId, GlobalKind, InitExpr, InstrSeqBuilder, MemoryId, Module, ValType, }; use wasm_bindgen_wasm_conventions as wasm_conventions; const PAGE_SIZE: u32 = 1 << 16; const ATO...
use byteorder::{LittleEndian, WriteBytesExt}; use chrono::prelude::*; use chrono::Utc; use serde::{Deserialize, Serialize}; use std::convert::{TryFrom, TryInto}; use std::fmt; use std::io::prelude::*; use std::io::BufWriter; use crate::data_encoding::DataEncoding; use crate::mseed_error::MSeedError; /// Size in bytes...
extern crate rand; use rand::Rng; use std::io::Write; use std::process::exit; use std::env; #[derive(Copy, Clone, Debug, PartialEq, Eq)] enum Direction { North, South, East, West, } #[derive(Copy, Clone, Debug, PartialEq, Eq)] enum Orientation { NorthSouth, EastWest, } type Room = [(usize, D...
#![cfg_attr(baremetal, no_main)] #![cfg_attr(baremetal, no_std)] mod api; use api::*; mod status; use status::*; mod canvas; use canvas::*; use blitstr_ref as blitstr; use blitstr::GlyphStyle; use graphics_server::*; use ime_plugin_api::ImeFrontEndApi; use content_plugin_api::{ContentCanvasConnection, ContentCanvasA...
use super::object::{ApiObject, ObjectField, OpRequirement, Parameter}; use super::state::{ChildModule, EmitterState}; use crate::error::PaperClipError; use crate::v2::{ im::ArcRwLock, models::{ self, Api, DataType, DataTypeFormat, Operation, OperationMap, ParameterIn, SchemaRepr, }, Schema, }; u...
use crate::frame_constants::FrameConstants; use macaw::{ const_mat3, FloatExt, Mat3, UVec2, UVec3, Vec2, Vec3, Vec3Swizzles, Vec4, Vec4Swizzles, }; #[cfg(target_arch = "spirv")] use spirv_std::num_traits::Float; pub fn get_uv_u(pix: UVec2, tex_size: Vec4) -> Vec2 { (pix.as_vec2() + Vec2::splat(0.5)) * tex_size...
//! File: sha256.rs //! Author: <NAME> //! Topic: Cryptology & Hashing //! Abstract: //! Implements the SHA-256 algorithm (found under the SHA-2 group). use std::num::ParseIntError; use std::str::FromStr; use std::fmt::Display; #[derive(Debug, PartialEq)] pub struct Sha256Hash { digest: [u32; 8] } impl FromS...
use crate::{ encryption::{DocumentType, EncryptionHandler}, OleFile, }; use std::collections::HashMap; lazy_static! { pub static ref NAME_TO_RECORD_NUM_MAP: HashMap<&'static str, u16> = { HashMap::from([ ("AlRuns", 4176), ("Area", 4122), ("AreaFormat", 4106), ...
// Copyright (c) 2021 The Lutino Projects // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. use std::os::raw; use crate::raw::{RawVkPointer, VkFlags, VkFlags64}; pub type VkStructureType = raw::c_uint; pub type VkS...
use crate::distribution::Distribution; #[derive(Debug, Clone, Eq, PartialEq)] enum Element { Character(char), Null, } impl Element { pub fn is_null(&self) -> bool { self == &Element::Null } } #[derive(Debug, PartialEq)] pub struct OptimalAlignments<'a> { distribution: &'a Distribution, ...
use std::hash::Hash; use std::cmp::Ordering; use std::collections::{HashMap, HashSet, BinaryHeap}; // ================================================== STRUCTS ================================================== type PositionUnit = i32; type Position = (PositionUnit, PositionUnit); #[derive(Copy, Clone, PartialEq, E...
use std::collections::HashMap; use syn::parse::{Parse, ParseStream}; use syn::{punctuated::Punctuated, Expr, Ident, LitInt, Result, Token}; use crate::helpers::bool_to_char; mod kw { syn::custom_keyword!(internal_error); syn::custom_keyword!(read); syn::custom_keyword!(var); syn::custom_keyword!(patt...
use winit::{ event::*, event_loop::{EventLoop, ControlFlow}, window::{Window, WindowBuilder}, dpi::*, }; use futures::executor::block_on; use cgmath::{Matrix4, Point3, Deg, Vector3}; use std::time::Instant; mod icosphere; use icosphere::IcoSphere; #[repr(C)] #[derive(Copy, Clone, Debug)] struct Vertex...
//! A platform agnostic driver to interface with the LSM303AGR (accelerometer + compass) //! //! This driver was built using [`embedded-hal`] traits. //! //! [`embedded-hal`]: https://docs.rs/embedded-hal/~0.2 //! //! # Examples //! //#![deny(missing_docs)] //#![deny(warnings)] #![no_std] #![feature(uniform_paths)] #!...
#![cfg_attr(not(feature = "std"), no_std)] use core::{cmp, convert::*}; use codec::Encode; use frame_support::{debug, decl_error, decl_event, decl_module, decl_storage, dispatch::{DispatchError, DispatchResult}, traits::Get}; use frame_system::{ self as system, ensure_signed, offchain::{ AppCrypto, CreateSig...
///! ///! Analog To Digital Converter (ADC) Module ///! ///! The microcontroller includes two 12-bit ADC modules. ///! The main features of each of the ADC modules are: ///! - Selectable 10-bit or 12-bit resolution ///! - Successive-approximation-register architecture ///! - Three conversion groups – Group1, Group2 and...
#![allow(dead_code)] use std::{ env, fmt::{self, Display, Formatter}, io, path::PathBuf, sync::mpsc::{self, Receiver}, time::Duration, }; use notify::{DebouncedEvent, RecommendedWatcher, RecursiveMode, Watcher}; use serde::{ de::{self, Deserializer, Unexpected}, Deserialize, }; use cr...
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. #![allow(unused_variables)] #![allow(dead_code)] use ast_scope_rust::{self as ast_scope, Scope, ScopeItem}; use emit_attribute_rust as e...
//! Set and unset common attributes on LLVM values. use std::ffi::CString; use rustc::hir::def_id::{DefId, LOCAL_CRATE}; use rustc::hir::CodegenFnAttrFlags; use rustc::session::config::{OptLevel, Sanitizer}; use rustc::session::Session; use rustc::ty::layout::HasTyCtxt; use rustc::ty::query::Providers; use rustc::ty:...
#[cfg(test)] mod mock; #[cfg(test)] mod tests; pub use self::pallet::*; #[frame_support::pallet] pub mod pallet { use crate::pallet_assets_wrapper::{ AccountId32Conversion, ExtractReserveLocation, GetAssetRegistryInfo, XTransferAsset, CB_ASSET_KEY, }; use frame_support::{ pallet_prelude::*, traits::{ tok...
use std::convert::TryFrom; use std::env; use std::fs::{self, OpenOptions}; use std::io::Write; use std::path::{Path, PathBuf}; use anyhow::Result; use log::*; use serde::{Deserialize, Serialize}; use super::Resolution; use crate::cargo::CargoCmd; use crate::utils::OsStrExt; use crate::{build, cargo}; pub const OPTIO...
use crate::routes::setting::{RankingOrdering, SettingBody}; use indexmap::IndexMap; use log::*; use meilidb_core::criterion::*; use meilidb_core::Highlight; use meilidb_core::{Index, RankedMap}; use meilidb_schema::{Schema, SchemaAttr}; use serde::{Deserialize, Serialize}; use serde_json::Value; use std::cmp::Ordering;...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Control Register"] pub cr: CR, #[doc = "0x04 - Mode Register"] pub mr: MR, #[doc = "0x08 - Receive Data Register"] pub rdr: RDR, #[doc = "0x0c - Transmit Data Register"] pub tdr: TDR, #[doc = "0x10 - Sta...