text
stringlengths
7.05k
33.9k
// Copyright 2020 The Exonum Team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
use crate::codec::http_decode_read::HttpFrameDecodedOrGoaway; use crate::common::conn::Conn; use crate::common::conn_write::ConnWriteSideCustom; use crate::common::init_where::InitWhere; use crate::common::stream::DroppedData; use crate::common::stream::HttpStreamCommon; use crate::common::stream::HttpStreamData; use c...
/// We need mock runtime with tokens and different native currency. /// It supports asset from Pontem (with Parachain ID == 1). use sp_std::prelude::*; use sp_runtime::{ AccountId32, testing::Header, traits::{AccountIdLookup, BlakeTwo256, Convert}, }; #[cfg(feature = "std")] use serde::{Deserialize, Serial...
// Copyright 2020 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 w...
// Copyright 2018 Parity Technologies (UK) Ltd. // // 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, mer...
use rand::{thread_rng, Rng}; use solana_measure::measure::Measure; use std::{ sync::{ atomic::{AtomicBool, AtomicUsize, Ordering}, Arc, Mutex, Weak, }, time::Instant, }; pub const DEFAULT_MINIMUM_OBJECT_COUNT: u32 = 1000; pub const DEFAULT_SHRINK_PCT: u32 = 80; pub const DEFAULT_MAX_ABOVE_S...
// Copyright (C) 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 // // http://www.apache.org/licenses/LICENSE-2.0 ...
/* * Copyright 2019-2021 <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 ...
//! WARC record header data structures. use std::borrow::Borrow; use std::io::BufRead; use std::str; use indexmap::map::IndexMap; pub use fieldkind::FieldKind; pub use fieldname::FieldName; pub use recordkind::RecordKind; pub use recordtype::RecordType; use crate::compression::Compression; use crate::record::Record...
//! The primary module containing the implementations of the transaction pool //! and its top-level members. use crate::{component::entry::TxEntry, error::Reject}; use ckb_types::{core::Capacity, packed::ProposalShortId}; use std::cmp::Ordering; use std::collections::{BTreeSet, HashMap, HashSet, VecDeque}; /// A stru...
//! Common facilities for ingesting events through store-like endpoints. use std::cell::RefCell; use std::rc::Rc; use actix::prelude::*; use actix_web::http::{header, StatusCode}; use actix_web::middleware::cors::{Cors, CorsBuilder}; use actix_web::{error::PayloadError, HttpRequest, HttpResponse, ResponseError}; use ...
use crate::*; use alvr_common::{data::*, logging::*, sockets::*, *}; use futures::future::BoxFuture; use nalgebra::{Point3, UnitQuaternion, Vector3}; use settings_schema::Switch; use std::{collections::HashMap, net::IpAddr, sync::Arc}; use tokio::{sync::broadcast, time}; const CONTROL_SOCKET_RECEIVE_TIMEOUT: Duration ...
//! Transaction downloader and verifier. //! //! The main struct [`Downloads`] allows downloading and verifying transactions. //! It is used by the mempool to get transactions into it. It is also able to //! just verify transactions that were directly pushed. //! //! The verification itself is done by the [`zebra_conse...
use super::anychannel::AnyAsyncChannelMap; use super::anychannel::AnyAsyncSenderErr; use super::anychannel::AnyUnboundedChannel; use super::peer_stream::PeerStream; use super::peer_stream_connect::PeerStreamConnect; use super::protopack; use super::protopack::TunnelArcPack; use super::protopack::TunnelClose; use super:...
use std::sync::{mpsc, Arc, Mutex}; use std::time::Duration; use std::{thread, time::Instant}; use anyhow::{anyhow, Result}; use cpal::traits::*; use minifb::{Key, Window, WindowOptions}; use rubato::Resampler; use wasmtime::{ Engine, GlobalType, Memory, MemoryType, Module, Mutability, Store, TypedFunc, ValType, };...
//! Handle uncompressed pixel byte blocks. Includes compression and decompression, //! and some functions that completely read an image into blocks. pub mod lines; pub mod samples; use crate::compression::{ByteVec, Compression}; use crate::math::*; use crate::error::{Result, Error, usize_to_i32, UnitResult}; use crat...
#![deny( dead_code, missing_docs, missing_debug_implementations, missing_copy_implementations, trivial_casts, trivial_numeric_casts, unsafe_code, unstable_features, unused_import_braces, unused_qualifications )] //! general hex lib extern crate ansi_term; extern crate clap; use...
use proc_macro2::TokenStream; use syn::{ parse::{Parse, ParseStream}, parse_quote, punctuated::Punctuated, token::{self, Paren}, visit_mut::VisitMut, FnArg, Ident, ItemFn, Token, }; use crate::{ error::ErrorsVec, refident::{MaybeIdent, RefIdent}, utils::{attr_is, attr_starts_with}, ...
/* Cryptography utilities Copyright 2018 by Kzen Networks This file is part of Cryptography utilities library (https://github.com/KZen-networks/cryptography-utils) Cryptography utilities is free software: you can redistribute it and/or modify it under the terms of the GNU General Public L...
use std::{io, mem, ptr, slice}; pub mod gdi; pub use gdi::CapturerGDI; use winapi::{ shared::{ dxgi::*, dxgi1_2::*, dxgitype::*, minwindef::{DWORD, FALSE, TRUE, UINT}, ntdef::LONG, windef::HMONITOR, winerror::*, // dxgiformat::{DXGI_FORMAT, DXGI_FORMA...
#![deny(missing_docs)] //! # Max Tree //! //! A utility maximizer library based on a maximum tree structure. //! //! ### Motivation //! //! Make it easier to compare and compose algorithms for utility programming. //! //! ### Example: Moon Landing //! //! This example is used to improve and push the limits of library....
use super::snake::Snake; use super::components::point::Point; use super::components::world::World as GenericWorld; use super::components::direction::Direction; use super::components::{set_rand_current_time_seed, get_rand_in_range}; use super::AreaSize; use std::collections::{HashSet, HashMap}; use std::iter::FromItera...
#[allow(dead_code)] #[allow(non_camel_case_types)] #[derive(Copy, Clone, Debug, Eq, PartialEq, PrimitiveEnum)] pub enum EffectId { ID_CONTROL = 2, ID_TUNER = 35, ID_IRCAPTURE, ID_INPUT1, ID_INPUT2, ID_INPUT3, ID_INPUT4, /// USB Input ID_INPUT5, ID_OUTPUT1, ID_OUTPUT2, ID_...
/* This is dvipdfmx, an eXtended version of dvipdfm by <NAME>. Copyright (C) 2002-2018 by <NAME> and <NAME>, the dvipdfmx project team. Copyright (C) 1998, 1999 by <NAME> <<EMAIL>> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Li...
// Copyright 2020 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT // http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD // https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied, // modified, or di...
//! # pomodoro //! //! This crate offers you a functional terminal based pomodoro clock. //! //! # Dependencies //! //! This application works on Linux and OSX, but not Windows (yet). On linux make sure that you //! have libdbus-1 installed - this is an essentialy dependency so that pomodoro can integrate //! with t...
//! All sort of events and their parsers. use crate::{ live::{LiveEvent, SystemCommon}, prelude::*, primitive::{read_varlen_slice, write_varlen_slice, SmpteTime}, }; /// Represents a parsed SMF track event. /// /// Consists of a delta time (in MIDI ticks relative to the previous event) and the actual trac...
use crate::{ io::{Filesystem, WitxIo}, parser::{ CommentSyntax, DeclSyntax, Documented, EnumSyntax, FlagsSyntax, HandleSyntax, ImportTypeSyntax, IntSyntax, ModuleDeclSyntax, StructSyntax, TypedefSyntax, UnionSyntax, VariantSyntax, }, BuiltinType, Definition, Entry, EnumDatatype, ...
use num::Complex; use crate::two_radix::butterfly; #[derive(Debug, PartialEq)] pub enum NodeError<'a> { Stage(usize, usize), Index(usize, usize), Twiddle(&'a mut DecimationNode), Len(usize, usize), } impl<'a> NodeError<'a> { pub fn flip_node(node: &mut DecimationNode) { if node.twiddle==t...
use clap::{self, ArgMatches}; use sit_core::{Repository, repository}; use crate::cfg::Configuration; use crate::authorship::derive_authorship; use std::path::{Path, PathBuf}; pub fn command<MI: 'static + Send + Sync, P: AsRef<Path>, P1: AsRef<Path>>(repo: Repository<MI>, matches: &ArgMatches, main_matches: ArgMatches<...
//! Implementation of a state based OR-Set with Delta Mutation as described in //! "Efficient State-based CRDTs by Delta-Mutation" by <NAME>. al //! http://gsd.di.uminho.pt/members/cbm/ps/delta-crdt-draft16may2014.pdf #[macro_use] extern crate serde_derive; #[cfg(test)] extern crate quickcheck; #[cfg(test)] extern cra...
// Marine Predators Algorithm // paper: // <NAME>, <NAME>, <NAME>, <NAME>, // Marine Predators Algorithm: A Nature-inspired Metaheuristic // Expert Systems with Applications // DOI: doi.org/10.1016/j.eswa.2020.113377 // Original Matlab code : https://github.com/afshinfaramarzi/Marine-Predators-Algorithm // Re...
use memory::{EmptyMemory, Memory, pack_u16, high_byte, low_byte, low_nibble, high_nibble}; use extensions::Incrementor; use cpu::{Register, Flags, CarryFlag, HalfCarryFlag, ZeroFlag, SubtractFlag}; use ops::utils::u8_immediate; fn half_carry_for_add(val1: u8, val2: u8, with_carry: bool) -> bool { let mut c = 0; ...
//! # syxpack //! //! `syxpack` is a collection of helpers for processing MIDI System Exclusive messages. use std::fmt; use log::debug; use bit::BitIndex; use lazy_static::lazy_static; /// Manufacturer specific SysEx message initiator. pub const INITIATOR: u8 = 0xf0; /// Manufacturer specific SysEx message terminato...
use vectorspace::{PointT, to_pt, PV}; use la::Matrix; use std::ops::Mul; use tol::Tol; use either::*; use errcodes::GeomErrorCode; use bspline::Bspline; use periodic_spline::PeriodicBspline; use std::iter::once; use vectorspace::NVS; #[derive(PartialEq)] pub enum ParametrizationOption { ChordLength, Centripeta...
//! Holds the `Folds` datastructure for the fold data associated with a buffer use std::collections::{btree_map::Entry, BTreeMap}; use failure::Error; use itertools::Itertools; use neovim_lib::Value; use crate::{card::keyword::Keyword, linenr::LineNr}; /// Folds are saved as the **end-inclusive** interval [start, en...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct DeliveryStream { /// DeliveryStreamType #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "41058")] pub delivery_stream_type: Option<DeliveryStreamType>, /// DeliveryStreamCommodit...
use crate::format::coord_index::CoordIndex; use crate::format::problem::reader::{add_skills, parse_time_window, ApiProblem, ProblemProperties}; use crate::format::problem::{JobTask, RelationType, VehicleBreak, VehicleBreakTime, VehicleCargoPlace, VehicleType}; use crate::format::{JobIndex, Location}; use crate::utils::...
use crate::{ graphtheory::transitive_closure_dag, logfile2::{LogEntry, LogFile}, server::{router, State as ServerState}, sync::{ReadyTracker, StatusUpdater}, }; use anyhow::{anyhow, Result}; use derivative::Derivative; use futures::future::join_all; use hyper::Server; use petgraph::prelude::*; use pyo3:...
#![no_std] #![no_main] // configure panic behavior: //use panic_halt as _; // you can put a breakpoint on `rust_begin_unwind` to catch panics // prints panic message to rtt / jlink use panic_rtt_core::{self, rtt_init_print, rprintln}; use nrf52832_hal as p_hal; use p_hal::nrf52832_pac as pac; use p_hal::{ clocks...
use ::std::collections::BTreeMap; use ::std::io::Write; use ::std::process::Stdio; use ::std::process::{Child, Command}; use ::std::sync::mpsc::Receiver; use ::std::time::Duration; use ::anyhow::Result; use ::chrono::prelude::*; use ::log::{debug, error, info, warn}; #[cfg(not(windows))] use ::nix::{ sys::signal::...
extern crate console_error_panic_hook; use std::{ cell::RefCell, panic, rc::Rc, sync::{Arc, RwLock}, }; use async_std::io::BufReader; use gloo::events::EventListener; use glow::Context; use ldraw::{ document::MultipartDocument, error::ResolutionError, library::{CacheCollectionStrategy, Lib...
// Copyright 2020 Google LLC // // Use of this source code is governed by an MIT-style license that can be found // in the LICENSE file or at https://opensource.org/licenses/MIT. //! A handler and associated types for the file stat action. //! //! A file stat action responses with stat of a given file use std::fs; us...
//! Implements DMA (Direct Memory Access). //! //! The SNES provides 2 DMA mechanisms: General purpose DMA can be set up by the CPU by writing to //! `$420B - MDMAEN`, which stops the CPU and performs the transfer on all enabled channels. HDMA //! can be set up to perform one transfer per H-Blank per channel. There are...
use std::borrow::Borrow; use std::ffi::{CStr, CString}; use std::fmt; use std::iter::Filter; use std::str; use actix_web::connect; use hidapi::{DeviceInfo, HidApi, HidDevice, HidResult}; use log::{debug, error, info}; use palette::{FromColor, Hsv, Hue, Srgb}; use strum_macros::Display; use crate::ps_move_api::PsMoveB...
use num_bigint_dig::{BigUint, ModInverse}; use num_traits::{ identities::{One, Zero}, ToPrimitive, }; use quote::quote; use std::collections::BTreeMap; use std::str::FromStr; struct FieldElementConfig { ident: syn::Ident, limbs: usize, modulus: BigUint, modulus_m2: BigUint, monty_r1: BigUin...
use {base64, utils}; use errors::{BerylliumError, BerylliumResult}; use futures::{Future, Sink, future}; use futures::sync::mpsc::Sender as FutureSender; use hyper::{Body, Method, Request, StatusCode}; use hyper::header::{Authorization, Bearer, ContentLength, ContentType, Headers}; use messages_proto::{Asset, Confirmat...
// Copyright 2021 The Matrix.org Foundation C.I.C. // // 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...
use super::*; use crate::hand::*; use crate::model::*; use crate::util::common::rank_by_rank_vec; use TileStateType::*; #[derive(Debug)] pub struct StageController { stage: Stage, actors: [Box<dyn Actor>; SEAT], listeners: Vec<Box<dyn Listener>>, } impl StageController { pub fn new(actors: [Box<dyn A...
use crate::graphic_helpers::drag_n_drop::IntoDragEvent; use crate::section::mpeg_visualization::mpeg1::MacroblockInfoKind; use crate::Msg as GMsg; use seed::prelude::*; use seed::*; use web_sys::MouseEvent; use super::model::{MacroblockType, Model, Msg}; use super::mpeg1::constants::{PICTURE_TYPE_B, PICTURE_TYPE_INTRA...
use std::{collections::VecDeque, fmt, str::FromStr}; use base_db::{CrateDisplayName, CrateGraph, CrateId, CrateName, Edition, Env, FileId, ProcMacro}; use cfg::{CfgDiff, CfgOptions}; use paths::{AbsPath, AbsPathBuf}; use rustc_hash::FxHashMap; use serde::{Deserialize, Serialize}; use crate::{ build_scripts::Build...
use native; use widestring::WideCString; use regex::Regex; use std::os::raw::{c_int, c_uint}; use std::str; use std::fmt; use std::borrow::Cow; use std::path::{Path, PathBuf}; use std::ffi::CString; use std::iter::repeat; use std::ptr::NonNull; use error::*; #[repr(u32)] #[derive(Debug, Clone, Copy, PartialEq, Eq)] pu...
//! Verify contract source on etherscan use super::build::{CoreBuildArgs, ProjectPathsArgs}; use crate::{cmd::RetryArgs, opts::forge::ContractInfo}; use clap::Parser; use ethers::{ abi::Address, etherscan::{ contract::{CodeFormat, VerifyContract}, utils::lookup_compiler_version, Client,...
// Copyright © 2019 Intel Corporation // // SPDX-License-Identifier: Apache-2.0 // //! The internal VMM API for Cloud Hypervisor. //! //! This API is a synchronous, [mpsc](https://doc.rust-lang.org/std/sync/mpsc/) //! based IPC for sending commands to the VMM thread, from other //! Cloud Hypervisor threads. The IPC fo...
use std::{ collections::VecDeque, fmt, io, net::{IpAddr, Ipv4Addr, SocketAddr}, sync::{ atomic::{AtomicUsize, Ordering}, Arc, }, time::{Duration, Instant}, }; use crate::{ config::{Config, ServerConfig}, context::{Context, SharedContext}, relay::{ socks5:...
#![deny(warnings)] use std::collections::HashMap; use std::env; use std::io::ErrorKind; use std::sync::{ atomic::{AtomicUsize, Ordering}, Arc, }; use std::time::{Duration, Instant}; use futures::{FutureExt, StreamExt}; use serde::{Deserialize, Serialize}; use slog::{error, info, o, Drain, Logger}; use tokio::...
use super::*; /// Take the given input collections and select the inputs in the given order /// /// This is the least interesting algorithm, it is however very simple and /// provide the interesting property to be reproducible. /// #[derive(Debug, Clone)] pub struct HeadFirst<Addressing>(Vec<Input<Addressing>>); impl<...
//! Downloads a Habitat package from a [depot](../depot). //! //! # Examples //! //! ```bash //! $ hab pkg download core/redis //! ``` //! //! Will download `core/redis` package and all its transitive dependencies from a custom depot: //! //! ```bash //! $ hab pkg download -u http://depot.co:9633 -t x86-64_linux --down...
use crate::{convert, fitswriter::FITSKeyword}; use compress::{lz4, zlib}; use getset::{CopyGetters, Getters}; use log::{debug, info}; use quick_xml::{events::Event, Reader}; use std::{ convert::{TryFrom, TryInto}, fmt, fs::File, io::{self, BufRead, BufReader, Read, Seek, SeekFrom}, path::Path, p...
#![allow(dead_code)] /** * 0x40000000 - used to split a double into two parts, both with the low order bits cleared. * Equivalent to 2^30. */ // 1073741824L const HEX_40000000: i64 = 0x40000000; /** Factorial table, for Taylor series expansions. 0!, 1!, 2!, ... 19! */ const...
use { borsh::{BorshDeserialize, BorshSerialize}, cid::Cid, clap::{ crate_description, crate_name, crate_version, value_t, value_t_or_exit, App, AppSettings, Arg, SubCommand, }, solana_clap_utils::{ input_parsers::pubkey_of, input_validators::{is_amount, is_keypair, is...
//! Embedded Flash Memory Controller //! //! Used for reading, writing and erasing the flash and the option bytes. //! Erase and write operations have hardware interrupt support, while read //! operations use pseudo interrupts in the form of deferred calls. The //! programming interface only allows halfword(u16) writes...
use std::fs::File; use std::io::{self, BufRead, BufReader, BufWriter, ErrorKind, Write}; use std::path::PathBuf; use std::process; use faster_hex::{hex_decode, hex_encode}; #[inline(always)] pub fn contains_uppercase(line: &[u8]) -> bool { for c in line { if *c >= 0x41 && *c <= 0x5a { return t...
use crate::scene; use bytemuck::{Pod, Zeroable}; use caldera::prelude::*; use serde::{Deserialize, Serialize}; use std::path::Path; use std::{fs::File, io::BufReader, io::Read, mem}; #[derive(Debug, Clone, Copy, Serialize, Deserialize)] #[serde(untagged)] enum ScalarOrVec3 { Scalar(f32), Vec3([f32; 3]), } #[d...
//! Bgzf format base implementation. //! //! Bgzf is a multi-gzip format that adds an extra field to the header indicating how large the //! complete block (with header and footer) is. use std::io::Write; use std::io::{self, Read}; use byteorder::{LittleEndian, WriteBytesExt}; use bytes::{Buf, BytesMut}; use flate2::...
/* * Copyright 2018-2021 TON DEV SOLUTIONS LTD. * * Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use * this file except in compliance with the License. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS I...
//! This module deals with converting laze .yml files into the format that //! the generate module needs. //! //! This is intentionally separate from the main generate types in order to be a //! bit more flexible on changes to the format. extern crate pathdiff; extern crate serde_yaml; use indexmap::{IndexMap, IndexS...
//! IpfsEmbed is an embeddable ipfs implementation. //! //! ``` //! # #[async_std::main] //! # async fn main() -> Result<(), Box<dyn std::error::Error>> { //! use ipfs_embed::Ipfs; //! let cache_size = 100; //! let _ipfs = Ipfs::default(None, cache_size).await?; //! # Ok(()) } //! ``` use async_std::task; use async_tra...
use super::parser::{Parse, ParseErrorKind, ContextLevel, ParseRes, Parser}; use super::HasSpan; use super::Lookup; use super::Token; use std::fmt; use std::io; use std::ops::Range; // TODO: separate the impls for parser and interpreter in two modules for ecach /// Represents a call in the script like /// `shell` or `...
//! RISCV32 syscall ids //! Reference: https://github.com/riscv/riscv-musl/blob/staging/arch/riscv32/bits/syscall.h.in pub const SYS_IO_SETUP: usize = 0; pub const SYS_IO_DESTROY: usize = 1; pub const SYS_IO_SUBMIT: usize = 2; pub const SYS_IO_CANCEL: usize = 3; pub const SYS_IO_GETEVENTS: usize = 4; pub const SYS_SET...
use anyhow::{format_err, Error}; use avro_rs::{from_value, Codec, Reader, Schema, Writer}; use chrono::{DateTime, Duration, FixedOffset, Local, NaiveDate, NaiveDateTime, TimeZone, Utc}; use fitparser::{profile::field_types::MesgNum, Value}; use futures::future::try_join_all; use glob::glob; use itertools::Itertools; us...
#![recursion_limit = "128"] #[macro_use] extern crate measure_time; use veloci; #[macro_use] extern crate serde_json; #[cfg(feature = "enable_cpuprofiler")] extern crate cpuprofiler; use std::{ fs::File, io::{self, prelude::*}, str, }; #[allow(unused_imports)] use rayon::prelude::*; fn main() { ve...
#![allow(dead_code)] pub const ERR_OK: i32 = 0; pub const ERR_EPERM: i32 = 1; /* Operation not permitted */ pub const ERR_ENOENT: i32 = 2; pub const ERR_ESRCH: i32 = 3; /* No such process */ pub const ERR_EINTR: i32 = 4; /* Interrupted system call */ pub const ERR_EIO: i32 = 5; /* I/O error */ pub const ERR_ENXIO: i32...
use anyhow::{anyhow, bail, ensure, Result}; use gh_trs::raw_url::RawUrl as GitHubUrl; use regex::Regex; use serde_json::Value; use std::collections::HashMap; use url::Url; #[derive(Debug, PartialEq, Clone)] pub struct GistUrl { pub id: String, pub owner: String, pub raw_url: Url, } impl GistUrl { /// ...
/* Cryptmon Copyright 2022 <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, softwar...
use crate::{ alpha::{freshen, freshen_with}, ast::Ast::{self, *}, ast_walk::{walk, Clo, LazyWalkReses, OutEnvHandle, WalkRule}, form::Form, name::*, runtime::reify::Reifiable, util::{assoc::Assoc, mbe::EnvMBE}, }; use std::fmt::{Debug, Display}; /// This trait makes a type producable by pos...
//! AHRS use std::mem::MaybeUninit; use super::quat; use super::quat::Vector3; use super::DT; const FRAC_DT_2: f64 = DT / 2.0; /// ジャイロバイアスの係数(対角成分) const BETA_DIAG: Vector3<f64> = [0.0; 3]; // 一定と仮定したので0 /// 標準重力 pub const STANDARD_GRAVITY: f64 = 9.80665; /// 基準座標系上における加速度計測値 pub const ACC_R: [f64; 3] = [0.0, 0...
// クロージャのまとめ // - C++と大体一緒 // -- キャプチャ付きの匿名関数 // 下記が特徴的(C++比) // - キャプチャ対象にも所有権の仕組みが適応されること // - キャプチャの方式毎にクロージャの型が存在すること // -- Fn // -- FnOnce // -- FnMut pub mod closures { extern crate rand; use rand::Rng; use std::collections::HashMap; fn simulated_expensive_calculation(intensity: u32) -> u32 { ...
//! Parser Module //! //! Tis file contains the language parser implementation. The parser //! is a hand-written recursive descent / operator precedence parser. //! //! The input to the parser is a given `SourceText`. The parser //! converts this into a stream of syntax `Token`s with a `Tokeniser` //! and walks the res...
use super::utils::validate_table_name; use crate::{ stats_cache::{get_stats_cache_addr, StatsCache, StatsCacheMessage, StatsCacheResponse}, Config, Error, }; use actix::Addr; use futures::{ future::{err, join_all, ok, Either, Future}, stream::Stream, }; use lazy_static::lazy_static; use rayon::prelude::...
//use camera::{Camera, CameraController, Projection}; use model::RenderModel; use wgpu::util::DeviceExt; use winit::window::Window; use zen_camera::{Camera, Projection}; use hecs::{World, PreparedQuery}; use zen_model::{Mesh, Model, Vertex}; use crate::uniforms::Uniforms; //pub mod camera; pub mod instance; pub mod m...
use std::collections::{BTreeMap, BTreeSet}; use std::error::Error; use std::fmt; use std::fs::File; use std::io::{BufRead, BufReader, LineWriter, Lines, Write}; use std::path::Path; use std::process::Command; use lazy_regex::regex; use serde::{Deserialize, Deserializer}; pub fn clear() { handle(true, |loc, _lines...
//! <div align="center"> //! 📦 🤏 //! </div> //! //! <h1 align="center"> //! tiny dynamo //! </h1> //! //! <p align="center"> //! A tinier, simpler, key-value focused interface for AWS DynamoDB //! </p> //! //! <div align="center"> //! <a href="https://github.com/softprops/tiny-dynamo/actions"> //! <img s...
//! Utilities to read a cartridge into memory //! //! # Literature //! //! - the [super famicom wiki page](https://wiki.superfamicom.org/memory-mapping) //! - <http://patrickjohnston.org/ASM/ROM data/snestek.htm> use std::convert::TryInto; use crate::device::{Addr24, Data}; use crate::sa1::Sa1; use save_state::{SaveS...
use std::env; use std::fs; use std::io::Write; use std::path::PathBuf; fn link(name: &str, bundled: bool) { use std::env::var; let target = var("TARGET").unwrap(); let target: Vec<_> = target.split('-').collect(); if target.get(2) == Some(&"windows") { println!("cargo:rustc-link-lib=dylib={}", ...
use crate::utils::*; use crate::DrawResult; use bacon_sci::interp::lagrange; use bacon_sci::polynomial::Polynomial; use chrono::prelude::*; use chrono::{DateTime, Duration, Utc}; use plotters; use plotters::coord::types::RangedCoordf32; use plotters::prelude::*; use plotters_canvas::CanvasBackend; use simple_error::bai...
use crate::{ geom::{Circle, Line, Rectangle, Scalar, Shape, Transform, Triangle, Vector}, graphics::{Color, GpuTriangle, Image, Mesh} }; use std::iter; /// Some object that can be drawn to the screen pub trait Drawable { /// Draw the object to the Mesh fn draw<'a>(&self, mesh: &mut Mesh, background: Ba...
// Copyright 2021 Arm Limited (or its affiliates). All rights reserved. // // SPDX-License-Identifier: Apache-2.0 //! ARM PrimeCell General Purpose Input/Output(PL061) //! //! This module implements an ARM PrimeCell General Purpose Input/Output(PL061) to support gracefully poweroff microvm from external. //! use crat...
/*! # Pipe Logger Lib Stores, rotates, compresses process logs. ## Example ```rust extern crate pipe_logger_lib; use pipe_logger_lib::*; use std::fs; use std::path::Path; let test_folder = { let folder = Path::join(&Path::join(Path::new("tests"), Path::new("out")), "log-example"); fs::remove_dir_all(&folder);...
use crate::utils::{ fn_has_unsatisfiable_preds, has_drop, is_copy, match_def_path, match_type, paths, snippet_opt, span_lint_hir, span_lint_hir_and_then, walk_ptrs_ty_depth, }; use if_chain::if_chain; use rustc_data_structures::{fx::FxHashMap, transitive_relation::TransitiveRelation}; use rustc_errors::Applicab...
//! Maintains a Rust installation by installing individual Rust //! platform components from a distribution server. use crate::config::Config; use crate::manifest::{Component, Manifest, TargetedPackage}; use crate::dist::{TargetTriple, DEFAULT_DIST_SERVER}; use crate::component::{Components, Package, TarGzPackage, Tar...
#![allow(missing_docs)] //! Watcher implementation for Windows' directory management APIs //! //! For more information see the [ReadDirectoryChangesW reference][ref]. //! //! [ref]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa363950(v=vs.85).aspx use winapi::shared::minwindef::TRUE; use winapi::shared::...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 //! Implementation of the RPC protocol as per Libra wire protocol v1. //! //! Design: //! ------- //! //! RPC receives OutboundRpcRequest messages from upstream actors. The OutboundRpcRequest contains //! the RPC protocol, raw request ...
use crate::jormungandr::{ configuration, Block0ConfigurationBuilder, JormungandrParams, JormungandrProcess, NodeConfigBuilder, SecretModelFactory, }; use assert_fs::fixture::{ChildPath, PathChild}; use chain_addr::Discrimination; use chain_core::{packer::Codec, property::Serialize}; use chain_crypto::Ed25519; u...
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0. use std::collections::hash_map::Entry; use std::fmt; use std::sync::atomic::{AtomicUsize, Ordering}; use collections::HashMap; use futures::future::{self, TryFutureExt}; use futures::sink::SinkExt; use futures::stream::TryStreamExt; use grpcio::{Duple...
use rustc_index::vec::IndexVec; use rustc_middle::ty::SymbolName; use rustc_target::abi::call::FnAbi; use rustc_target::abi::{Integer, Primitive}; use rustc_target::spec::{HasTargetSpec, Target}; use crate::constant::ConstantCx; use crate::prelude::*; pub(crate) fn pointer_ty(tcx: TyCtxt<'_>) -> types::Type { mat...
// Copyright © 2019 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
use crate::datamodel::*; use crate::prelude::*; use crate::tracker; use chrono::{DateTime, Duration, Local, Timelike, Weekday}; use dialoguer::theme; use std::cmp::Ordering; use std::convert::TryInto; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::string::ToString; use tracker::{command, event_store::T...
/* Copyright (c) 2016-2017, <NAME> <<EMAIL>> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the ...
// Copyright 2018 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...