text
stringlengths
7.05k
33.9k
mod structs; pub use structs::*; use etterna::*; use crate::extension_traits::*; use crate::Error; /// The kind of ranges that EO can process. Ranges can never be empty! They must have one or more /// elements pub trait EoRange { #[doc(hidden)] /// The length must not be zero fn start_length(&self) -> (u32, u32);...
use crate::{setup::*, periph::FmcPeriph}; use core::cmp::max; use drone_cortexm::reg::prelude::*; use drone_core::bitfield::Bitfield; pub struct FmcDrv { fmc: FmcPeriph, bank1_capacity: Option<usize>, bank2_capacity: Option<usize>, } #[allow(dead_code)] enum SdRamCommand { NormalMode, ClockConfigu...
//! AWS service sigv4 signer use std::borrow::Cow; use std::fmt::{Debug, Display, Formatter}; use std::mem; use std::str::FromStr; use std::sync::Arc; use std::sync::RwLock; use anyhow::{anyhow, Result}; use http::header::HeaderName; use http::{HeaderMap, HeaderValue}; use log::debug; use percent_encoding::utf8_perce...
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { fuchsia_inspect::{ health::Reporter, Inspector, IntProperty, Node, NumericProperty, Property, UintProperty, }, fuchsia_zircon as ...
use std::collections::btree_map::{Range, RangeMut}; use crate::units::{Pseudoangle, Float}; use crate::edge::Edge; use crate::intersection_algorithm::snippet::{Snippet}; use crate::intersection_algorithm::ray::Ray; use crate::intersection_algorithm::scope::{Lhs, Rhs, Key, ReversedKey}; use crate::edge::queue::AbstractQ...
// https://www.codewars.com/kata/5a5db0f580eba84589000979/train/rust #[cfg(test)] mod example_tests { use super::*; #[test] fn cell_move_test() { use pnz::field::*; let mut cell = Cell(0, 0); let field = Field::new(&vec!["2 ", " S "]); assert!(cell.can_move_by_direction...
#[macro_use] use phf::{map, Map}; use structopt::StructOpt; use crate::parser::InputType; use OptionField::*; use smallvec::SmallVec; // Enum defined below const DEFAULT_TAB_WIDTH: u8 = 2u8; pub type OptionSet = SmallVec<[OptionField;1]>; pub enum OptionValue<'a> { String(InputType<'a>), Bool(bool), Number(u...
extern crate ord_subset; use crate::vec3::Vec3; use crate::vec3_avx::{avx_cross_product, avx_dot_product}; use crate::vec3_sse::{sse_cross_product, sse_dot_product}; use crate::{HitInformation, Intersectable, Ray, RayScattering}; use std::arch::x86_64::*; use std::mem; pub struct BasicTriangle { /// /// Conven...
//! A list of widgets for dispatch Widget trait functions to specific widgets //! //! A Container implements Widget trait, so Containers can be nested. The widget list //! of a Container cannot be modified after moved to a "parent" Container use crate::group::{Group, GroupID}; use crate::state::{KeyState, MouseState};...
// Copyright (C) 2020-2022 <NAME>. /* usage: RUST_LOG=debug cargo run --release \ --bin bvb -- http://127.0.0.1:8001 gametag userid num 2>&1 | tee output.log userid = 0 or 1 num = number of games */ use log::*; use rand::prelude::*; use wolges::*; use std::fmt::Write; use std::str::FromStr; thread_l...
//! # IPFS sqlite block store //! //! A block store for a rust implementation of [ipfs](https://ipfs.io/). //! //! # Concepts //! //! ## Aliases //! //! An alias is a named pin of a root. When a root is aliased, none of the leaves of the dag pointed //! to by the root will be collected by gc. However, a root being alia...
use std::io; use bytes::Bytes; use futures::{Async, AsyncSink, Future, Poll, Stream}; use tokio_io::{AsyncRead, AsyncWrite}; use tokio_service::Service; use proto::{Body, Conn, Http1Transaction, MessageHead, RequestHead, ResponseHead}; use ::StatusCode; pub struct Dispatcher<D, Bs, I, B, T> { conn: Conn<I, B, T>...
use super::*; enum PollAndPopulateError { PollFailed, Timeout, } struct TryRecvAnyNetError { error: NetEndpointError, index: usize, } ///////////////////// impl NetEndpoint { // Returns the bincode configuration the NetEndpoint uses pervasively // for configuration on ser/de operations. fn...
use colored::Colorize; use serde::Deserialize; use serde_with::serde_as; use std::{ collections::HashMap, ffi::OsString, fs::OpenOptions, io::Write, path::{Path, PathBuf}, }; #[derive(Deserialize, Debug)] pub struct Recipe { pub params: HashMap<String, Param>, pub steps: HashMap<String, Ste...
use std::collections::HashMap; use std::io::{ Error, ErrorKind }; use std::time::{ Instant }; #[macro_use] extern crate lazy_static; lazy_static! { pub static ref MAPPING: HashMap<String, (String, bool)> = { let mut map = HashMap::new(); map.insert("doctype".to_string(), ("!DOCTYPE".to_string(), tr...
use std::{mem, ptr, cell, slice, fs, ffi}; use std::os::unix::io::{IntoRawFd}; use std::io::{Write, BufRead}; use libc; use image::*; use mozjpeg_sys::*; use meta::*; use srcs::*; struct DecClientData<R> { reader: R, //last_bytes_in_buffer: usize, } pub struct MozJPEGDecoder<R> { cdata: cell::UnsafeCell<D...
use libc; use std::cmp; use std::ptr; use elf::program_header; #[allow(non_camel_case_types)] #[derive(Debug)] pub enum Struct___locale_map { } #[allow(non_camel_case_types)] #[repr(C)] #[derive(Debug)] pub struct Struct___locale_struct { pub cat: [*const Struct___locale_map; 6usize], } #[allow(non_camel_case_ty...
use core::ops::Index; use embedded_hal::blocking::spi::Transfer; use spi_memory::prelude::*; use spi_memory::series25::Flash; use embedded_hal::digital::v2::OutputPin; #[derive(Debug, Copy, Clone)] struct Filename { filename: [u8; 16], } impl Filename { fn empty() -> Filename { Filename { ...
//! Just a dumping ground for cli stuff use crate::errors::*; use crate::self_update; use crate::term2; use git_testament::{git_testament, render_testament}; use lazy_static::lazy_static; use rustup::utils::notify::NotificationLevel; use rustup::utils::utils; use rustup::{Cfg, Notification, Toolchain, UpdateStatus}; u...
use std::collections::{BTreeMap, BTreeSet, HashSet}; use std::path::{Path, PathBuf}; use std::sync::Arc; use std::{env, fs}; use tempfile::Builder as TempFileBuilder; use crate::core::compiler::{DefaultExecutor, Executor}; use crate::core::{Edition, Package, Source, SourceId}; use crate::core::{PackageId, Workspace};...
// Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). use std::collections::HashSet; use std::ffi::OsStr; use std::fmt::Display; use std::iter::Iterator; use std::path::{Component, Path, PathBuf}; use std::sync::Arc; use async_trait::async...
// Bitcoin Dev Kit // Written in 2020 by <NAME> <<EMAIL>> // // Copyright (c) 2020-2021 Bitcoin Dev Kit Developers // // This file is 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>...
//! This module contains everything needed by our GUI app to render using wgpu-rs. //! It will take a component list (Which is the GUI objects we want to render), //! and then get the required resources - like font assets, images and more, //! and render it to the screen as a quad. This module does little more than, //...
use crate::block_connector::{BlockConnector, PivotBlock}; /// Sync message which outbound use crate::block_sync::BlockSyncTaskActor; use crate::helper::{ get_block_infos, get_headers_by_number, get_headers_msg_for_ancestor, get_headers_with_peer, }; use crate::state_sync::StateSyncTaskActor; use crate::sync_metrics...
//! A clone of the `laser_frame_stream.rs` example that allows for configuring laser settings via a //! UI. use nannou::geom::Rect; use nannou::prelude::*; use nannou::ui::prelude::*; use nannou_laser as laser; use std::sync::{mpsc, Arc}; fn main() { nannou::app(model).update(update).run(); } struct Model { ...
use super::{MeshContainer, Model, Msg, ShouldRender}; use crate::io::*; use crate::render_buffers::{MeshSurface, VertexData}; use image::GenericImageView; use log::*; use rust_3d::{io::load_stl_mesh_unique, *}; use std::collections::HashMap; use std::path::Path; use three_d::core::types::InnerSpace; use three_d::vec3; ...
//! GPT labeling for Nexus devices. The primary partition //! (/dev/x1) will be used for meta data during, rebuild. The second //! partition contains the file system. //! //! The nexus will adjust internal data structures to offset the IO to the //! right partition. put differently, when connecting to this device via /...
// Copyright 2017 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 crate::gf2::add_assign_binary; use crate::iterators::OctetIter; use crate::octet::Octet; use crate::octets::BinaryOctetVec; use crate::util::get_both_ranges; use std::mem::size_of; // TODO: change this struct to not use the Octet class, since it's binary not GF(256) pub trait BinaryMatrix: Clone { fn new(heigh...
use crate::avm1::activation::Activation; use crate::avm1::error::Error; use crate::avm1::function::{Executable, FunctionObject}; use crate::avm1::object::Object; use crate::avm1::property::Attribute; use crate::avm1::{Avm1, ScriptObject, TObject, Value}; use crate::avm_warn; use bitflags::bitflags; use core::fmt; use g...
// Copyright 2016 <NAME> // // Licensed under the MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>. // This file may not be copied, modified, or distributed except according to those terms. use super::allocator::AllocatorHandle; pub const INT_MASK: u32 = 0xffff_0000; pub const EXT_MASK: u32 = 0x0000_ff...
//! Bindings to the client library `libwayland-server.so` //! //! The generated handle is named `WAYLAND_SERVER_HANDLE` #![cfg_attr(rustfmt, rustfmt_skip)] use super::common::*; #[cfg(feature = "server")] use libc::{gid_t, pid_t, uid_t}; #[cfg(feature = "server")] use std::os::raw::c_char; use std::os::raw::{c_int, c...
use std::fmt::{self, Debug}; use std::path::{Path, PathBuf}; use std::sync::{Arc, RwLock}; use linked_hash_map::LinkedHashMap; use rmp_serde::{Deserializer, Serializer}; use serde::{Deserialize, Serialize}; use super::super::http_client::{CacheControl, HttpClient}; use super::{CacheBackend, CacheType, DummyBackend}; ...
use std::borrow::Borrow; use std::cell::RefCell; use std::cmp::max; use std::collections::HashMap; use std::mem::{size_of, size_of_val}; use std::ops::Range; use std::rc::Rc; use std::sync::Arc; use crate::guest_mem::{MappedMemory, PhysHostMap}; use crate::kvm::hypervisor::{memory::process_read, memory::PhysMem, Hyper...
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Portions Copyright 2017 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-BSD-3-Clause file. // // Copyright © 2019 Intel Corporation // // SPDX-...
use crate::generated::eth_header_cell::ETHHeaderCellMerkleDataReader; use anyhow::{anyhow, Result}; use ckb_hash::{blake2b_256, new_blake2b}; use ckb_jsonrpc_types as rpc_types; use ckb_sdk::constants::{MULTISIG_TYPE_HASH, SECP_SIGNATURE_SIZE, SIGHASH_TYPE_HASH}; use ckb_sdk::{Address, AddressPayload, HttpRpcClient, Mu...
//! This module contains example models and logic to demonstrate practical usage of rosomaxa crate. #[cfg(test)] #[path = "../tests/unit/example_test.rs"] mod example_test; use crate::algorithms::gsom::Input; use crate::evolution::*; use crate::hyper::*; use crate::population::{DominanceOrder, DominanceOrdered, Rosom...
use crate::{ auth::{Action, AuthorizationPolicy, AuthorizationToken}, cas::ContentAddressedStorage, codec::SupportedCodecs, config::ExternalApis, ipfs::Ipfs, s3::{Service, Store}, siwe::{SIWETokens, SIWEZcapTokens}, tz::TezosAuthorizationString, tz_orbit::params_to_tz_orbit, zcap...
use std::convert::TryInto; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::Arc; use std::time::Duration; use Ordering::SeqCst; use async_compat::CompatExt; use crossbeam::queue::SegQueue; use time::OffsetDateTime; use futures::stream::{self, Stream}...
//! Rspotify is a wrapper for the [Spotify Web API][spotify-main], inspired by //! [spotipy][spotipy-github]. It includes support for all the [authorization //! flows][spotify-auth-flows], and helper methods for [all available //! endpoints][spotify-reference]. //! //! ## Configuration //! //! ### HTTP Client //! //! B...
use crate::{utils::*, PipelineTrait, RenderConfig, RenderTarget, TextMetrics}; use font_kit::handle::Handle; use pathfinder_canvas::{ ArcDirection, Canvas, CanvasFontContext, CanvasRenderingContext2D, FillRule, FillStyle, Path2D, RectF, TextBaseline, }; use pathfinder_color::ColorU; use pathfinder_geometry::ve...
#![allow(clippy::cast_ptr_alignment, clippy::cast_sign_loss)] use std::sync::Arc; use arrow::array; use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator}; use super::{ change::ArrayChange, flush::GrowableBatch, ArrowBatch, Batch as BatchRepr, DynamicBatch, }; use crate::{ datasto...
pub mod aligned_binary; mod heap; mod match_context; pub mod maybe_aligned_maybe_binary; mod process; mod sub; use core::mem; use core::ptr; use core::slice; use crate::borrow::CloneToProcess; use crate::erts::term::binary::aligned_binary::AlignedBinary; use crate::erts::term::binary::maybe_aligned_maybe_binary::Mayb...
use std::default::Default; use std::io::Error as IoError; use std::io::ErrorKind; use std::fmt::Display; use core::pin::Pin; use core::task::Poll; use core::task::Context; use log::debug; use log::trace; use async_trait::async_trait; use futures::Stream; use futures::stream::StreamExt; use futures::stream::empty; use ...
// Copyright 2017 The Australian National University // // 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 applicab...
#![no_std] #![allow(clippy::many_single_char_names)] use core::mem::size_of; use core::ptr::read_unaligned; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct U128 { pub lo: u64, pub hi: u64, } impl U128 { #[inline] pub const fn new(lo: u64, hi: u64) -> Self { Self { lo, hi } } ...
/* This file contains several #[allow(dead_code)] because subworkers are disable now, but as they are planned to be reenabled, I do not want to remove the code for name */ use std::fs::File; use std::process::Stdio; use bytes::{Bytes, BytesMut}; use futures::stream::{SplitSink, SplitStream}; use futures::{Si...
// Copyright (c) 2018, <NAME> // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of condit...
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
/* * // Copyright (c) 2021 <NAME> * // * // I am making my contributions/submissions to this project solely in my * // personal capacity and am not conveying any rights to any intellectual * // property of any third parties. */ use crate::vec_float::{Float3, FloatType}; use crate::quaternion::Quaternion; use cra...
#![allow(clippy::large_enum_variant)] mod breadcrumbs; pub mod frontend_types; mod http_bits; mod navigation; mod stars; use seed::{browser::service::fetch, prelude::*, *}; use shared::Meal; use uuid::Uuid; static URL_BASE: &str = include_str!("api_loc.txt"); static GITBITS: &str = include_str!("gitbits.txt"); const ...
extern crate irc; extern crate actix; extern crate futures; extern crate utils; extern crate actors; extern crate regex; use self::futures::{ Stream }; use self::actix::prelude::*; use self::irc::client::{ Client, IrcClient }; use self::irc::proto::command::Command; use self::irc::proto::message::Message a...
//! Python Compiler use crate::codegen::{ServiceAdded, ServiceCodegen}; use crate::flavored::*; use crate::utils::BlockComment; use crate::{Options, EXT, INIT_PY}; use backend::PackageProcessor; use core::errors::Result; use core::{Handle, RelativePathBuf, Spanned}; use genco::prelude::*; use naming::{self, Naming}; u...
//! SNMP Parser //! //! SNMP is defined in the following RFCs: //! - [RFC1157](https://tools.ietf.org/html/rfc1157): SNMP v1 //! - [RFC1902](https://tools.ietf.org/html/rfc1902): SNMP v2 SMI //! - [RFC3416](https://tools.ietf.org/html/rfc3416): SNMP v2 //! - [RFC2570](https://tools.ietf.org/html/rfc2570): Intro...
use std::{sync::Arc}; use legion::prelude::*; use nalgebra_glm::{Vec4, Vec3}; use bytemuck::{Pod, Zeroable}; use super::{GPUResourceManager, RenderTarget, BindGroup}; use crate::{graphics::{pipeline_manager::PipelineManager, RenderGraph}, scene::components::CameraData, AssetManager}; //use crate::graphics::systems::cr...
use super::clipboard; use box2d_rs::b2_settings::*; use box2d_rs::b2_math::*; use glium::backend::Facade; use glium::glutin; use glium::glutin::dpi::{PhysicalPosition, PhysicalSize}; use glium::glutin::event::{Event, VirtualKeyCode, WindowEvent, MouseButton, ModifiersState, ElementState, MouseScrollDelta}; use glium::g...
mod config; use clap::Parser; use codec::{Compact, Decode, Encode}; use common::{create_custom_connection, WsRpcClient}; use config::Config; use hdrhistogram::Histogram as HdrHistogram; use log::{debug, info}; use rayon::current_thread_index; use rayon::prelude::*; use sp_core::{sr25519, Pair}; use sp_runtime::{generi...
// 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. //! Netstack3 bindings. //! //! This module provides Fuchsia bindings for the [`netstack3_core`] crate. #[macro_use] mod macros; #[cfg(test)] mod integra...
#![allow(non_snake_case, non_upper_case_globals)] #![allow(non_camel_case_types)] //! DFSDM1 //! //! Used by: stm32mp153, stm32mp157 #[cfg(not(feature = "nosync"))] pub use crate::stm32mp::peripherals::dfsdm1::Instance; pub use crate::stm32mp::peripherals::dfsdm1::{RegisterBlock, ResetValues}; pub use crate::stm32mp::...
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use super::category::AppCategory; use crate::bundle::{common, platform::target_triple}; use serde::Deserialize; use std::{ collections::HashMap, path::{Path, PathBuf}, }; ...
// 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>. //! Rendering as terminal text. Why not? Turn cubes into rectangles. use cgmath::ElementWise as _; use crossterm::cursor::{self, MoveTo}; use crossterm::event::{...
use std::sync::Arc; use kajiya::{ backend::{ ash::{self, vk}, Device, Image, ImageDesc, ImageViewDesc, }, ui_renderer::UiRenderer, }; use imgui_winit_support::{HiDpiMode, WinitPlatform}; use parking_lot::Mutex; struct GfxResources { //imgui_render_pass: RenderPass, pub imgui_rende...
use crate::ast::{ BinaryOp, Constant, Fun, Ident, Path, Typ, TypX, UnaryOp, UnaryOpr, VarAt, VirErr, }; use crate::ast_util::{err_str, path_as_rust_name}; use crate::context::Ctx; use crate::sst::{Exp, ExpX, Trig, Trigs, UniqueIdent}; use crate::util::vec_map; use air::ast::Span; use std::collections::{HashMap, Has...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #![allow(clippy::single_match)] use std::{num::NonZeroU64, path::Path}; use anyhow::Result; use log::{debug, error, trace}; use rand::{thread_rng, Rng}; use win_util::{last_os_error, process}; use winapi::{ shared::minwindef::{DWORD, LPCV...
use bevy::{ app::AppExit, core::Time, input::system::exit_on_esc_system, prelude::{ debug, App, AssetServer, Color, Commands, Component, DefaultPlugins, Entity, EventReader, EventWriter, HorizontalAlign, OrthographicCameraBundle, ParallelSystemDescriptorCoercion, ParamSet, Query,...
mod help; use cassandra_cpp::*; use std::time::SystemTime; use time::Duration; #[derive(Debug, PartialEq, Copy, Clone, Default)] struct Udt { dt: u32, tm: i64, } #[derive(Debug, PartialEq, Clone, Default)] struct Basic { bln: bool, flt: f32, dbl: f64, i8: i8, i16: i16, i32: i32, i...
extern crate gl; pub mod primitives; pub mod program; pub mod mesh; use std::mem; use std::collections::HashMap; /// Type of a Vertex Attribute, used by Mesh to know which parts of the Vertex vectors hold the /// position, normal, UV, etc. /// /// A Vertex is a Vector of floats where all vertex data () is aligned in...
#![deny(rust_2018_idioms)] #![warn( missing_copy_implementations, missing_debug_implementations, clippy::explicit_iter_loop, clippy::use_self, clippy::clone_on_ref_ptr )] //! # Write Buffer //! //! This crate provides a local-disk based Write Buffer tailored for //! InfluxDB IOx `Partition`s. //! /...
use super::{Error, Item, Span, Value, ValueKind}; use crate::*; use anyhow::Result; use std::collections::{HashMap, HashSet}; use std::mem; #[derive(Default)] pub struct Resolver { type_lookup: HashMap<String, TypeId>, types: Arena<TypeDef>, resource_lookup: HashMap<String, ResourceId>, resources_copie...
//! Managed version of the pool. //! //! "Managed" means that it requires a [`Manager`] which is responsible for //! creating and recycling objects as they are needed. //! //! # Example //! //! ```rust //! use async_trait::async_trait; //! use deadpool::managed; //! //! #[derive(Debug)] //! enum Error { Fail } //! //! ...
use std::future::Future; use std::ops::{Deref, DerefMut}; use std::sync::Arc; use sqlx::{ database::HasArguments, pool::PoolConnection, Arguments, Database, Encode, Error as SqlxError, IntoArguments, Pool, TransactionManager, Type, }; use crate::{ error::Error, future::BoxFuture, protect::{EntryEn...
use crate::error::{IntErr, Interrupt, Never}; use crate::eval::evaluate_to_value; use crate::ident::Ident; use crate::interrupt::test_int; use crate::num::{Base, FormattingStyle, Number}; use crate::scope::{GetIdentError, Scope}; use crate::value::{ApplyMulHandling, BuiltInFunction, Value}; use std::borrow; use std::sy...
/* MIT License Copyright (c) 2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribut...
use std::cell::RefCell; use std::collections::{BTreeSet, HashMap}; use std::rc::Rc; use std::sync::Arc; use parking_lot::Mutex; use contract_ffi::bytesrepr::ToBytes; use contract_ffi::contract_api::argsparser::ArgsParser; use contract_ffi::key::Key; use contract_ffi::uref::AccessRights; use contract_ffi::value::accou...
use crate::{ helper::{account_id_to_eth_address, parse_log, GwLog, PolyjuiceArgs}, types::{ Block as Web3Block, Log as Web3Log, Transaction as Web3Transaction, TransactionWithLogs as Web3TransactionWithLogs, }, }; use anyhow::{anyhow, Result}; use ckb_hash::blake2b_256; use ckb_types::{packe...
//! A pure-Rust library to work with GPT partition tables. //! //! It provides support for manipulating (R/W) GPT headers and partition //! tables. Raw disk devices as well as disk images are supported. //! //! ``` //! extern crate gpt; //! use std::convert::TryFrom; //! //! fn inspect_disk() { //! let diskpath = s...
#![allow(unused_variables)] use std::sync::atomic::{AtomicI32, Ordering}; use std::sync::Arc; use std::thread; use std::time::Duration; use anyhow::{anyhow, Result}; use flutter_rust_bridge::*; use crate::data::{MyEnum, MyStruct}; /// Documentation on a simple adder function. pub fn simple_adder(a: i32, b: i32) ->...
// Copyright Materialize, Inc. and contributors. 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 ...
extern crate libc; extern crate png; use std::ptr; use std::cmp; use std::mem::swap; use std::path::Path; use std::io; use std::fs::{OpenOptions, File}; use std::slice; use std::borrow::Cow; use std::os::unix::io::AsRawFd; use std::ops::Drop; use libc::ioctl; use png::HasParameters; use geom::{Point, Rectangle}; con...
use std::{f32::INFINITY, ops::BitAnd}; use std::f32::consts::{PI}; use std::f32::EPSILON; use num::{Float, Integer}; use crate::Vector3; /// # Math /// /// Helpful mathematical functions, similar to `Mathf` in unity. /// /// The aim is to reimplement every function in `Mathf` in native rust, /// to avoid the overhe...
use crate::{Paint, Point, Scalar, Transform, Units}; use std::{ fmt, ops::{Add, Mul}, str::FromStr, }; pub trait Color { fn blend_over(&self, other: &Self) -> Self; fn with_alpha(&self, alpha: Scalar) -> Self; fn to_rgba(&self) -> [u8; 4]; fn to_rgb(&self) -> [u8; 3] where Se...
// Copyright Materialize, Inc. and contributors. 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 ...
// This file is part of Substrate. // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // 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 // // ht...
#[macro_use] extern crate log; #[macro_use] extern crate relm; #[macro_use] extern crate relm_derive; use cairo::FontSlant; use cairo::FontWeight; use gdk_pixbuf::Pixbuf; use gtk; use gtk::ButtonBoxExt; use gtk::ButtonBoxStyle; use gtk::ButtonExt; use gtk::ButtonsType; use gtk::ContainerExt; use gtk::CssProviderExt; u...
#![allow(dead_code)] use std::io; use std::io::Read; use std::io::Write; use std::mem; use std::net; use std::net::ToSocketAddrs; use std::str; use bytes::Bytes; use httpbis::for_test; use httpbis::for_test::hpack; use httpbis::for_test::solicit::frame::ContinuationFlag; use httpbis::for_test::solicit::frame::Conti...
use crate::NullIonValue; use bigdecimal::{BigDecimal, Zero}; use chrono::{DateTime, Datelike, FixedOffset, Timelike}; use num_bigint::{BigInt, BigUint, Sign}; use std::convert::TryFrom; pub const ION_LEN_ON_HEADER_WHEN_EXTRA_LEN_FIELD_REQUIRED: u8 = 14; const BITS_IN_BYTE: u8 = 8; #[cfg(test)] use crate::IonValue; #...
// Copyright (c) 2016 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 // // Unless r...
//! The `repair_service` module implements the tools necessary to generate a thread which //! regularly finds missing shreds in the ledger and sends repair requests for those shreds use crate::{ cluster_info::ClusterInfo, cluster_slots::ClusterSlots, result::Result, serve_repair::{RepairType, ServeRepai...
use display::{CairoSvg, Color, Display, Fb4Rasp, Point}; use engine::{ action, condition, engine::{AnnotatedSystemInfo, EngineCmdData}, params::{Layout, Parameters}, rule, EngineHandle, }; use fb4rasp_shared::{CpuUsage, MemInfo, NetworkInfo, SystemInfo}; use rand::distributions::Distribution; use sessio...
use crate::bounds::Bounds; use crate::center::Center; use crate::vector_layer::VectorLayer; use serde::{Deserialize, Serialize}; use serde_json::Value; use std::collections::HashMap; /// TileJSON struct represents tilejson-spec metadata as specified by /// <https://github.com/mapbox/tilejson-spec> (version 3.0.0) /// ...
use gfx::{self, *}; use glutin::GlContext; use log::info; use rand::{Rng, SeedableRng}; use simon::*; use std::fmt; use std::thread; use std::time::Duration; type ColourFormat = gfx::format::Srgba8; type DepthFormat = gfx::format::DepthStencil; type Format = (gfx::format::R8_G8_B8_A8, gfx::format::Srgb); type View = ...
// Copyright 2018 The Exonum Team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
use core::mem::size_of; use gba::bios::BgAffineSetParams; use gba::io::background::{ BGSize, BackgroundControlSetting, BG1CNT, BG1HOFS, BG1VOFS, BG2CNT, BG2HOFS, BG2VOFS, BG3CNT, BG3HOFS, BG3VOFS, }; use gba::io::display::{DisplayControlSetting, DisplayMode, DISPCNT}; use gba::vram::SCREEN_BASE_BLOCKS; use vo...
use self::config::*; use core::marker::PhantomData; use drone_cortexm::{reg::prelude::*, thr::prelude::*}; use drone_stm32_map::periph::dma::{ ch::{DmaChMap, DmaChPeriph}, DmaMap, DmaPeriph, }; pub struct DmaStCh0; pub struct DmaStCh1; pub struct DmaStCh2; pub struct DmaStCh3; pub struct DmaStCh4; pub struct D...
use std::f32; use std::f32::consts; use std::sync::Arc; use crate::bounds::Bounds3f; use crate::efloat::{self, EFloat}; use crate::geometry::{distance, distance_squared, offset_ray_origin, spherical_direction_vec}; use crate::interaction::{Interaction, SurfaceInteraction}; use crate::paramset::ParamSet; use crate::ray...
#[cfg(feature = "tc")] use tcmalloc::TCMalloc; #[cfg(feature = "tc")] #[global_allocator] static GLOBAL: TCMalloc = TCMalloc; extern crate clap; extern crate crossbeam; extern crate grcov; extern crate num_cpus; extern crate rustc_hash; extern crate serde_json; extern crate simplelog; extern crate tempfile; use clap...
//! The `App` application runtime, which runs the event loop and draws your //! components. use futures::{self, stream::StreamExt}; use smallvec::SmallVec; use std::{ collections::HashMap, time::{Duration, Instant}, }; use tokio::{ self, runtime::{Builder as RuntimeBuilder, Runtime}, sync::mpsc::{s...
//! Pidfile / Lockfile of the Launcher //! //! When the Supervisor starts, it is given the PID of the Launcher that started //! it. It then writes this PID to `/hab/sup/default/LOCK` (see `path()` below) //! to serve as a record of the currently-running process. This is used to //! discover which process to terminate (...
use deno_core::error::AnyError; use deno_core::serde_json::Value; use deno_core::JsRuntime; use deno_core::RuntimeOptions; use std::cell::Cell; use three_em_js::{snapshot, Error}; use three_em_smartweave::{read_contract_state, InteractionContext}; macro_rules! wasm_alloc { ($scope: expr, $alloc: expr, $this: expr, $...
// vim: fdm=marker:et:ts=4:sts=4:sw=4 // // lib.rs // Copyright (c) 2019 <NAME> <<EMAIL>> MIT license // #![no_std] #![cfg_attr(dox, feature(doc_cfg))] pub mod lemire; pub mod libcore; pub mod range; #[cfg(test)] #[macro_use] extern crate std; #[cfg(test)] mod tests { static UTF8_SAMPLE_OK: &'static str = includ...