text
stringlengths
9.08k
47.9k
extern crate timely; extern crate differential_dataflow; #[macro_use] extern crate abomonation_derive; extern crate abomonation; #[macro_use] extern crate serde_derive; use std::string::String; use std::boxed::Box; use std::ops::Deref; use std::collections::{HashMap, HashSet}; use timely::*; use timely::dataflo...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Command control register"] pub cmd: crate::Reg<cmd::CMD_SPEC>, #[doc = "0x04 - Address value"] pub addr: crate::Reg<addr::ADDR_SPEC>, #[doc = "0x08 - SPI control register"] pub ctrl: crate::Reg<ctrl::CTRL_SPEC>, ...
//! GLTF format use std::collections::HashMap; use std::error::Error as StdError; use std::fmt; use std::mem; use std::sync::Arc; use self::importer::{get_image_data, import, Buffers, ImageFormat}; use animation::{InterpolationFunction, InterpolationPrimitive, Sampler, SamplerPrimitive, TransformChann...
//! Functions for converting Rust types to C types. #[cfg(test)] mod tests; mod types; use self::types::{CPtrType, CType, CTypeNamed}; use crate::common::{ append_output, check_no_mangle, check_repr_c, parse_attr, retrieve_docstring, Lang, Outputs, }; use crate::{Error, Level}; use petgraph::{algo, Graph}; use st...
// Copyright 2019 Zhizhesihai (Beijing) Technology 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 directories; use failure::{bail, Fallible, ResultExt}; use lazy_static::lazy_static; use serde::{Deserialize, Serialize}; use serde_json; use std::io::prelude::*; use std::os::unix::process::CommandExt; use std::path::Path; use std::process::{Command, Stdio}; use structopt::StructOpt; mod cmdrunext; mod podman; us...
// Copyright 2018 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 ...
// Copyright 2019, 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 // disclai...
use crate::future_ext::FutureExt; use crate::transaction_ext::TransactionExt; use crate::wallet; use crate::wire::Msg0; use crate::wire::Msg1; use crate::wire::Msg2; use crate::wire::Msg3; use crate::wire::RolloverMsg; use crate::wire::RolloverMsg0; use crate::wire::RolloverMsg1; use crate::wire::RolloverMsg2; use crat...
//! Module containing structs modelling Geometry Dash levels as they are returned from the boomlings //! servers use std::{ borrow::Cow, fmt::{Display, Formatter}, io::Read, }; use base64::URL_SAFE; use flate2::read::{GzDecoder, GzEncoder, ZlibDecoder}; use serde::{Deserialize, Deserializer, Serialize, Se...
use std::collections::HashMap; use std::time::{Duration, Instant}; use async_trait::async_trait; use bytes::{Buf, BufMut}; use futures::future; use itertools::Itertools; use lazy_static::lazy_static; use prost::Message; use runkv_common::packer::{Item, Packer}; use runkv_common::Worker; use runkv_storage::raft_log_sto...
//! Plugin which issues vault tokens to services. use compose_yml::v2 as dc; use std::{ collections::{btree_map::Entry, BTreeMap, BTreeSet}, env, fmt::Debug, fs, io::{self, Read}, path::PathBuf, result, time::{Duration, SystemTime}, }; use vault::client::VaultDuration; use crate::error...
use crate::error::InvalidBestNodeInfo; use crate::{error::Error, Block, ExecutionStatus}; use serde_derive::{Deserialize, Serialize}; use ssz::four_byte_option_impl; use ssz::Encode; use ssz_derive::{Decode, Encode}; use std::collections::HashMap; use types::{AttestationShufflingId, ChainSpec, Checkpoint, Epoch, EthSpe...
// Copyright <NAME> (https://github.com/mr-glt/sx127x_lora). Licensed under the Apache 2.0 // license // // Modifications made to make the driver work with the rust-lorawan link layer. #![allow(dead_code)] use bit_field::BitField; use embedded_hal::blocking::{ delay::DelayMs, spi::{Transfer, Write}, }; use em...
// Copyright (c) 2021 The vulkano developers // 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. All files in the project carrying such // notice may not be ...
//! Layout system. 🐢 use crate::debug_log::DebugLog; use crate::*; #[derive(Copy, Clone, Debug, PartialEq)] pub enum CxBoxType { Normal, RightBox, BottomBox, CenterXAlign, CenterYAlign, CenterXYAlign, PaddingBox, Row, Column, AbsoluteBox, WrappingBox, View, } impl Def...
/* Copyright (C) 2017 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free * Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARR...
pub mod screen; pub mod view; pub mod block; pub mod component; use std::collections::HashMap; use std::path::PathBuf; use crate::LinkedHashMap; use crate::api::library::{AdMob, Firebase, GoogleMap}; use crate::api::screen::{Event, MoreBlock, Screen, ScreenConstructionError}; use crate::api::view::{flatten_views, pars...
use std::fmt::{self, Display, Debug}; use std::cmp::PartialEq; use combine::{ Parser, Positioned, RangeStreamOnce, attempt, look_ahead, not_followed_by, many, many1, optional, skip_many, }; use combine::{ConsumedResult, ParseError, StreamOnce, RangeStream}; use combine::byte::{alpha_num, byte, digit, hex_digit...
use crate::database::{BlockRange, Location, Note, TagMap}; use crate::{anyhow, bail, Context, Database, Result}; use chrono::{DateTime, FixedOffset}; use serde::Serialize; use tracing::{event, Level}; use std::collections::{HashMap, HashSet}; use std::iter; use std::rc::Rc; type MergeResult = Result<(Database, Vec<Me...
use crate::*; use std::{ collections::HashMap, sync::Arc, }; use resources::{ Importer, Resource, }; use serde::{ self as serde, ron, Deserialize, Serialize, }; use bitflags::bitflags; #[derive(Copy, Clone, Debug, Serialize, Deserialize)] pub enum DrawMode { Fill, Line, Point, } bitflags! { pub struct...
#![allow(deprecated)] use nom::IResult; use nom::Err as NomErr; use nom::multi::count; use nom::combinator::map_res; use nom::bytes::complete::take; use nom::error::ErrorKind; use nom::number::complete::{be_u8, be_i16, be_u16, be_i32, be_u32}; use std::{ops, str}; /// PostScript Table /// /// This table contains addi...
/*************************** COPYRIGHT FETCH DEVELOPMENT, 2020 LESTERRRY AUTHORSHIP ***************************/ extern crate encoding; extern crate image; use clap::App; use clap::Arg; use std::fs::File; use std::fmt::Write; use std::collections::BTreeMap; use encoding::all::WINDOWS_1251; use encoding::{Encoding, De...
use crc32fast; use std::mem; use std::vec::Vec; use crate::endian::{LittleEndian as LE, U16Bytes, U32Bytes, U16, U32}; use crate::pe as coff; use crate::pod::{bytes_of, WritableBuffer}; use crate::write::string::*; use crate::write::util::*; use crate::write::*; #[derive(Default, Clone, Copy)] struct SectionOffsets {...
//! # API for the Analog to Digital converter use embedded_hal::adc::{Channel, OneShot}; use crate::gpio::Analog; use crate::gpio::{gpioa, gpiob, gpioc}; use crate::rcc::{APB2, Clocks}; use crate::dma::{Receive, TransferPayload, dma1::C1, CircBuffer, Transfer, W, RxDma}; use core::sync::atomic::{self, Ordering}; use ...
use crate::diff::*; use crate::error::{BitError, BitResult}; use crate::index::{BitIndex, BitIndexEntry, MergeStage}; use crate::iter::{BitEntry, BitEntryIterator, BitTreeIterator}; use crate::obj::{FileMode, TreeEntry, Treeish}; use crate::path::BitPath; use crate::pathspec::Pathspec; use crate::refs::BitRef; use crat...
// 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 std::{ collections::VecDeque, fmt, fs::File, io::{BufRead, BufReader}, path::PathBuf, str::FromStr, task::{Context, Poll}, }; use nix::unistd::Uid; use crate::{ guid::Guid, raw::{Connection, Socket}, Error, Result, }; use futures_core::ready; /* * Client-side handshake l...
// Copyright © 2015-2017 winapi-rs 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,...
use ffi::h5::{hsize_t, hbool_t, haddr_t, HADDR_UNDEF}; use ffi::h5d::{ H5Dcreate2, H5Dcreate_anon, H5D_FILL_TIME_ALLOC, H5Dget_create_plist, H5D_layout_t, H5Dget_space, H5Dget_storage_size, H5Dget_offset, H5Dget_type, H5D_fill_value_t }; use ffi::h5i::{H5I_DATASET, hid_t}; use ffi::h5p::{ H5Pcreate, H5Pset_...
// Copyright (c) 2016 The vulkano developers // 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. All files in the project carrying such // notice may not be ...
use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::path::PathBuf; use std::sync::Arc; use tdn::{ smol::{channel::Sender, lock::RwLock}, types::{ group::{EventId, GroupId}, message::{RecvType, SendMessage, SendType}, primitive::{new_io_error, HandleResult, PeerAd...
// This file is part of Sulis, a turn based RPG written in Rust. // Copyright 2019 <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 your opt...
use crate::interner::StrId; use crate::lexical::keywords::Keyword; use crate::lexical::symbols::Symbol; use crate::lexical::token::{CommentKind, Token, TokenKind}; use crate::span::{Span, Spanned}; use std::iter::{Iterator, Peekable}; use std::str::CharIndices; pub type TokenResult<'s> = Result<Token<'s>, LexerError<...
use common::*; use scene::{Scene, Sky, PBRParameters, Material, find_scene_hit}; use std::sync::{Arc, RwLock}; use std::cell::UnsafeCell; #[derive(Clone, Debug, new)] pub struct ImageSettings { pub width: usize, pub height: usize, pub sub_pixel_sampling: bool, } #[derive(Clone, Debug, new)] pub struct W...
/** * @file rcc.rs * * This file contains the peripheral RCC register functions * * Copyright (c) 2021 admaunaloa <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 re...
// Copyright (c) 2019, The rav1e contributors. All rights reserved // // This source code is subject to the terms of the BSD 2 Clause License and // the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License // was not distributed with this source code in the LICENSE file, you can // obtain it at www.a...
#![cfg_attr(feature = "unstable", feature(plugin))] #![cfg_attr(feature = "unstable", plugin(clippy))] //! A small library meant to be used as a build dependency with Cargo for easily //! integrating [ISPC](https://ispc.github.io/) code into Rust projects. //! //! # Using ispc-rs //! //! You'll want to add a build scr...
use crate::config::Config; use crate::pod::Pod; use crate::provider::Provider; use crate::status::{ContainerStatus, Status}; use chrono::prelude::*; use futures::{StreamExt, TryStreamExt}; use k8s_openapi::api::coordination::v1::Lease; use k8s_openapi::api::core::v1::Node as KubeNode; use k8s_openapi::api::core::v1::Po...
use algonaut_core::{Address, CompiledTealBytes, MicroAlgos, Round}; use algonaut_crypto::{deserialize_hash, HashDigest}; use algonaut_encoding::deserialize_bytes; use data_encoding::BASE64; use serde::{Deserialize, Deserializer, Serialize}; use serde_with::{serde_as, DisplayFromStr}; #[serde_as] #[derive(Debug, Serial...
use bytes; use futures::{self, future, Future, Poll}; use h2; use http; use indexmap::IndexSet; use std::net::SocketAddr; use std::thread; use std::time::{Duration, SystemTime}; use std::{error, fmt, io}; use tokio::executor::{self, DefaultExecutor, Executor}; use tokio::runtime::current_thread; use tower_h2; use app:...
use rustc_hir::def_id::DefId; use rustc_middle::hir; use rustc_middle::mir::*; use rustc_middle::ty::TyCtxt; use rustc_session::config::MirSpanview; use rustc_span::{BytePos, Pos, Span, SyntaxContext}; use std::cmp; use std::io::{self, Write}; pub const TOOLTIP_INDENT: &str = " "; const CARET: char = '\u{2038}'; ...
#[cfg(feature = "basis-universal")] use super::basis::*; #[cfg(feature = "dds")] use super::dds::*; #[cfg(feature = "ktx2")] use super::ktx2::*; use super::image_texture_conversion::image_to_texture; use crate::{ render_asset::{PrepareAssetError, RenderAsset}, render_resource::{Sampler, Texture, TextureView}, ...
extern crate liquid; use std::collections::HashMap; use crate::charclasses::CharClasses; use crate::dfa::DFA; use crate::scanner::Action; #[derive(Debug)] pub struct Emitter<'a> { dfa: &'a DFA, // for row killing num_rows: i32, row_map: Vec<i32>, row_killed: Vec<bool>, // for col killing ...
use crate::config::{Config, Delimiter}; use crate::select::SelectColumns; use crate::util; use crate::CliResult; use cached::proc_macro::cached; use censor::{Censor, Sex, Zealous}; use chrono::{NaiveTime, Utc}; use dateparser::parse_with; use dynfmt::Format; use eudex::Hash; use indicatif::{ProgressBar, ProgressDrawTar...
//! Defines `Module` and `Function` that act as containers. #![allow(deprecated)] #![deprecated(since="0.2.0", note="Replace with `radeco_containers`")] use crate::frontend::bindings::{Binding, LocalInfo, RBind, RBindings, RadecoBindings}; use crate::frontend::source::Source; use crate::frontend::ssaconstructor::SSA...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 19/07/2017 Last Modified: 18/10/2019 License: MIT */ use whitebox_raster::*; use whitebox_common::structures::Array2D; use crate::tools::*; use num_cpus; use std::env; use std::f64; use std::io::{Error, ErrorKind}; use ...
#[derive(Debug)] pub enum Country { AD, // Andorra AE, // United Arab Emirates AF, // Afghanistan AG, // Antigua and Barbuda AI, // Anguilla AL, // Albania AM, // Armenia AO, // Angola AQ, // Antarctica AR, // Argentina AS, // American Samoa AT, // Austria AU, // Aust...
// Copyright 2020-2021 <NAME> under the terms of the MIT License as detailed // in the accompanying file README.md or <https://opensource.org/licenses/MIT>. //! Integer-coordinate matrices. //! This module is private but reexported by its parent. use cgmath::{InnerSpace, Matrix4, One, Transform, Vector3, Vector4, Zer...
use std::{collections::HashMap, convert::TryFrom, fmt, future::Future, pin::Pin, sync::Arc}; use anyhow::{anyhow, bail, Context, Result}; use async_trait::async_trait; use colibri::ColibriMessage; use futures::stream::StreamExt; use gstreamer::prelude::{ElementExt, ElementExtManual, GstBinExt}; use maplit::hashmap; us...
use crate::conn::AmConnCore; use crate::protocol::parts::{AmRsCore, ParameterDescriptor, TypeId}; use crate::protocol::util; use crate::types::{BLob, CLob, DayDate, LongDate, NCLob, SecondDate, SecondTime}; use crate::types_impl::daydate::parse_daydate; use crate::types_impl::decimal; use crate::types_impl::lob::{emit_...
pub const RESULTS: &[ResultMacro] = &[ ResultMacro(1, 27, "A", 4, 0), ResultMacro(1, 27, "B", 5, 0), ResultMacro(1, 27, "C", 6, 0), ResultMacro(1, 27, "D", 7, 0), ResultMacro(1, 27, "E", 8, 0), ResultMacro(1, 27, "F", 9, 0), ResultMacro(1, 27, "G", 10, 0), ResultMacro(1, 27, "H", 11, 0),...
//! This module handles *logical songs*. //! //! It corresponds to the `logical_songs` table of the database. use crate::*; use log::{error,warn,info}; use anyhow::anyhow; use lazy_static::lazy_static; use mlua::{Lua, Function, Table}; use serde::{Serialize,Deserialize}; use rand::{thread_rng, Rng}; use std::{ b...
// (C) COPYRIGHT 2018 TECHNOLUTION BV, GOUDA NL // 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 // exce...
use crate::{ bitcoind::{ interface::{BitcoinD, DepositInfo, SyncInfo}, BitcoindError, MIN_CONF, }, database::{ actions::{ db_confirm_deposit, db_insert_new_unconfirmed_vault, db_unconfirm_deposit_dbtx, db_unvault_deposit, db_update_deposit_index, db_update_tip...
// 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. //! The special-purpose event loop used by the recovery netstack. //! //! This event loop takes in events from all sources (currently ethernet devices, FID...
use dbscan::{cluster, Classification}; use geo::algorithm::centroid::Centroid; use geo::algorithm::concave_hull::ConcaveHull; use geo::algorithm::simplify::Simplify; use geo::{Coordinate, LineString, Polygon}; use nannou::prelude::*; use serde::{Deserialize, Serialize}; use serde_json::Result; use std::fs; use std::fs:...
//! Module for UDS (Unified diagnostic services - ISO14229) //! //! Theoretically, this module should be compliant with any ECU which implements //! UDS (Typically any ECU produced after 2006 supports this) use std::{ sync::{ atomic::{AtomicBool, Ordering}, mpsc, Arc, }, thread::JoinHandle,...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { _reserved_0_host: [u8; 0x0111], } impl RegisterBlock { #[doc = "0x00..0x111 - USB is Host"] #[inline(always)] pub fn host(&self) -> &HOST { unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const HOST) } } #[...
use std::rc::Rc; use self::{ arguments::{Argument, ConstructorArgument}, parameter_helper_definitions::{CustomArgument, ParameterHelperDefintions}, }; use crate::{ asteracea_ident, part::GenerateContext, storage_configuration::StorageTypeConfiguration, storage_context::{ParseContext, ParseWithContext, StorageCon...
use super::super::{ circuit::Expression, ChallengeBeta, ChallengeGamma, ChallengeTheta, ChallengeX, Error, ProvingKey, }; use super::Argument; use crate::{ arithmetic::{eval_polynomial, parallelize, CurveAffine, FieldExt}, poly::{ self, commitment::{Blind, Params}, multiopen::Pro...
// #[cfg(feature = "unstable")] // use std::collections::TryReserveError; pub use arenas::{WDArena, WDLevel}; pub use distribution::{NcWDistribution, Node2NodeDistribution, NWDistribution}; pub use distribution::count::WDCount; pub use distribution::count_v2::WDCountV2; pub use distribution::dist_factories::*; pub use...
#[cfg(feature = "headless")] pub use self::headless::HeadlessContext; use {CreationError, Event, MouseCursor, CursorState}; use CreationError::OsError; use libc; use Api; use BuilderAttribs; use GlRequest; use native_monitor::NativeMonitorId; use objc::runtime::{Class, Object, Sel, BOOL, YES, NO}; use objc::declare:...
// Translated from C to Rust. The original C code can be found at // https://github.com/ulfjack/ryu and carries the following license: // // Copyright 2018 <NAME> // // The contents of this file may be used under the terms of the Apache License, // Version 2.0. // // (See accompanying file LICENSE-Apache or copy at ...
use std::iter::FromIterator; use std::ptr; use backend; use backend::util::{ident_ty, leading_colon_path_ty, raw_ident, rust_ident}; use heck::{CamelCase, ShoutySnakeCase, SnakeCase}; use proc_macro2::{Ident, Span}; use syn; use weedle; use weedle::attribute::{ExtendedAttribute, ExtendedAttributeList, IdentifierOrStri...
//! `tor-dirmgr`: Code to fetch, store, and update Tor directory information. //! //! # Overview //! //! This crate is part of //! [Arti](https://gitlab.torproject.org/tpo/core/arti/), a project to //! implement [Tor](https://www.torproject.org/) in Rust. //! //! In its current design, Tor requires a set of up-to-date ...
use super::err as ldt_err; use super::{util, EulumdatSymmetry, EulumdatType}; use crate::photweb::{ mirror_first_hemisphere, mirror_first_quadrant, IntensityUnits, PhotometricWeb, Plane, PlaneOrientation, mirror_second_and_third_quadrants, }; use crate::util::geom::degrees_to_radians; use crate::{err::Error, ph...
use std::collections::HashMap; use std::string; use std::ops::Add; use std::ops::Sub; use chrono::prelude::*; use chrono::Duration; use regex::Regex; use crate::emoji::{self, Emojis}; use crate::message::{Message, MessageError, MessageErrorKind, Result}; #[derive(Clone, Copy, Serialize, Debug)] pub enum TimelineTyp...
use cell::Cell; use collections::VecDeque; use iter::FromIterator; use std::*; use crate::config::Issue; use crate::tokenizer::token; use token::*; use crate::parser::ast::*; use crate::parser::{extract_bracketed_expression, Parse, ParseExact}; #[derive(Debug)] enum BracketedExpr { /// examples: (a), (a + b) ...
use std::net::{Ipv4Addr, SocketAddr}; use std::sync::{Arc, RwLock}; use std::time::Duration; use tokio::io::BufReader; use tokio::net::tcp::WriteHalf; use tokio::net::TcpListener; use tokio::prelude::*; use tokio::select; use tokio::sync::mpsc; use tokio::time::sleep; use bitcoin::hashes::{hash160::Hash as Hash160, H...
use crate::process::*; use ddsfile::{AlphaMode, Caps2, D3D10ResourceDimension, D3DFormat, Dds, DxgiFormat}; use image::FilterType; use image::GenericImageView; use image::ImageBuffer; use image::Pixel; use intel_tex::*; pub fn is_bcn_format(format: schema::TextureFormat) -> bool { match format { schema::Te...
use crate::animation::{Animated, BlobAnims, FireAnims, FrogAnims, JeanAnims}; use crate::component::{ Animation, Annihilate, Audio, Collision, Controls, CoordinateSystem, Follow, Outro, Position, Random, Sprite, Tilemap, UpdateTime, Velocity, Viewport, }; use crate::control::{Direction, Power, Walk}; use crate:...
pub mod ast; mod lexer; pub use lexer::{Keyword, Lexer, Token}; use super::types::DataType; use crate::error::{Error, Result}; use lazy_static::lazy_static; use regex::Regex; use std::collections::BTreeMap; /// An SQL parser pub struct Parser<'a> { lexer: std::iter::Peekable<Lexer<'a>>, } impl<'a> Parser<'a> { ...
use bincode::{serialize, deserialize}; use colored::*; use ed25519_dalek::{Keypair, Signature}; use lazy_static::lazy_static; use rand::rngs::OsRng; use ron::{ser}; use serde::{Serialize, Deserialize}; use sha3::{Keccak256, Digest}; use std::convert::TryInto; use std::io::{copy, Seek, BufRead, BufReader, BufWriter, Rea...
use std::pin::Pin; use std::sync::Arc; use std::time::Duration; use futures::{ task::{Context, Poll, Waker}, Future, Stream, StreamExt, }; use linked_hash_map::LinkedHashMap; use parking_lot::RwLock; use tokio_stream::wrappers::BroadcastStream; use account::StakingContract; use block::{Block, BlockType, Signe...
//! The pallet for interaction with cosmos abci interface. #![cfg_attr(not(feature = "std"), no_std)] #![allow(unused_assignments)] #![warn(unused_must_use)] use frame_support::{ codec::{Decode, Encode}, debug, decl_module, decl_storage, dispatch::{DispatchResult, Vec}, weights::Weight, }; use frame_sy...
use std::{ borrow::Cow, error::Error, path::Path, thread, time::{Duration, Instant}, }; use engel_core::{controller, Color, Comp, KeyboardController, MouseController, Real, Render, SystemMessage}; pub use gl; pub use glutin::{ self, dpi::Pixel, event_loop::ControlFlow, monitor::{Mon...
mod aes_ctr_file; mod byte_struct_common; pub mod cart_save_data; pub mod db; mod diff; mod difi_partition; mod disa; mod disk_file; mod dpfs_level; mod dual_file; pub mod error; pub mod ext_data; mod fat; pub mod file_system; mod fs_meta; mod ivfc_level; mod key_engine; mod memory_file; mod misc; mod nand; mod random_...
//! # Exchange Module //! //! Exchange NFTs or FTs. //! //! For pool, use bancor curve. //! y = m * x ^ n //! r = reverseRatio = ppm / 1000000 //! after integral and simplify, //! can get these formula //! buy: p = poolBalance * ((1 + amount / totalSupply) ** (1 / (reserveRatio)) - 1) //! sell: p = poolBalance * ( 1 ...
// Copyright 2021 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 use crate::{api::address::search_address, Client, ClientMiner, Error, Result}; use bee_common::packable::Packable; use bee_message::prelude::*; use bee_pow::providers::ProviderBuilder; use bee_rest_api::types::dtos::{AddressDto, OutputDto}; use cr...
//! Server-Sent Events (SSE) //! //! # Example //! //! ``` //! //! use std::time::Duration; //! use std::convert::Infallible; //! use warp::{Filter, sse::ServerSentEvent}; //! use futures::{stream::iter, Stream}; //! //! fn sse_events() -> impl Stream<Item = Result<impl ServerSentEvent, Infallible>> { //! ...
use crate::util::ChannelPair; use glium::{program::SourceCode, texture::TextureCreationError, Display, Program}; use image::{GenericImageView, ImageError, RgbaImage}; use notcraft_common::prelude::*; use std::{ collections::{HashMap, HashSet}, fs::File, io::ErrorKind, path::{Component, Path, PathBuf}, ...
// Copyright 2021 Datafuse Labs. // // 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 ...
use crate::{api, usr}; use crate::api::console::Style; use crate::api::prompt::Prompt; use alloc::string::ToString; use alloc::string::String; use alloc::vec::Vec; use alloc::format; use alloc::vec; use alloc::collections::BTreeMap; use alloc::rc::Rc; use core::fmt; use core::num::ParseFloatError; use float_cmp::approx...
use std::{collections::HashMap, sync::Arc}; use data::server_db::{self, find_player, next_entity_id, save_player, GameData}; use glam::{IVec3, Vec2}; use protocol::{ data::{ player_data::PlayerListData, tile_map_data::TileState, update_data::{EntityState, EntityType, UpdateData}, }, ...
use clap::{crate_version, Arg, SubCommand}; use crossterm::{ event::{self, Event as CEvent, KeyCode, KeyModifiers}, execute, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; use git2::Repository; use git_graph::{ config::{create_config, get_available_models, ...
use super::mode::*; use bitflags::bitflags; use enum_primitive::*; enum_from_primitive! { /// Names of COP0 Registers, defined according to page 64 of the EE Core User's Manual. /// Values which cannot be converted map to "Reserved" registers (7, 17–22, 26–27, 31). #[derive(Debug, PartialEq)] pub enum Register { /// ...
use core::fmt; use std::collections::BTreeSet; use std::fmt::{Display, Formatter}; use std::num::NonZeroUsize; use std::path::Path; use std::{fs, io}; use chrono::{Local, NaiveDateTime, TimeZone}; use console::{pad_str, style, Alignment}; use err_derive::*; use itertools::Itertools; use serde::{Deserialize, Serialize}...
#![allow(non_snake_case)] use clear_on_drop::clear::Clear; use core::mem; use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint}; use curve25519_dalek::scalar::Scalar; use curve25519_dalek::traits::{Identity, MultiscalarMul}; use merlin::Transcript; use super::{ ConstraintSystem, LinearCombination...
use graphql_parser::query as q; use graphql_parser::schema as s; use indexmap::IndexMap; use lazy_static::lazy_static; use stable_hash::crypto::SetHasher; use stable_hash::prelude::*; use stable_hash::utils::stable_hash; use std::cmp; use std::collections::{BTreeMap, HashMap, HashSet}; use std::time::Instant; use grap...
use std::{iter, ops}; use codespan::{ByteOffset, RawOffset}; use itertools::{Either, Itertools}; use pretty::{Arena, Doc, DocAllocator, DocBuilder}; use self::types::pretty_print as pretty_types; use base::ast::{ Do, Expr, Literal, Pattern, SpannedExpr, SpannedPattern, ValueBinding, ValueBindings, }; use base::ki...
//! Generated by `codegen/create_gen_op.py` //! Maps genop table from Erlang/OTP source to Rust //! Config used: OTP20 #![allow(dead_code)] use rt_defs::Word; use emulator::code::opcode::RawOpcode; pub const OPCODE_MAX: RawOpcode = 159; pub static ARITY_MAP: &'static [RawOpcode] = &[ 0, // opcode 0 does not exi...
//! This is a platform agnostic Rust driver for the [`INA226`], an I2C output //! current/voltage/power monitor with alerts, using the [`embedded-hal`] traits. //! //! [`INA226`]: https://www.ti.com/product/INA226 //! [`embedded-hal`]: https://github.com/rust-embedded/embedded-hal //! //! This driver allows you to: //!...
//! # Day 16: Packet Decoder //! //! As you leave the cave and reach open waters, you receive a transmission from //! the Elves back on the ship. //! //! The transmission was sent using the Buoyancy Interchange Transmission System //! (BITS), a method of packing numeric expressions into a binary sequence. Your //! subm...
extern crate rengine; use std::{borrow::Cow, error::Error}; use log::trace; use serde::Deserialize; use rengine::angle::{Deg, Rad}; use rengine::camera::{ ActiveCamera, CameraDriftSystem, CameraProjection, CameraView, DollyCamera, DollyCameraControlSystem, FocusTarget, GridCamera, GridCameraControlSystem, Or...
use cgmath::prelude::*; use cgmath::{Deg, Matrix4, Point3, Vector3}; pub mod shape; use ash::vk; use std::slice; use vki::{ Adapter, AdapterOptions, Buffer, BufferCopyView, BufferDescriptor, BufferUsage, CommandEncoder, Device, DeviceDescriptor, Error, Extensions, Extent3d, FilterMode, Instance, Origin3d, P...
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors // // 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 // // Unl...
// Copyright (c) 2022, Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 use anyhow::Result; use crate::bytecode_rewriter::ModuleHandleRewriter; use move_binary_format::{errors::PartialVMResult, file_format::CompiledModule, normalized::Type}; use sui_framework::EventType; use sui_types::{ base_types::*, ...
//! See the [readme](https://github.com/johanhelsing/bevy_smud) and //! [examples](https://github.com/johanhelsing/bevy_smud/tree/main/examples) for //! usage. #![allow(clippy::too_many_arguments)] use std::cmp::Ordering; use bevy::{ asset::HandleId, core::FloatOrd, core_pipeline::Transparent2d, ecs:...
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. use std::convert::TryFrom; use digest::Digest; use generic_array::{ typenum::{Unsigned, U16, U32}, GenericArray, }; use num_bigin...