text
stringlengths
7.05k
33.9k
use std::fs::{self, File}; use std::sync::{Arc, Mutex}; use std::path::{Path, PathBuf}; use std::io::{self, Read, Write, Seek, SeekFrom, BufReader}; use std::fmt::{self, Formatter, Debug}; use std::iter::FromIterator; use rand::{prelude::*, distributions::Alphanumeric}; use serde_json; use lru::LruCache; use futures::...
// This code is mainly copied and adapted from the LdkSample (https://github.com/lightningdevkit/ldk-sample) use crate::hex_utils; use crate::DlcManager; use crate::DlcMessageHandler; use crate::PeerManager; use bitcoin::network::constants::Network; use bitcoin::secp256k1::key::PublicKey; use dlc_manager::contract::con...
//! Action to convert an LDraw file to another format. use crate::{ as_u8_slice, error::{Error, Utf8Error}, gltf, Action, App, DiskResolver, GeometryBuffer, GeometryCache, }; use ansi_term::Style; use std::{collections::HashMap, fs::File, io::Write, path::PathBuf}; use structopt::StructOpt; use weldr::Com...
use crate::DgcContainer; use ciborium::{ ser::into_writer, value::{Integer, Value}, }; use std::iter::FromIterator; use std::{ convert::{TryFrom, TryInto}, ops::Not, }; use thiserror::Error; const COSE_SIGN1_CBOR_TAG: u64 = 18; const CBOR_WEB_TOKEN_TAG: u64 = 61; const COSE_HEADER_KEY_KID: i128 = 4; co...
//! Signature API //! //! See [`Sig`] for the main functionality and [`Algorithm`] //! for the list of supported algorithms. use alloc::vec::Vec; use core::ptr::NonNull; #[cfg(not(feature = "std"))] use cstr_core::CStr; #[cfg(feature = "std")] use std::ffi::CStr; use crate::ffi::sig as ffi; use crate::newtype_buffer...
// 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 ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Control Register"] pub qspi_cr: QSPI_CR, #[doc = "0x04 - Mode Register"] pub qspi_mr: QSPI_MR, #[doc = "0x08 - Receive Data Register"] pub qspi_rdr: QSPI_RDR, #[doc = "0x0c - Transmit Data Register"] pub qsp...
/// A span represents a single operation within a trace. Spans can be /// nested to form a trace tree. Often, a trace contains a root span /// that describes the end-to-end latency, and one or more subspans for /// its sub-operations. A trace can also contain multiple root spans, /// or none at all. Spans do not need t...
//! This module implements ELF program execution with respects the System V ABI. use core::cmp::min; use core::ffi::c_void; use core::mem::size_of; use core::ptr; use core::slice; use core::str; use crate::elf::ELF32ProgramHeader; use crate::elf::parser::ELFParser; use crate::elf::relocation::Relocation; use crate::el...
//! This library provides high-level access to STM32 peripherals. //! //! **Current family support**: F3, F4, L4, L5, G0, G4, H7, and WB. U5 is planned once its SVD files and PAC //! become available. WL support is a WIP, with many features not implemented. //! //! Please see the [Readme](https://github.com/David-OConn...
/*! This library describes revocation pairs, a formalization of hash locks. A pair ([`RevocationLock`], [`RevocationSecret`]) satisfies two properties: *Correctness*: A correctly generated revocation pair will always verify. *Security*: Given a revocation lock, an adversary can generate a revocation secret that veri...
//! Absru Type trait //! Define a specialized type which will be used to generate associated functions and definition in //! Asbru. //! This trait should be applied to Field use async_graphql_parser::types::{BaseType, FieldDefinition, Type}; use codegen::{Field, Function, Impl, Scope, Struct}; use thiserror::Error; us...
/* * Copyright 2019 The Starlark in Rust Authors. * Copyright (c) Facebook, Inc. and its affiliates. * * 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/lic...
// (c) 2016-2017 Productize SPRL <<EMAIL>> use Sexp; use footprint; use footprint::data::*; use wrap; use symbolic_expressions::iteratom::*; use symbolic_expressions::SexpError; // TODO: get rid of Part #[derive(Debug)] enum Part { Thickness(f64), Net(footprint::Net), SolderPasteMargin(f64), SolderMas...
//! A bunch of wrappers and helper structs that make dealing with abstract //! polytopes much less confusing. use std::{ collections::HashMap, iter::IntoIterator, ops::{Index, IndexMut}, }; use super::{ rank::{Rank, RankVec}, Abstract, }; use crate::polytope::Polytope; /// A bundled rank and inde...
use std::any::TypeId; use std::collections::HashMap; use std::hash::{BuildHasherDefault, Hash}; use std::sync::{Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard}; use std::sync::atomic::{AtomicUsize, Ordering}; use fnv::FnvHasher; use hibitset::{AtomicBitSet, BitSet, BitSetLike, BitSetOr}; use mopa::Any; use ticketed_...
use std::fmt; use std::ops::{Deref, Index}; use crate::parse::{Cursor, Parse, Parser}; use crate::span::{BytePos, ByteSpan}; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ProjectRange { full: ByteSpan, name: ByteSpan, } impl ProjectRange { pub const fn new(full: ByteSpan) -> Self { let name = full.off...
/// Integer Subroutines for Accumulator Functions. use runtime_io::blake2_256; use rstd::prelude::Vec; use super::U2048; use crate::BezoutPair; /// Implements fast modular exponentiation. Algorithm inspired by https://github.com/pwoolcoc/mod_exp-rs/blob/master/src/lib.rs /// NOTE: Possible overflow error occurs when ...
//! Dutch Auction //! //! Ask to sell on auction. //! Initial price can start from price above market. //! Diminishes with time. //! Takers can take for price same or higher. //! Higher takers take first. //! Sell(ask) orders stored on chain. Sell takes deposit from seller, returned during take or //! liquidation. Take...
#![allow(clippy::large_enum_variant)] use anyhow::Context as _; use rbw::cipher::*; use std::convert::{TryFrom, TryInto, Infallible}; use std::path::{Path, PathBuf}; use std::ffi::OsString; use std::io::{self, Write as _}; use std::str::FromStr; use uuid::Uuid; use url::Url; #[derive(Debug, structopt::StructOpt)] #[s...
//! First argument is path to `vl53l1_register_map.h`, second is output `reg.rs` path. //! //! ## Steps //! //! 1. Split string by "#define VL53L1_". use std::fmt::Write; use std::path::PathBuf; /// Information parsed from the header file. #[derive(Debug)] struct EntryInfo { name: String, index: u16, ty: ...
mod std_win_64; mod std_linux_64; use std::*; use collections::{HashMap, HashSet}; use cmp::min; use crate::intermediate_code_generator; use intermediate_code_generator::*; use crate::config::*; use crate::parser::ast::IncDecType; use crate::tokenizer; use tokenizer::char_to_u64; use tokenizer::token::{IncOrDec, Bina...
use std::any::Any; use std::cell::{Cell, RefCell}; use std::collections::HashMap; use std::marker::{PhantomData, Unsize}; use std::mem; use std::ops::{Deref, DerefMut}; use std::rc::Rc; use std::sync::Arc; use crate::atn::ATN; use crate::atn_simulator::IATNSimulator; use crate::common_token_factory::TokenFactory; use ...
use crate::mesh::primitive::capsule::CapsuleUvProfile::Aspect; use crate::mesh::{Mesh, Model, Vertex}; #[derive(Debug, Copy, Clone, PartialEq)] pub enum CapsuleUvProfile { Aspect = 0, Uniform = 1, Fixed = 2, } #[derive(Debug, Clone, Copy, PartialEq)] #[repr(align(16))] pub struct Capsule { pub radius:...
#![feature(geobacter)] // TODO: make the Geobacter attributes "known" to rustc. #![feature(register_attr)] #![register_attr(geobacter_attr)] extern crate grt_amd as geobacter_runtime_amd; use grt_amd::prelude::*; use grt_amd::texture::{access::*, geometry::*}; use num_traits::AsPrimitive; use rand::distributions:...
use crate::core::Condition; use std::fmt; use std::mem::transmute; use std::str::FromStr; #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[repr(u8)] pub enum Op { Add = 0, Sub = 1, // Times = 2, // Division = 3 ArithmeticShiftLeft = 4, ArithmeticShiftRight = 5, LogicalShiftLeft = 6, Logic...
use std::sync::atomic::AtomicU32; use crate::bbox::{BBox, Xywh}; use crate::tracker::Object; use crate::Detection; use nalgebra as na; use crate::circular_queue::CircularQueue; use munkres::{solve_assignment, WeightMatrix, Weights}; static SEQ_ID: AtomicU32 = AtomicU32::new(1); const SECONDS_IN_FRAME: f32 = 0.04; ...
// node.js bindings #![allow(dead_code)] use crate::app::{App}; use crate::interop::{InteropApi}; use std::os::raw::{c_int, c_uint, c_char, c_void}; use std::ptr; use std::mem; dylib! { #[load_napi] extern "C" { fn napi_module_register(module: *mut NapiModule) -> NapiStatus; fn napi_get_undef...
///////////////////////////////////////////////////////////////////////////////L // The MIT License (MIT) // Copyright (c) 2021 [untitled os] Team // See LICENSE.txt and CREDITS.txt for details ///////////////////////////////////////////////////////////////////////////////L #![allow(dead_code)] use num_traits::float:...
//! WebAssembly trap handling, which is built on top of the lower-level //! signalhandling mechanisms. use crate::instance::{InstanceHandle, SignalHandler}; use crate::trap_registry::TrapDescription; use crate::vmcontext::VMContext; use backtrace::Backtrace; use std::any::Any; use std::cell::Cell; use std::error::Erro...
//! MMU importer, which produces an [`Environment`] object from an `.mmu` file. use std::rc::Rc; use std::collections::{HashMap, hash_map::Entry}; use crate::elab::{ElabError, Result, local_context::MAX_BOUND_VARS, environment::{Term, Thm, TermKind, ThmKind, AtomID, SortID, Environment, Modifiers, Type, Expr, P...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 #![forbid(unsafe_code)] use codespan::ByteIndex; use codespan_reporting::diagnostic::{Diagnostic, Label, LabelStyle}; use itertools::Itertools; #[allow(unused_imports)] use log::warn; use std::collections::{BTreeMap, BTreeSet}; use bu...
use std::{net::SocketAddr, sync::RwLock}; use bytes::{Buf, Bytes}; use jsonwebtoken::Validation; use snafu::Snafu; use std::sync::Arc; use tokio::{ stream::{Stream, StreamExt}, sync::broadcast, }; use warp::{ self, filters, fs, http::{Response, StatusCode}, path, reject, Rejection, Reply, }; use wa...
//! A Ribosome is a structure which knows how to execute hApp code. //! //! We have only one instance of this: [RealRibosome]. The abstract trait exists //! so that we can write mocks against the `RibosomeT` interface, as well as //! opening the possiblity that we might support applications written in other //! languag...
use std::collections::{HashMap, VecDeque}; use std::time::Duration; use dbus::message::SignalArgs; use dbus::strings::Path; use winit::{ dpi::PhysicalPosition, event, event::ElementState, event::MouseButton, event::WindowEvent, event_loop::EventLoopWindowTarget, window::WindowId, }; use crate::{ //notific...
use crate::config_parse::*; use crate::controller::*; use crate::filter::{ABfilter, low_pass_filter}; use crate::filter::Filter; use crate::reciver::*; use crate::imu::imu; use crate::logger::*; use crate::utils::abs; use crate::utils::sin; use core::time; use std::thread; use std::time::SystemTime; use crate::reciver;...
use Cursive; use Printer; use With; use align::*; use direction::Direction; use event::*; use std::any::Any; use std::cell::Cell; use std::cmp::max; use theme::ColorStyle; use unicode_width::UnicodeWidthStr; use vec::Vec2; use view::{Margins, Selector, View}; use views::{Button, DummyView, SizedView, TextView, ViewBox}...
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { anyhow::{format_err, Context as _, Error}, fidl_fuchsia_test as ftest, fsyslog::{fx_log_err, fx_log_info}, ftest::{Invocation, RunLis...
//! The RTMP watch step registers with the RTMP server endpoint to allow for RTMP clients to connect //! and watch media streams based on the specified port, application name, and stream key //! combinations. When the workflow step is passed in media notifications it passes them to //! the RTMP endpoint for distributi...
// Copyright 2013-2014 The CGMath Developers. For a full listing of the authors, // refer to the Cargo.toml file at the top-level directory of this distribution. // // 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 ...
use std::collections::HashMap; use near_contract_standards::fungible_token::core_impl::ext_fungible_token; use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; use near_sdk::json_types::{Base64VecU8, U128, U64}; use near_sdk::{log, AccountId, Balance, Gas, PromiseOrValue}; use crate::policy::UserInfo; use c...
use super::GroupBy; use crate::prelude::*; use rayon::prelude::*; use std::borrow::Cow; use std::cmp::Ordering; use crate::frame::groupby::{GroupsIndicator, GroupsProxy}; use crate::utils::accumulate_dataframes_vertical; use crate::POOL; #[cfg(feature = "dtype-date")] use arrow::temporal_conversions::date32_to_date; #...
// Copyright 2018 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use failure::Error; use fuchsia_bluetooth::error::Error as BTError; use fuchsia_syslog::macros::*; use futures::channel::mpsc; use parking_lot::{Mutex, RwL...
// Copyright 2017 <NAME> // // This file is part of the PulseAudio Rust language linking library. // // Licensed under the MIT license or the Apache license (version 2.0), at your option. You may not // copy, modify, or distribute this file except in compliance with said license. You can find copies // of these license...
use digest::Digest; use num_bigint::BigUint; use rand::{thread_rng, Rng}; // This is mostly taken from https://github.com/RustCrypto/RSA/pull/18 // For the love of crypto, please delete as much of this as possible and use the RSA crate // directly when that PR is merged pub fn encrypt<D: Digest>(key: &[u8], message: ...
// Copyright (c) 2020 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...
//! Internal: Declare the Reader type for tor-bytes use crate::{Error, Readable, Result}; use arrayref::array_ref; /// A type for reading messages from a slice of bytes. /// /// Unlike io::Read, this object has a simpler error type, and is designed /// for in-memory parsing only. /// /// The methods in [`Reader`] sho...
//! Module responsible for recovering RTIC application metadata to //! associate ITM packets with RTIC tasks. use crate::build::{self, CargoWrapper}; use crate::diag; use crate::manifest::ManifestProperties; use std::fs; use std::io::Write; use std::iter::FromIterator; use cargo_metadata::Artifact; use chrono::Local;...
use alloc::vec::Vec; use core::{cmp, result}; use serde::Serialize; use serde_cbor::{de, ser::Write, Serializer}; use crate::{error::Error, Result}; /// Implements the `Write` trait from `serde_cbor` using a `Vec<u8>`. /// /// It allocates when necessary, so can be used for indefinite-length data, /// unlike `SliceWr...
use core::task::{Context, Poll}; use std::collections::HashMap; use std::io::Cursor; use std::io::Error as IoError; use std::io::ErrorKind; use std::marker::PhantomData; use std::pin::Pin; use std::sync::Arc; use std::time::Duration; use async_channel::bounded; use async_channel::Receiver; use async_channel::Sender; u...
use cpp_core::{CppBox, NullPtr, Ptr, StaticUpcast}; use libcommon::{error::ReasonsExt, vfs::VirtualFileSystem}; use crate::{qtr, tr}; use fluent_ergonomics::FluentErgo; use libearthquake::{ detection::{detect, FileType, movie::Kind as MovieKind}, name, version, }; use libmactoolbox::script_manager::ScriptC...
// Copyright 2016 <NAME> // // 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 writing, ...
// Copyright 2020 <NAME>. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 //! Struct to maintain context information for the image builder. use std::collections::HashMap; use std::convert::TryFrom; use std::fs::{remove_file, rename, File, OpenOptions}; use std::io::{BufWriter, Seek, SeekFrom, Write}; u...
//! This module contains various support types used by the DFS parser. Most //! of it is to help validate that bytes from disc images really do contain //! valid values for what they intend. use std::fmt; use std::ops::Deref; use ascii; use ascii::{AsciiChar, AsciiStr}; use arrayvec::ArrayVec; #[derive(Debug, Clone,...
#![doc = include_str!("../README.md")] mod array; mod list; mod map; mod path; mod reflect; mod struct_trait; mod tuple; mod tuple_struct; mod type_registry; mod type_uuid; mod impls { #[cfg(feature = "glam")] mod glam; #[cfg(feature = "smallvec")] mod smallvec; mod std; #[cfg(feature = "glam"...
use super::{try_convert_cid, MaybeResolved, MultipleMatchingLinks, ResolveError}; use crate::pb::{FlatUnixFs, PBLink, ParsingFailed, UnixFsType}; use crate::{InvalidCidInLink, UnexpectedNodeType}; use cid::Cid; use std::borrow::Cow; use std::collections::VecDeque; use std::convert::TryFrom; use std::fmt; /// A cache o...
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. //! This module contains an implementation of `ImeState`, the internal state object of `LegacyIme`. use super::position; use crate::fidl_helpers::clone_st...
#![cfg_attr(not(feature = "std"), no_std)] use frame_support::codec::{Decode, Encode}; use frame_support::{ debug, decl_error, decl_event, decl_module, decl_storage, dispatch, ensure, traits::{ Currency, ExistenceRequirement, LockIdentifier, LockableCurrency,WithdrawReasons, }, }; use frame_system::ensure_signed...
use pkgspec::SpecStruct; use std::fs; use std::io; use std::path::Path; #[derive(Clone, Debug, Default, PartialEq, SpecStruct)] pub struct RpmSpec { /// The base name of the package, which should match the SPEC filename. name: String, /// The upstream version number of the software. version: String, ...
use bit_reverse::BitwiseReverse; use bit_set::BitSet; use intbits::Bits; use std::collections::HashSet; fn get_tile_boundaries(data: i128, tile_width: usize) -> (u16, u16, u16, u16) { let north = get_row(data, 0, tile_width); let east = get_col(data, tile_width - 1, tile_width); let south = get_row(data, t...
use crate::core::{Handle, UndefinedStruct}; use crate::SMBiosStruct; use serde::{ser::SerializeSeq, ser::SerializeStruct, Serialize, Serializer}; use core::{fmt, any}; use core::ops::Deref; #[cfg(feature = "no_std")] use alloc::{string::String, vec::Vec}; /// # Baseboard (or Module) Information (Type 2) /// /// Compli...
//! For an introduction to the crate and how to get started, //! see the [crate's README](https://github.com/PLSysSec/haybale-pitchfork/blob/main/README.md). // this ensures that crate users generating docs with --no-deps will still // properly get links to the public docs for Pitchfork's types // it was especially ne...
//! Reading and writing of Bifrost simulation data in NetCDF format. mod mesh; mod param; use super::{ super::{ utils::{self, AtomicOutputPath}, Endianness, Verbose, }, fdt, ParameterValue, SnapshotFormat, SnapshotParameters, SnapshotReader3, COORDINATE_NAMES, FALLBACK_SNAP_NUM, PRIMAR...
use crate::type_info::Type; use log::warn; use pdb::{FallibleIterator, TypeIndex}; #[cfg(feature = "serde")] use serde::Serialize; use std::cell::RefCell; use std::collections::HashMap; use std::convert::{From, TryFrom}; use std::path::PathBuf; use std::rc::Rc; pub type TypeRef = Rc<RefCell<Type>>; pub type TypeIndexN...
#![allow(non_snake_case)] extern crate js_sys; extern crate mat4; extern crate wasm_bindgen; extern crate web_sys; use js_sys::WebAssembly; use wasm_bindgen::prelude::*; use wasm_bindgen::JsCast; use web_sys::{ EventTarget, MouseEvent, WebGlProgram, WebGlRenderingContext, HtmlCanvasElement, }; use std::cell::RefCe...
//! Provides a mechanism which queues work for later processing. //! //! When the `beacon_processor::Worker` imports a block that is acceptably early (i.e., within the //! gossip propagation tolerance) it will send it to this queue where it will be placed in a //! `DelayQueue` until the slot arrives. Once the block has...
// Copyright 2020 - developers of the `grammers` project. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // https://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distr...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - UART Data"] pub dr: DR, _reserved_1_ecr: [u8; 4usize], _reserved2: [u8; 16usize], #[doc = "0x18 - UART Flag"] pub fr: FR, _reserved3: [u8; 4usize], #[doc = "0x20 - UART IrDA Low-Power Register"] pub ilpr...
use crate::KeyCode; use mio::{unix::SourceFd, Events, Interest, Poll, Token, Waker}; use promising_future::{future_promise, Promise}; use std::{ collections::hash_map::{Entry, HashMap}, mem, os::raw::{c_int, c_uint}, ptr, sync::mpsc::{channel, Sender}, thread::{self, JoinHandle}, }; use x11_dl::...
//! # Dual IIR //! //! The Dual IIR application exposes two configurable channels. Stabilizer samples input at a fixed //! rate, digitally filters the data, and then generates filtered output signals on the respective //! channel outputs. //! //! ## Features //! * Two indpenendent channels //! * up to 800 kHz rate, tim...
use core::ffi::c_void; use std::boxed::Box; use std::fmt::Debug; use std::sync::{Arc, Mutex}; use crate::{ error::{InstantiateError, RunError}, event::LV2AtomSequence, features::{worker, BOUNDED_BLOCK_LENGTH}, port::{DataType, IOType}, Port, PortConnections, PortCounts, PortIndex, PortType, Resourc...
use super::keyframe_core::*; use super::element_wrapper::*; use super::stream_animation_core::*; use super::pending_storage_change::*; use crate::storage::storage_api::*; use crate::traits::*; use crate::serializer::*; use futures::prelude::*; use ::desync::*; use std::sync::*; use std::time::{Duration}; use std::col...
use super::strutil::*; use lazy_static::lazy_static; use regex::Regex; use std::collections::HashMap; use std::num::ParseIntError; use std::str::FromStr; use std::string::ToString; // Use the same attribute definition as in the public API of the main crate: #[path = "../../src/emojis/attributes.rs"] mod attributes; us...
use crate::child::{CmdChild, CmdChildHandle, CmdChildren, FunChildren}; use crate::io::{CmdIn, CmdOut}; use crate::{CmdResult, FunResult}; use faccess::{AccessMode, PathExt}; use lazy_static::lazy_static; use log::{debug, warn}; use os_pipe::{self, PipeReader, PipeWriter}; use std::collections::HashMap; use std::ffi::{...
//! Module for rendering text in the extended ASCII-range, by using signed-distance fields. use super::super::super::resources; use super::cgmath::SquareMatrix; use super::utility; use std::io::{BufRead, BufReader}; use std::path::PathBuf; use rustc_hash::FxHashMap; const FONT_MATERIAL: &str = "shaders/sdf-text"; pu...
use crate::util::{opponent, BoardDirectionIter}; use crate::{ reversi_board::board_directions, Board, BoardPosition, Directions, ReversiPiece, ReversiPlayerAction, BOARD_SIZE, }; use lib_boardgame::{GameState, PlayerColor}; use std::fmt; #[derive(Clone)] pub struct ReversiState { /// The underlying 2d arra...
// 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 writing, software // distributed unde...
//! `tsproto-structs` contains machine readable data for several TeamSpeak //! related topics. //! //! The underlying data files can be found in the [tsdeclarations](https://github.com/ReSpeak/tsdeclarations) //! repository. //! //! The contained data may change with any version so the suggested way of //! referring to...
//! Module containing the `BitBoard` and associated functions / constants. //! //! A [`BitBoard`] is a set of bits, where the index of each bit represents a square on the //! Board. We use this to mark whether or not something is residing at a certain square. For //! example, if we are using it to map the positions of ...
// "Tifflin" Kernel - ext2/3/4 Filesystem Driver // - By <NAME> (thePowersGang) // // Modules/fs_extN/ondisk.rs //! On-disk structures #![allow(dead_code)] pub const S_MAGIC_OFS: usize = 3*4*4 + 2*4; macro_rules! pod_impls { ($t:ty) => { impl Copy for $t { } impl Clone for $t { fn clone(&self) -> Self { *se...
#[macro_use] extern crate log; use std::{ panic::AssertUnwindSafe, convert::TryFrom, io::BufReader, sync::Arc, path::PathBuf, time::Duration, }; use futures_core::future::BoxFuture; use tokio::{ prelude::*, io::{self, BufStream}, net::{TcpStream, ToSocketAddrs}, time::timeout, }...
use crate::light_garden::*; use std::slice::Iter; pub struct Tracer { objects: Vec<Object>, lights: Vec<Light>, has_drawing_object: bool, has_drawing_light: bool, pub max_bounce: u32, pub chunk_size: usize, pub cutoff_color: Color, pub grid: Grid, pub canvas_bounds: Rect, pub tr...
//! Universal asynchronous receiver/transmitter with EasyDMA (UARTE) //! //! The driver provides only tranmission functionlity //! //! Author //! ------------------- //! //! * Author: <NAME> <<EMAIL>> //! * Date: March 10 2018 use core::cell::Cell; use kernel; use kernel::common::regs::{ReadOnly, ReadWrite, WriteOnly}...
use ergo_chain_types::Header; use ergotree_ir::sigma_protocol::dlog_group::order; use num_bigint::BigInt; use num_traits::ToPrimitive; use std::convert::TryInto; use crate::{ autolykos_pow_scheme::{AutolykosPowScheme, AutolykosPowSchemeError}, nipopow_proof::PoPowHeader, NipopowProof, NipopowProofError, };...
use std::collections::{BTreeMap, VecDeque}; use anyhow::Result; use log::debug; use smallvec::{smallvec, SmallVec}; use crate::{ analysis::dis, aspace::AddressSpace, module::{Module, Permissions}, VA, }; /// The type and destination of a control flow. #[derive(Debug, Clone, Copy)] pub enum Flow { ...
use crate::utils::nan_safe_compare; use crate::DiscrustError; use std::{cmp::Ordering, collections::HashMap}; /// A Feature struct /// This struct houses all of the aggregate information /// for feature, and it's binary performance field. /// It has functionality to utilize weights, and then /// to compute information...
use codec::{Decode, Encode}; use sp_runtime::traits::{AppendZerosInput, Saturating, StaticLookup, Zero}; use sp_runtime::RuntimeDebug; use sp_std::prelude::*; use sp_std::{fmt::Debug, iter::once, ops::Add}; pub type KYCIndex = u32; pub type ExchangeKey = [u8; 32]; pub type Message = [u8; 128]; pub type Data = Vec<u8>;...
use clap::ArgMatches; use client::{ClientConfig, ClientGenesis, Eth2Config}; use eth2_config::{read_from_file, write_to_file}; use genesis::recent_genesis_time; use lighthouse_bootstrap::Bootstrapper; use rand::{distributions::Alphanumeric, Rng}; use slog::{crit, info, warn, Logger}; use std::fs; use std::net::Ipv4Addr...
use clap::{App, Arg}; use core_cube::win10::*; use ctrlc; use enigo::*; use env_logger; use lazy_static::lazy_static; use log::{debug, error, info}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex}; use std::{thread, time}; #[derive(Debug, Copy, Clone, PartialEq)] enum ButtonStatus { Unkn...
mod ast; mod namespace; use crate::error::Result; use crate::target::{ DiscriminatorVariantInfo, EnumMember, EnumMemberNamingStrategy, Expr, Field, FilePartitioningStrategy, Item, Strategy, Target, }; use ast::{Ast, SchemaAst}; use jtd::Schema; use namespace::Namespace; use std::collections::BTreeMap; use std:...
use std::fmt; use std::mem; use std::ops::Deref; use bytes::{BufMut, ByteOrder, Bytes, BytesMut}; use nom::{be_i32, be_i64, be_i8, IResult}; use time; use crc::crc32; use compression::Compression; use errors::{ErrorKind, Result}; use protocol::{parse_opt_bytes, ApiVersion, Offset, ParseTag, Record, Timestamp, Writ...
// Copyright 2014-2016 Rusti Project // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except accord...
//! Java ant plugin pub mod policy; use self::policy::AntStudentFilePolicy; use crate::{error::JavaError, plugin::JavaPlugin, CompileResult, TestRun, SEPARATOR}; use j4rs::Jvm; use std::env; use std::ffi::OsStr; use std::path::{Path, PathBuf}; use std::time::Duration; use tmc_langs_framework::{ anyhow, comman...
use super::data::*; use jeebie::utils::is_set; const SCREEN_WIDTH: i32 = 160; const SCREEN_HEIGHT: i32 = 144; /// Holds all information relative to the graphics subsystem. /// Includes computed data like the framebuffer, in a format that can be drawn to screen. pub struct GPU { line: u8, lyc: u8, // LYC (li...
pub extern crate clips_sys; #[macro_use] extern crate bitflags; #[macro_use] extern crate derive_more; use std::borrow::Cow; use std::error::Error; use std::ffi::{CStr, CString}; use std::marker; use std::path::Path; pub enum SaveScope { Local = clips_sys::SaveScope_LOCAL_SAVE as isize, Visible = clips_sys::SaveS...
mod lowering; use std::fs; use anyhow::{Context, Result}; use heck::SnakeCase; use lowering::LoweredGrammar; use quote::{format_ident, quote}; use xshell::cmd; use crate::codegen::lowering::Variant; use super::project_root; use lowering::ChildKind; pub fn do_codegen() -> Result<()> { let grammar = project_root...
use std::collections::{HashMap, HashSet}; use std::fmt; use serde::{Deserialize, Serialize}; use swc_atoms::JsWord; use swc_common::{SourceMap, SyntaxContext, DUMMY_SP}; use swc_ecmascript::ast; use swc_ecmascript::visit::{Fold, FoldWith}; use utils::*; #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] ...
/* * Copyright 2018 The Starlark in Rust Authors. * Copyright (c) Facebook, Inc. and its affiliates. * * 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/lic...
// Copyright 2021 Parallel Finance Developer. // This file is part of Parallel Finance. // 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) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use diem_config::{ config::{NodeConfig, RocksdbConfig}, utils::get_genesis_txn, }; use diem_crypto::{ ed25519::{Ed25519PrivateKey, Ed25519PublicKey}, hash::HashValue, PrivateKey, SigningKey, Uniform, }; use diem_logg...