text
stringlengths
7.05k
33.9k
use std::collections::BTreeSet; use std::fs; use std::path::{Path, PathBuf}; use std::process::Command; use anyhow::Context; use dirs::home_dir; use edgedb_client as client; use serde::Serialize; use crate::credentials::{self, get_connector}; use crate::platform::{get_current_uid}; use crate::process; use crate::serv...
use crate::{Rectangle, Size, size2, Point, point2}; //use crate::free_list::*; use crate::AllocId; #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct TiledAllocatorOptions { pub region_size: Size, } #[derive(Copy, Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, De...
use core::ops::{Deref, DerefMut}; use gba::io::dma::{ DMAControlSetting, DMADestAddressControl, DMASrcAddressControl, DMAStartTiming, DMA1, DMA2, }; use gba::io::sound::{ NumberSoundVolume, SoundMasterSetting, WaveVolumeEnableSetting, FIFO_A_L, FIFO_B_L, SOUNDBIAS, SOUNDCNT_H, SOUNDCNT_X, }; use gba::io::t...
use std::collections::HashMap; use std::collections::HashSet; use rustc_arena::DroplessArena; use rustc_hir::def_id::DefId; use rustc_index::vec::IndexVec; use rustc_ast::ast::*; use rustc_span::source_map::DUMMY_SP; use rustc_ast::mut_visit::{self, MutVisitor}; use rustc_ast::token::{self, Token, TokenKind, DelimToke...
#[macro_use] extern crate scan_fmt; use bit_reverse::ParallelReverse; use itertools::Itertools; use multimap::MultiMap; use ndarray::{concatenate, s, Array2, ArrayView, ArrayView2, Axis, Ix1}; use std::collections::HashSet; use std::convert::TryInto; use std::env; #[derive(Clone, Copy, Debug, PartialEq)] enum Directi...
//! A more sophisticated example of how to use shaders //! and canvas's to do 2D GPU shadows. #[macro_use] extern crate gfx; extern crate cgmath; extern crate ggez; use cgmath::{Point2, Vector2}; use ggez::conf; use ggez::event; use ggez::graphics::{self, BlendMode, Canvas, DrawParam, Drawable, Shader}; use ggez::tim...
use lazy_static; use termion::event::Key; use failure::{self, Fail}; use crate::widget::{Widget, WidgetCore}; use crate::coordinates::Coordinates; use crate::async_value::Stale; use crate::fail::{HResult, HError, ErrorLog, ErrorCause}; use crate::imgview::ImgView; use std::path::{Path, PathBuf}; use std::sync::{Arc, ...
extern crate chrono; use quick_xml::events::Event; use quick_xml::Reader; use regex::Regex; use self::chrono::prelude::*; use spotter::InvaderSpotter; use spotter::Point; use std::collections::BTreeMap; use std::fs; use std::fs::File; use std::io::Result; use std::io::prelude::*; use std::ffi::OsStr; const COLOR_ACTI...
#[macro_use] extern crate clap; extern crate crossbeam; extern crate num_cpus; extern crate rayon; use clap::{App, Arg}; use rayon::prelude::*; use std::time::{Instant, Duration}; fn main() { let mandel_config = parse_arguments(); // Create let mut image: Vec<u32> = vec![0; (mandel_config.img_size * man...
//! A small crate to handle WebAssembly interface types in wasmtime. //! //! Note that this is intended to follow the [official proposal][proposal] and //! is highly susceptible to change/breakage/etc. //! //! [proposal]: https://github.com/webassembly/webidl-bindings #![deny(missing_docs)] use anyhow::{bail, format_...
use std::cell::RefCell; use std::rc::Rc; use super::super::condition_resolvers; use super::super::conditions::*; use super::super::parser_helpers; use super::super::print_items::*; pub struct ParseSeparatedValuesOptions { pub prefer_hanging: bool, pub force_use_new_lines: bool, pub allow_blank_lines: bool, pu...
mod models; mod schema; use std::convert::From; use diesel::pg::upsert; use diesel::prelude::*; use diesel::r2d2::{ConnectionManager, Pool, PoolError}; use diesel::result::{DatabaseErrorKind, Error::DatabaseError, Error::NotFound}; use super::{errors::StorageError, Direction, ListSnippetsQuery, Snippet, Storage}; us...
use std::path::PathBuf; use std::pin::Pin; use std::sync::{Arc, Mutex}; use std::{fs::File, sync::atomic::AtomicBool}; use csv::{Position, Reader, StringRecord}; use futures::stream::BoxStream; use futures::task::{Context, Poll}; use futures::{Stream, StreamExt}; use geoengine_datatypes::dataset::DatasetId; use geoeng...
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate 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) a...
// Copyright 2019 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...
// Copyright 2015-2020 Parity Technologies (UK) Ltd. // This file is part of Parity Ethereum. // Parity Ethereum 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...
use proc_macro2::Ident; use quote::{quote, TokenStreamExt}; use spirv_types::image_params::*; use syn::parse::{Parse, ParseStream}; use self::params::SampledType; mod kw { syn::custom_keyword!(u8); syn::custom_keyword!(u16); syn::custom_keyword!(u32); syn::custom_keyword!(u64); syn::custom_keywor...
use super::*; /// Writer for the _annotations array_. /// /// This struct is created by [`Page::annotations`]. pub struct Annotations<'a> { array: Array<'a>, } impl<'a> Writer<'a> for Annotations<'a> { fn start(obj: Obj<'a>) -> Self { Self { array: obj.array() } } } impl<'a> Annotations<'a> { ...
/*! # Easy HTTP Request Easy to send HTTP/HTTPS requests. ## Example ```rust extern crate easy_http_request; use easy_http_request::DefaultHttpRequest; let response = DefaultHttpRequest::get_from_url_str("https://magiclen.org").unwrap().send().unwrap(); println!("{}", response.status_code); println!("{:?}", respo...
use bytesize::ByteSize; use core::fmt; use histogram::Histogram; use log::{error, info}; use std::collections::HashMap; use std::ops::AddAssign; use std::time::{Duration, Instant}; use std::{cmp, io}; pub trait ExternalMetricsServiceReporter { fn report(&self, metrics: &BenchRunMetrics) -> io::Result<()>; fn r...
#[cfg(all(feature = "sgxstd", target_env = "sgx"))] use aead::{generic_array::GenericArray, Aead, NewAead}; #[cfg(all(feature = "sgxstd", target_env = "sgx"))] use aes_gcm::Aes128Gcm; use aes_gcm::Tag; #[cfg(all(feature = "sgxstd", target_env = "sgx"))] use rand::random; use sgx_isa::Keyrequest; #[cfg(all(feature = "sg...
use bytes::Bytes; use futures::{future::result, Future}; use hex::FromHex; #[doc(hidden)] pub use interledger::api::AccountDetails; pub use interledger::service_util::ExchangeRateProvider; use interledger::{ api::{NodeApi, NodeStore}, btp::{connect_client, create_btp_service_and_filter, BtpStore}, ccp::Ccp...
use anchor_token::distributor::HandleMsg as FaucetHandleMsg; use cosmwasm_bignumber::{Decimal256, Uint256}; use cosmwasm_std::{ log, to_binary, Api, BankMsg, Coin, CosmosMsg, Env, Extern, HandleResponse, HandleResult, HumanAddr, Querier, StdError, StdResult, Storage, WasmMsg, }; use moneymarket::interest_model:...
// Copyright 2022 The Engula 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 agreed to...
// An implementation of the NTP clock filter algorithm, as described by // // https://datatracker.ietf.org/doc/html/rfc5905#page-37 // // Specifically this is a rust implementation of the `clock_filter()` routine, // described in the appendix // // https://datatracker.ietf.org/doc/html/rfc5905#appendix-A.5.2 ...
// Copyright 2013 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // 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 ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Interrupt Enable Clear"] pub intenclr: INTENCLR, #[doc = "0x04 - Interrupt Enable Set"] pub intenset: INTENSET, #[doc = "0x08 - Interrupt Flag Status and Clear"] pub intflag: INTFLAG, #[doc = "0x0c - Power and C...
// Copyright (c) 2021 FZI Forschungszentrum Informatik // SPDX-License-Identifier: Apache-2.0 //! Test related to statements use std::sync::Arc; use nom::combinator::all_consuming; use nom::Finish; use quickcheck::{Arbitrary, Gen, TestResult, Testable}; use crate::expr::{self, Expression}; use crate::indentation::{...
use std::cmp::Ordering; use std::convert::TryInto; use std::error::Error; use std::fmt::{self, Display, Formatter}; use std::iter; /// A [Reverse Polish Notation] expression. /// /// # Printing /// /// An expression can be printed in one of two ways. /// By default, the expression is printed using [Reverse Polish Nota...
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub(crate) enum UnOp { Neg, Not, } #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub(crate) enum BinOp { Add, Sub, Mul, Div, Mod, And, Or, Eq, Ne, Lt, Lte, Gt, Gte, } #[inline] fn bool_to_num(b: bool) -...
//! Deserializers for item data. use std::borrow::Cow; use std::collections::HashMap; use std::fmt; use std::time::Duration; use itertools::Itertools; use regex::Regex; use serde::de::{self, Deserialize, Visitor, Unexpected}; use serde_json::Value as Json; use ::common::util::Quasi; use super::super::{ Influence...
#![warn(clippy::all, rust_2018_idioms)] use fltk::{app, app::*, group::Pack, image::*, group::*, self, button::*, draw, enums::*, frame::*, draw::*, prelude::*, widget::*, window::*}; use std::ops::{Deref, DerefMut}; use comp_state::{topo, use_state, use_state_current, StateAccess, CloneState}; use uuid::Uuid; pub mod ...
//! //! USIプロトコル //! use crate::command_line_seek::CommandLineSeek; use crate::cosmic::recording::{CapturedMove, FireAddress, HandAddress, Movement, Phase}; use crate::cosmic::smart::features::{DoubleFacedPieceType, PieceType}; use crate::cosmic::smart::square::AbsoluteAddress2D; use crate::cosmic::smart::square::FILE9...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Activate QSPI interface"] pub tasks_activate: crate::Reg<tasks_activate::TASKS_ACTIVATE_SPEC>, #[doc = "0x04 - Start transfer from external flash memory to internal RAM"] pub tasks_readstart: crate::Reg<tasks_readstart::TAS...
//! # Stellar Toml //! //! The `stellar-toml` provides functions to access the `stellar.toml` //! file. This file contains information about an organization's //! Stellar integration. See //! [SEP-0001](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md) //! for more information. //! //! ## E...
use ash::vk; use ash::extensions::khr; use winit::window::Window; use renderer::{InstanceMTXG, CleanupVkObj}; use renderer::device::DeviceMTXG; use renderer::swapchain::SwapchainMTXG; use renderer::buffer::{BufferMemoryMTXG, ImageMemoryMTXG, create_image_view, UniformBufferMTXG}; use renderer::command_buffers::{Comma...
use crate::*; #[derive(Debug, Hash)] pub struct BuilderPass { pub name: String, pub vertex_shader: ShaderHandle, pub fragment_shader: ShaderHandle, pub output_images: Vec<ImageHandle>, pub input_image: (vk::ImageView, vk::Sampler), // TODO: Convert to image handle pub opt_depth_image: Option<Im...
// Copyright 2021 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 ...
// PASS | uncover_register_conflicts // --------------------------------------------------------------------------- // USAGE | uncover_register_conflicts : alloc_lang::Program -> // | alloc_lang::Program // ----------------------------------------------------------------------...
extern crate chrono; extern crate regex; extern crate anyhow; extern crate clap; extern crate prettytable; extern crate serde_json; extern crate serde; use std::cmp::Ordering; use std::str::FromStr; use std::string::ToString; use std::collections::{HashSet, HashMap}; use std::path::PathBuf; use anyhow::{anyhow, Result...
/// Link Simulator /// /// Copyright (C) 2019 PTScientists GmbH /// /// 17.04.2019 <NAME> extern crate rand; use mio::{Events, Poll, PollOpt, Ready, Token}; use rand::Rng; use std::fmt; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex}; use std::thread; use std::time; #[macro_use] mod err...
use std::collections::BTreeMap; use std::ffi::{OsStr, OsString}; use std::fs; use std::mem; use std::path::{Path, PathBuf}; use std::rc::Rc; use gelatin::glium; use glium::texture::SrgbTexture2d; mod image_loader; use self::image_loader::*; pub mod errors { use crate::image_cache::image_loader; use gelatin::glium...
pub use winit; use vulkano::descriptor::descriptor_set::PersistentDescriptorSet; use vulkano::device::{Device, DeviceExtensions, Features, Queue}; use vulkano::instance::{Instance, PhysicalDevice}; use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer}; use vulkano::command_buffer::AutoCommandBufferBuilder; use vul...
use enum_dispatch::enum_dispatch; use crate::core::scene::Scene; use bumpalo::core_alloc::sync::Arc; use crossbeam::crossbeam_channel::bounded; use indicatif::{ProgressBar, ProgressStyle}; use crate::core::camera::{Cameras, Camera}; use crate::core::sampler::{Samplers, Sampler}; use crate::core::geometry::bounds::Bound...
use std::char; use std::rc::Rc; use std::fmt::Debug; use js_sys::Array; use wasm_bindgen::prelude::{JsValue, wasm_bindgen}; use super::utils::*; pub fn reg_exp() -> &'static str { " '+' \\+ '-' \\- '*' \\* '|' \\| '?' \\? ',' , '^' \\^ '(' \\( ')' \\) '[' \\[ ']' \\] '{' \\{ '...
#![warn(clippy::all)] use crate::powerplant; use crate::infrastructure; use crate::carbon_dioxide; pub struct Clicker { joule: u32, clicked: bool, j_per_click: u32, watt: u32, last_touch_pos: (u16, u16), powerplant: powerplant::Powerplant, infrastructure: infrastructure::Infrastructure, ...
use adnl::common::{KeyId, KeyOption, KeyOptionJson}; use catchain::{BlockPayloadPtr, PublicKey, PublicKeyHash, CatchainNode}; // use serde_json::{Map, Value}; use std::sync::Arc; // use std::str::FromStr; use std::collections::HashMap; // use std::convert::TryInto; use sha2::{Digest, Sha256}; // use ton_client::{ // ...
#![warn(clippy::pedantic)] #![feature(test)] extern crate test; use bitvec::prelude::*; use std::{ cell::RefCell, collections::HashSet, fs::File, io::{BufRead, BufReader}, ops::Range, rc::Rc, }; trait Intersection { fn intersection(&self, other: &Self) -> Option<Self> where Se...
//! --- Part Two --- //! //! Strangely, the exit isn't open when you reach it. Then, you remember: the ancient Plutonians //! were famous for building recursive spaces. //! //! The marked connections in the maze aren't portals: they physically connect to a larger or //! smaller copy of the maze. Specifically, the label...
use super::*; use coco::epoch::{Scope, pin}; impl<'a> IntoIterator for &'a Tree { type Item = (Vec<u8>, Vec<u8>); type IntoIter = Iter<'a>; fn into_iter(self) -> Iter<'a> { self.iter() } } /// A flash-sympathetic persistent lock-free B+ tree pub struct Tree { pages: PageCache<BLinkMater...
mod floodfill; mod objects; mod polygons; use crate::app::{App, ShowLayers, ShowObject}; use crate::common::{tool_panel, CommonState, ContextualActions}; use crate::game::{msg, DrawBaselayer, State, Transition, WizardState}; use crate::helpers::ID; use crate::managed::{WrappedComposite, WrappedOutcome}; use crate::ren...
// 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 ...
// 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 crate::attrs::FromPyWithAttribute; use proc_macro2::TokenStream; use quote::quote; use syn::punctuated::Punctuated; use syn::spanned::Spanned; use syn::{parse_quote, Attribute, DataEnum, DeriveInput, Fields, Ident, Meta, MetaList, Result}; /// Describes derivation input of an enum. #[derive(Debug)] struct Enum<'a>...
use super::*; use std::sync::Mutex; use std::ptr::{null, null_mut}; use smallvec::SmallVec; use std::{fmt, fmt::{Debug, Display, Formatter}}; use tree_policy::TreePolicy; /// You're not intended to use this class (use an `MCTSManager` instead), /// but you can use it if you want to manage the threads yourself. pub str...
// Copyright 2018 Google 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 in...
use sp_ipld::Ipld; use sp_std::{ borrow::ToOwned, convert::TryFrom, fmt, }; use alloc::string::String; use crate::{ ipld_error::IpldError, literal::Literal, prim::bits, term::Term, yatima, parse, defs, }; /// Primitive 128-bit signed integer operations #[derive(PartialEq, Eq, Clone, Copy, Debug)...
use std::convert::TryFrom; use std::fmt::Debug; use std::io::BufReader; use std::io::ErrorKind; use std::net::SocketAddr; use std::net::TcpListener; use std::net::TcpStream; use std::net::ToSocketAddrs; use std::os::unix::io::AsRawFd; use std::sync::Arc; use std::sync::Mutex; use std::thread::spawn; use std::thread::Jo...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Starts the SAADC and prepares the result buffer in RAM"] pub tasks_start: TASKS_START, #[doc = "0x04 - Takes one SAADC sample"] pub tasks_sample: TASKS_SAMPLE, #[doc = "0x08 - Stops the SAADC and terminates all on-going...
impl super::AdapterShared { pub(super) fn describe_texture_format( &self, texture_format: wgt::TextureFormat, ) -> super::TextureFormatDesc { use wgt::TextureFormat as Tf; let (internal, external, data_type) = match texture_format { Tf::R8Unorm => (glow::R8, glow::RE...
use std::{ collections::{BTreeSet, HashMap}, ops::Range, ptr::NonNull, thread, }; use { crate::{ allocator::{Allocator, Kind}, block::Block, mapping::*, memory::*, util::*, }, gfx_hal::{Backend, Device as _}, hibitset::{BitSet, BitSetLike as _}, }...
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0. use crate::{Inflights, ProgressState, INVALID_INDEX}; use std::cmp; /// progress 代表跟随着当前leader节点的 其它replicate节点的复制进度 /// 该组件也是一个状态机,有三种状态,定义在ProgressState /// + Probe /// 探测状态,说明leader节点不知道目标节点的复制进度,所以进行探测 /// + Replicate /// 复制状态, 说明leader已经知道目标节...
use std::path::PathBuf; use clap::Parser; use verneuil::chain_error; use verneuil::fresh_error; use verneuil::Options; use verneuil::Result; #[derive(Debug, Parser)] #[clap( name = "verneuilctl", about = "utilities to interact with Verneuil snapshots" )] /// In order to interact with Verneuil snapshots, verne...
use super::structure_builder::ASTBuilder; use super::structure_iter; use crate::{ errors, lang::{ast, component}, utils::NameGenerator, }; use ast::{Atom, BitNum, Cell, Connection, Group, Port, Wire}; use component::Component; use errors::{Error, Extract, Result}; use itertools::Itertools; use petgraph::{ ...
// Copyright (c) 2018-2021 <NAME> <<EMAIL>> // Distributed under the MIT License // (See acoompanying LICENSE file or a copy at http://opensource.org/licenses/MIT) //! Parser del Building Description Language (BDL) de DOE //! //! Cerramientos opacos de la envolvente térmica: //! - EXTERIOR-WALL //! - ROOF //! - INTERI...
// Copyright 2018 <NAME> <https://portstrom.com> // This is free software distributed under the terms specified in // the file LICENSE at the top-level directory of this distribution. /*! Parse XML dumps exported from MediaWiki. This module parses [XML dumps](https://www.mediawiki.org/wiki/Help:Export) exported from ...
use std::collections::HashMap; use std::fs; use std::mem; use serde::{Deserialize, Serialize}; use winapi::shared::windef::{HBRUSH, HDC}; use winapi::um::wingdi::{CreateSolidBrush, DeleteObject, RGB}; use winapi::um::winuser::{BeginPaint, EndPaint, FillRect, FrameRect, PAINTSTRUCT}; use crate::common::{get_active_mo...
//! HCI Event and event utilities. use crate::bytes::{StaticBuf, Storage}; use crate::hci::packet::{PacketType, RawPacket}; use crate::hci::{ErrorCode, Opcode, EVENT_CODE_LEN, OPCODE_LEN}; use crate::ConversionError; use crate::PackError; use core::convert::{TryFrom, TryInto}; use core::fmt::Formatter; /// HCI Event C...
// Copyright 2020 The Vega 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 in ...
use std::collections::HashMap; use tokio::prelude::*; extern crate proc_macro; use crate::amf::Value; use log::{info, trace, warn}; use std::fmt; #[derive(Debug, Clone, PartialEq)] pub struct Message { pub stream_id: u32, pub data: MessageData, } pub const CONNECTION_CHANNEL: Option<u32> = None; // ideally w...
#[macro_use] mod helpers; mod ext; mod nodes; use crate::ast::*; use ext::*; use std::fmt; #[derive(Copy, Clone, Debug, PartialEq, Eq)] enum Context { None, InsertRelation, AExpr, CreateType, AlterType, #[allow(dead_code)] Identifier, Constant, ForeignTable, } #[derive(Debug)] enu...
use anyhow::Result; use parking_lot::Mutex; use procfs::process::Process; use rand::prelude::SliceRandom; use rand::Rng; use ringbuffer::{ConstGenericRingBuffer, RingBufferExt, RingBufferWrite}; use std::fmt::{Debug, Display}; use std::hash::Hash; use std::rc::Rc; use std::sync::atomic::{AtomicBool, Ordering}; use std:...
//! # Lightning Module //! //! This module allows to atomically and trustlessly (in the federated trust model) interact with //! the Lightning network through a Lightning gateway. See [`LightningModule`] for a high level //! overview. //! //! ## Attention: only one operation per contract and round //! If this module is...
use std::path::PathBuf; use std::str::FromStr; use clap::{Parser, ValueHint}; use cli_table::ColorChoice; use hyperqueue::client::commands::autoalloc::{command_autoalloc, AutoAllocOpts}; use hyperqueue::client::commands::jobs::{cancel_job, output_job_detail, output_job_list}; use hyperqueue::client::commands::log::{c...
//////////////////////////////////////////////////////////////////////////////// // // 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::color_range...
use crate::LintLevel; use failure::Error; use rayon::prelude::*; use semver::{Version, VersionReq}; use serde::Deserialize; use std::{cmp, collections::HashMap, fmt}; #[derive(Deserialize, Debug, PartialOrd, PartialEq, Ord, Eq)] pub struct CrateId { // The name of the crate pub name: String, /// The versio...
use crate::akula::address::{create2_address, create_address}; use crate::akula::fee_params::{fee, param}; use crate::akula::interface::State; use crate::akula::intra_block_state::IntraBlockState; use crate::akula::types::{Log, PartialHeader}; use crate::akula::utils::{get_effective_gas_price, get_sender}; use crate::ak...
//! An atom containing multiple key-value pairs. //! //! This module is centered on the [`Object`](struct.Object.html) atom type. An object is the atomized form of an RDF instance: It has an (optional) id, a type and multiple properties declared as URID/Atom pairs. Both the id and the type are URIDs too. //! //! # Exam...
#![allow(non_snake_case)] #![allow(non_camel_case_types)] use core::ffi::c_void; use core::ptr::null_mut; use windows_sys::core::*; use windows_sys::Win32::Foundation::*; use windows_sys::Win32::Graphics::Gdi::HFONT; pub const FILTER_FLAG_NO_CONFIG: i32 = 0x100000; pub const FILTER_FLAG_ALWAYS_ACTIVE: i32 = 0x4; pub...
use crate::core_types::Vector2; /// Clamp method for f32. /// NOTE: This method was copied as-is from std. This was done to avoid compatibility issues /// with newer rustc versions and should be removed in favor of f32::clamp once that is stable. #[inline] fn clamp(num: f32, min: f32, max: f32) -> f32 { assert!(mi...
//! Creation and manipulation of composition graphs. This implements routines for creating and //! optimising such graphs, in preparation for performing tree search. mod falseness; pub mod optimise; use std::{ cmp::{Ordering, Reverse}, collections::{BinaryHeap, HashMap, HashSet}, }; use bellframe::{Row, Row...
use async_bincode::AsyncBincodeStream; use dataflow::prelude::DataType; use dataflow::prelude::*; use dataflow::Readers; use dataflow::SingleReadHandle; use futures_util::{ future, future::Either, future::{FutureExt, TryFutureExt}, stream::{StreamExt, TryStreamExt}, }; use noria::{ReadQuery, ReadReply, ...
use crate::index_serialization; use crate::plonk_verifier_index::{ CamlPlonkDomain, CamlPlonkVerificationEvals, CamlPlonkVerificationShifts, CamlPlonkVerifierIndex, }; use crate::tweedle_dum::CamlTweedleDumPolyComm; use crate::tweedle_fq_plonk_index::CamlTweedleFqPlonkIndexPtr; use crate::tweedle_fq_urs::CamlTw...
#![deny(rust_2018_idioms)] //! This example illustrates advanced usage of Dropbox's chunked file upload API to upload large //! files that would not fit in a single HTTP request, including allowing the user to resume //! interrupted uploads, and uploading blocks in parallel. use dropbox_sdk::files; use dropbox_sdk::d...
use crate::memmem::{rarebytes::RareNeedleBytes, NeedleInfo}; mod fallback; #[cfg(all(target_arch = "x86_64", memchr_runtime_simd))] mod genericsimd; #[cfg(all(not(miri), target_arch = "x86_64", memchr_runtime_simd))] mod x86; /// The maximum frequency rank permitted for the fallback prefilter. If the /// rarest byte ...
use std::io::Cursor; use std::sync::{Mutex}; use nanoserde::SerJson; use wgpu::vertex_attr_array; use zerocopy::{AsBytes, FromBytes}; use crate::files; use crate::framework; use crate::text; use crate::ui; use crate::ui::{filetree, UIState}; use crate::ui::{GUIConfig, GUIConfigStrings}; use crate::ui::align::AlignCon...
use engine::command::{Command, BuildingType}; use engine::geometry::Point; use engine::constants::*; use engine::status::GameStatus; use arrayvec::ArrayVec; const LEFT_COL_MASK: u64 = 0x0101_0101_0101_0101; const RIGHT_COL_MASK: u64 = 0x8080_8080_8080_8080; const ROW_MASKS: [u64; MAP_HEIGHT as usize] = [ 0x0000_...
// Copyright 2018 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT // http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD // https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied, // modified, or di...
use crate::configuration::Configuration; use crate::persistence::embedding::EmbeddingPersistor; use crate::persistence::entity::EntityMappingPersistor; use crate::sparse_matrix::SparseMatrixReader; use log::{info, warn}; use memmap::MmapMut; use rayon::prelude::*; use std::collections::hash_map::DefaultHasher; use std:...
#![doc = include_str!("../README.md")] #![recursion_limit = "1024"] #![cfg_attr(test, allow(soft_unstable))] #![cfg_attr(test, feature(test))] #![cfg_attr(feature = "fn_traits", feature(fn_traits, unboxed_closures))] #[cfg(test)] extern crate test; #[macro_use] extern crate derivative; extern crate approx; extern cr...
use crate::camera::{Camera, CameraController}; use crate::texture::Texture; // use crate::vertex::Vertex; use crate::geom; use crate::geom::{DrawGeom, GeomVertex, Vertex}; use crate::light::{DrawLight, Light}; use nannou::math::cgmath; use nannou::prelude::*; pub struct Pass { obj_model: geom::Geom, // vertex_...
//! AbuseIPDB API Client. //! //! ```rust //! use abuseipdb::Client; //! use std::net::Ipv4Addr; //! //! async fn example() { //! let my_ip = Ipv4Addr::new(127, 0, 0, 1).into(); //! let client = Client::new("<API-KEY>"); //! let response = client.check(my_ip, None, false).await.unwrap(); //! println!("a...
// Copyright 2018 The Grin Developers // Modifications Copyright 2019 The Gotts 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...
use crates; use dirs::{CRATES_DIR, EXPERIMENT_DIR, TEST_SOURCE_DIR}; use errors::*; use file; use gh_mirrors; use lists::{self, Crate, List}; use run; use serde_json; use std::collections::HashMap; use std::fmt::{self, Display, Formatter}; use std::fs; use std::path::{Path, PathBuf}; use std::str::FromStr; use toml_fro...
//! This module corresponds to `mach/message.h`. use kern_return::kern_return_t; use port::{mach_port_name_t, mach_port_t}; use vm_types::{integer_t, natural_t}; pub type mach_msg_timeout_t = natural_t; pub type mach_msg_bits_t = ::libc::c_uint; pub type mach_msg_id_t = integer_t; pub type mach_msg_size_t = natural_...
extern crate float_cmp; extern crate byteorder; extern crate rand; extern crate cpu_time; use std::error::Error; use std::fs::{File, OpenOptions, remove_file}; use std::io::{BufReader, BufWriter}; use std::io::prelude::*; use std::path::Path; use std::str; use std::io; use std::fmt; use cpu_time::ProcessTime; use std...
pub mod auth; pub mod juniper_hyper; #[macro_use] extern crate lazy_static; fn baseref_and_options(refname: &str) -> josh::JoshResult<(String, String, Vec<String>, bool)> { let mut split = refname.splitn(2, '%'); let push_to = split.next().ok_or(josh::josh_error("no next"))?.to_owned(); let options = if ...
//! # env //! //! Sets up the env vars before running the tasks. //! pub(crate) mod crateinfo; mod gitinfo; #[cfg(test)] #[path = "./mod_test.rs"] mod mod_test; use crate::command; use crate::types::{ CliArgs, Config, CrateInfo, EnvInfo, EnvValue, EnvValueScript, GitInfo, PackageInfo, Step, Task, Workspace, ...
//! A demonstration of an offchain worker that sends onchain callbacks // 我将价格保留到小数点后3位,并且为了方便存储都乘了1000变成整数,所以使用时需要除1000才是真实的USD价格 #![cfg_attr(not(feature = "std"), no_std)] #[cfg(test)] mod tests; use core::{convert::TryInto, fmt}; use frame_support::{ debug, decl_error, decl_event, decl_module, decl_storage,...
//! Contains all structures and methods to create and manage scene graph nodes. //! //! For more info see [`Node`] #![warn(missing_docs)] use crate::{ core::{ algebra::{Matrix4, Vector2}, inspect::{Inspect, PropertyInfo}, math::aabb::AxisAlignedBoundingBox, pool::Handle, uu...