text
stringlengths
9.08k
47.9k
//! The 'child' module owns the child process for an exec request, and provides handles for the //! caller to communicate with the process. //! //! The process is spawned into the namespaces of an existing container (task) using containerd; //! the desired container and command are given by the caller. We can also opt...
use crate::hal::adc::{Channel, OneShot}; use crate::hal::blocking::delay::DelayUs; use core::marker::PhantomData; use crate::stm32::{ADC1, ADC2, ADC3, ADC3_COMMON}; use crate::delay::Delay; use crate::gpio::gpioa::{PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7}; use crate::gpio::gpiob::{PB0, PB1}; use crate::gpio::gpioc::{...
// 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 { failure::{bail, err_msg}, fidl_fuchsia_bluetooth as bt, fidl_fuchsia_bluetooth_control as control, fidl_fuchsia_bluetooth_sys as sys, fuc...
// Copyright 2020. The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following // disclai...
//! Contains the TCP client to connect to an ADS server. use std::cell::{Cell, RefCell}; use std::collections::BTreeSet; use std::convert::{TryFrom, TryInto}; use std::io::{self, Read, Write}; use std::net::{IpAddr, Shutdown, TcpStream, ToSocketAddrs}; use std::str::FromStr; use std::time::Duration; use byteorder::{B...
//! //! # `#[real_async_trait]` //! [![travis]](https://travis-ci.org/4lDO2/real-async-trait-rs) //! [![cratesio]](https://crates.io/crates/real-async-trait) //! [![docsrs]](https://docs.rs/real-async-trait/) //! //! [travis]: https://travis-ci.org/4lDO2/real-async-trait-rs.svg?branch=master //! [cratesio]: https://img...
use crate::b2_distance::*; use crate::b2_math::*; use crate::b2_settings::*; use crate::b2_shape::*; use crate::shapes::to_derived_shape::*; use std::sync::atomic::Ordering; // GJK using Voronoi regions (<NAME>) and Barycentric coordinates. pub fn set_shape( this: &mut B2distanceProxy, shape: ShapePtr, index: u...
use std::collections::btree_map::BTreeMap; use std::collections::HashSet; use std::convert::From; use std::error; use std::fmt; use std::io::Write; use std::io; use lalrpop_util::{ErrorRecovery, ParseError}; use ast::{SpannedExpr, MuxOption, WireWidth}; use lexer::{Tok, Loc, Span}; use io::FileContents; #[derive(Deb...
//! The initial handler is responsible for //! handling new connections and getting //! through the login sequence. After login //! is completed, control is handed over to the server //! thread, which is responsible for sending chunks/inventory/ //! players and then spawning the player. //! //! The initial handler is a...
extern crate cosh; extern crate ctrlc; extern crate dirs_next; extern crate getopts; extern crate memchr; extern crate regex; extern crate rustyline; extern crate rustyline_derive; extern crate searchpath; extern crate tempfile; use std::borrow::Cow::{self, Borrowed}; use std::cell::RefCell; use std::collections::Hash...
extern crate criterion; extern crate rustfft; use criterion::{black_box, criterion_group, criterion_main, Criterion}; use std::sync::Arc; use rustfft::FFT; use rustfft::num_complex::Complex; use rustfft::algorithm::*; use rustfft::algorithm::butterflies::*; /// Times just the FFT execution (not allocation and pre-cal...
// Copyright 2019, 2020 Wingchain // // 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...
// 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. //! Simple Rust utilities for file I/O that are usable on the host (via overnet //! FIDL usage) as well as on a Fuchsia target. //! //! For now all utiliti...
mod queue; #[cfg(test)] mod tests; use crate::StateError; use ic_interfaces::messages::CanisterInputMessage; use ic_protobuf::{ proxy::{try_from_option_field, ProxyDecodeError}, state::queues::{v1 as pb_queues, v1::canister_queues::NextInputQueue}, types::v1 as pb_types, }; use ic_types::{ messages::{I...
use borsh::{BorshDeserialize, BorshSerialize}; use serde::{Serialize, Deserialize}; use near_sdk::collections::{TreeMap, UnorderedSet}; use near_sdk::json_types::{U128, U64}; use near_sdk::{AccountId, env, near_bindgen, PromiseResult}; use serde_json::json; use std::str; use std::collections::HashMap; #[global_allocat...
// Copyright 2018 <NAME> <<EMAIL>> // Licensed under the MIT License. //! The daemon itself. use base64; use daemonize; use failure::{Error, ResultExt}; use futures::sink::Send; use futures::stream::{SplitSink, SplitStream, StreamFuture}; use futures::sync::{mpsc, oneshot}; use futures::{Async, AsyncSink, Future, Pol...
/* Space invaders in Rust * * Alien designs * * Game concept by <NAME> / Taito * Rust code By <NAME> <<EMAIL>> * * Written for fun. See LICENSE. * */ extern crate glfw; extern crate kiss3d; extern crate nalgebra as na; extern crate rand; use std::time::Instant; use rand::Rng; use na::{ Vector3, Translation3,...
/*----------------------------------------------------------------------------- This file is part of Core65X2 Copyright (c) 2017 <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 witho...
#![allow(clippy::module_name_repetitions)] #![allow(dead_code)] use std::{ collections::{BinaryHeap, HashMap}, convert::TryFrom, fmt::{Debug, Display}, ops::{BitAnd, BitOr}, }; use serde::{Deserialize, Deserializer, Serialize}; use crate::{ core::msp::{MonotoneSpanProgram, Node}, error::{Forma...
//! LLVM bit manipulation intrinsics. #[rustfmt::skip] use crate::*; #[allow(improper_ctypes, dead_code)] extern "C" { #[link_name = "llvm.ctlz.v2i8"] fn ctlz_u8x2(x: u8x2, is_zero_undef: bool) -> u8x2; #[link_name = "llvm.ctlz.v4i8"] fn ctlz_u8x4(x: u8x4, is_zero_undef: bool) -> u8x4; #[link_name...
mod proto; use candid::Decode; use ic_base_types::{CanisterId, PrincipalId, SubnetId}; use ic_ic00_types::{ CanisterIdRecord, InstallCodeArgs, Method as Ic00Method, Payload, ProvisionalTopUpCanisterArgs, SetControllerArgs, UpdateSettingsArgs, }; use serde::{Deserialize, Serialize}; use std::{collections::BTree...
/* * 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...
//! A group of attributes that can be attached to Rust code in order //! to generate a clippy lint detecting said code automatically. use clippy_utils::{get_attr, higher}; use rustc_ast::ast::{LitFloatType, LitKind}; use rustc_ast::LitIntType; use rustc_data_structures::fx::FxHashMap; use rustc_hir as hir; use rustc_h...
//! # On-board Cryptographic Service Engine (CSEc) //! //! This module is an interface implementation for the board's hardware-accelerated cryptographic //! functions. It was derived from [Freescale's `security_pal/` //! example](https://gitlab.com/rust-daredevil-group/daredevil-small/tree/master/refs). //! A range of ...
// Copyright © 2021 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT //! A UEFI based bootloader for an x86-64 kernel. //! //! This code roughly does the following: looks for a kernel binary //! in the EFI partition, loads it, then continues to construct an //! address space for it, and ...
use std::sync::atomic::Ordering::Relaxed; use bellperson::Circuit; use log::info; use paired::bls12_381::Bls12; use rand::{rngs::OsRng, SeedableRng}; use rand_xorshift::XorShiftRng; use serde::{Deserialize, Serialize}; use fil_proofs_tooling::{measure, Metadata}; use filecoin_proofs::constants::{SectorInfo, DEFAULT_P...
use settings; use messages::*; use messages::message_type::MessageTypes; use messages::MessageStatusCode; use messages::payload::Payloads; use utils::httpclient; use error::prelude::*; use settings::ProtocolTypes; #[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] #[serde(rename_all = "camelCase")] pub struct ...
use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer}; use vulkano::command_buffer::{AutoCommandBuffer, AutoCommandBufferBuilder, DynamicState}; use vulkano::device::{Device, DeviceExtensions, Queue}; use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass}; use vulkano::image::{Attac...
// This file is dual licensed under the terms of the Apache License, Version // 2.0, and the BSD License. See the LICENSE file in the root of this repository // for complete details. use crate::asn1::{ big_byte_slice_to_py_int, oid_to_py_oid, py_uint_to_big_endian_bytes, PyAsn1Error, PyAsn1Result, }; use crate::x5...
//! Simple Payment Verification (SPV) Manager. //! //! Manages BIP 157/8 compact block filter sync. //! use std::ops::Range; use nonempty::NonEmpty; use thiserror::Error; use bitcoin::network::constants::ServiceFlags; use bitcoin::network::message_filter::{CFHeaders, CFilter, GetCFHeaders}; use nakamoto_common::blo...
use crate::gfa::gfa::GFAtk; use crate::utils::{format_usize_to_kb, GFAGraphLookups}; use anyhow::{bail, Context, Result}; use gfa::gfa::Orientation; use gfa::gfa::GFA; use gfa::optfields::OptFields; use itertools::Itertools; use petgraph::{ graph::{Graph, IndexType, NodeIndex}, visit::{EdgeRef, IntoNodeIdentifi...
use connection_maintainer::*; use msg_framing::*; use utils; use futures::sync::mpsc; use bitcoin::network; use bitcoin::blockdata::block::BlockHeader; use bitcoin::util::hash::Sha256dHash; use bytes; use bytes::BufMut; use futures::{Stream, Sink}; use tokio; use crypto::digest::Digest; use crypto::sha2::Sha256; ...
// Copyright (c) 2020 Huawei Technologies Co.,Ltd. All rights reserved. // // StratoVirt is licensed under Mulan PSL v2. // You can use this software according to the terms and conditions of the Mulan // PSL v2. // You may obtain a copy of Mulan PSL v2 at: // http://license.coscl.org.cn/MulanPSL2 // THIS SOFTWA...
use en::get_ordinal; use unicode_segmentation::UnicodeSegmentation; use super::{ abbreviate_publisher, alph_designator, format_range, offset_format_range, sorted_bibliography, BibliographyOrdering, BibliographyStyle, Database, DisplayReference, DisplayString, Formatting, Record, }; use crate::lang::{en, Ti...
use slp_lang_hir::*; use pel; /// Creates intrinsic nodes from argument expressions #[derive(PartialEq, Debug, Clone)] pub enum IntrinsicFactory { Intrinsic0(Intrinsic0), Intrinsic1(Intrinsic1), Intrinsic2(Intrinsic2), Intrinsic3(Intrinsic3), } impl IntrinsicFactory { pub fn create_intrinsic(&sel...
#![feature(slice_fill)] #![allow(non_snake_case)] pub mod games; mod utils; use games::Game; use js_sys::Error; use rand::{thread_rng, Rng}; use wasm_bindgen::prelude::*; extern crate web_sys; // A macro to provide `println!(..)`-style syntax for `console.log` logging. macro_rules! log { ( $( $t:tt )* ) => { ...
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. use crate::ast; use crate::ast::Location; use crate::colors; use crate::create_main_worker; use crate::file_fetcher::File; use crate::file_watcher; use crate::file_watcher::ResolutionResult; use crate::flags::Flags; use crate::fs_util::collect_...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
use std::cell::{RefCell, RefMut, Cell}; use std::collections::HashSet; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::hash_map::HashMap; use std::env; use std::fmt; use std::fs::{self, File}; use std::io::SeekFrom; use std::io::prelude::*; use std::mem; use std::path::{Path, PathBuf}; ...
//! The 'exec' module lets you run a command in another container through the apiserver. A //! WebSocket is used for communication with the server. Process input and output is sent back and //! forth directly through a binary channel, and control messages are sent through a multiplexed //! text channel. // Implement...
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // // 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 THIRD-PARTY file. use std::{ fmt::{...
use crate::{convert::ToPyObject, PyObject, PyResult, VirtualMachine}; pub(crate) use sys::{UnraisableHookArgs, MAXSIZE, MULTIARCH}; #[pymodule] mod sys { use crate::common::{ ascii, hash::{PyHash, PyUHash}, }; use crate::{ builtins::{PyDictRef, PyNamespace, PyStr, PyStrRef, PyTuple...
//! Functions for managing FreeSurfer brain surface meshes in binary 'surf' files. //! //! Surf files store a triangular mesh, where each vertex is defined by its x,y,z coords and //! each face is defined by 3 vertices, stored as 3 row-indices into the vertices matrix. //! These vertex indices are zero-based. use by...
pub mod camera; pub mod geometry; pub mod lights; mod debug; mod queues; mod shaders; use crate::{ components::GlobalTransform, renderer::{ camera::{ActiveCamera, Camera}, debug::Debug, geometry::{MeshBuilder, MeshComponent, Vertex}, lights::{DirectionalLightRes, PointLightComp...
//! Lowering rules for X64. #![allow(dead_code)] #![allow(non_snake_case)] use crate::ir::condcodes::IntCC; //zz use crate::ir::types::*; use crate::ir::Inst as IRInst; use crate::ir::{Block, InstructionData, Opcode, Type}; use crate::ir::types; use crate::ir::types::*; use crate::machinst::lower::*; use crate::mac...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct News { /// MsgType = B #[serde(flatten)] pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'B', ' '>, /// ApplicationSequenceControl #[serde(flatten)] pub a...
use crate::{ gui::{ BuildContext, CustomWidget, EditorUiMessage, EditorUiNode, SceneItemMessage, Ui, UiMessage, UiNode, }, load_image, scene::{ ChangeSelectionCommand, EditorScene, GraphSelection, LinkNodesCommand, SceneCommand, Selection, SetVisibleCommand, }, se...
/* This is dvipdfmx, an eXtended version of dvipdfm by <NAME>. Copyright (C) 2007-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...
use rand::{Rng, StdRng}; use super::map::tile::TileType; use super::features::{make_spider_nest, make_camp, FeatureType}; #[derive(Clone)] pub struct Region { pub id: String, pub tiles : Vec<(i32, i32)>, pub edge_tiles : Vec<(i32, i32)>, pub connected_regions : Vec<String>, pub size: usize, pub is_main_region: b...
//! Driver agnostic networking utilities pub mod arp; pub mod dhcp; pub mod intel_nic; pub mod netmapping; use core::sync::atomic::{AtomicU32, Ordering}; use core::fmt::{self, Formatter, Debug}; use core::convert::TryInto; use core::ops::{Deref, DerefMut}; use alloc::vec::Vec; use alloc::sync::Arc; use alloc::boxed:...
//! The virtual machine. use std::pin::Pin; use std::ptr; use std::rc::Rc; use crate::bytecode::{ CaptureKind, Chunk, Control, DispatchTable, Environment, FunctionKind, FunctionSignature, Opcode, Opr24, }; use crate::common::{Error, ErrorKind, Location, StackTraceEntry}; use crate::gc::{GcRaw, Memory}; use crat...
// Import from `core` instead of from `std` since we are in no-std mode use core::result::Result; // Import heap related library from `alloc` // https://doc.rust-lang.org/alloc/index.html use alloc::{collections::BTreeMap, vec, vec::Vec}; // Import CKB syscalls and structures // https://nervosnetwork.github.io/ckb-st...
use std::any::TypeId; use std::collections::HashMap; use std::path::{Path, PathBuf}; use std::sync::Arc; use parking_lot::{ReentrantMutex, ReentrantMutexGuard}; use super::load_file::LoadFileFunc; use super::*; use kg_diag::{BasicDiag, Severity}; const LOAD_FILE_FUNC_NAME: &str = "loadFile"; pub type ModelError =...
#![forbid(unsafe_code)] mod fps; mod render; use std::cell::RefCell; use std::collections::HashSet; use std::rc::Rc; use wasm_bindgen::prelude::*; use wasm_bindgen::JsCast; #[wasm_bindgen] pub fn run() { std::panic::set_hook(Box::new(console_error_panic_hook::hook)); web_sys::window() .unwrap_throw(...
use crate::chat::ChatComponent; use crate::config::CONFIG; use crate::network::packets::clientbound::{ CDisconnectLogin, CHeldItemChange, CJoinGame, CJoinGameBiomeEffects, CJoinGameBiomeEffectsMoodSound, CJoinGameBiomeElement, CJoinGameDimensionCodec, CJoinGameDimensionElement, CLoginSuccess, CPlayerInfo, C...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{ errors::{JsonRpcError, ServerCode}, tests::utils::{test_bootstrap, MockLibraDB}, }; use futures::{channel::mpsc::channel, StreamExt}; use libra_config::utils; use libra_crypto::{ed25519::Ed25519PrivateKey, hash::Cr...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 11/05/2018 Last Modified: 29/03/2019 License: MIT */ use crate::raster::*; use crate::structures::Array2D; use crate::tools::*; use rand::prelude::*; use rand_distr::StandardNormal; use rand::rngs::SmallRng; use std::cm...
#![allow(clippy::new_ret_no_self)] #![allow(clippy::manual_async_fn)] #![allow(clippy::too_many_arguments)] //! Promote a tx2 transport adapter to a tx2 transport frontend. const INTERNAL_ERR: u32 = 500; use crate::tx2::tx2_adapter::*; use crate::tx2::tx2_pool::*; use crate::tx2::tx2_utils::*; use crate::tx2::*; use ...
// Copyright (c) 2016-2021 <NAME> //! The central data structure of the compiler. //! //! The main piece of infrastructure provided by this module is the [`Context`] //! trait. It exposes all queries supported by the compiler, together with many //! other basic operations. Most compiler tasks interact only with [`Cont...
use std::borrow::Cow; use std::collections::hash_map::Iter; use std::collections::{BTreeMap, HashMap, HashSet}; use std::convert::{TryFrom, TryInto}; use std::mem; use std::rc::Rc; use std::str::FromStr; use chrono::{DateTime, Local}; use globset::GlobBuilder; use once_cell::unsync::OnceCell; use serde::{Deserialize, ...
// 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 according to those terms. // Tracking of rece...
use rustling_ontology_values::check::*; use rustling_ontology_moment::*; use rustling_ontology_values::dimension::*; use rustling_ontology_values::ResolverContext; pub fn examples_percentage(v: &mut Vec<::rustling::train::Example<Dimension>>) { example!(v, check_percentage(0.3), "zero point three per cent"); e...
use super::*; use crate::graphics_engine::shaped_segment::ShapedSegment; use crate::graphics_engine::font::Font; #[derive(Debug)] pub(in crate::layout) struct InlineFormattingContext { pub(super) parent_style: Arc<ComputedValues>, pub(super) inline_level_boxes: Vec<Arc<InlineLevelBox>>, } #[derive(Debug)] pub...
use std::fmt::Display; use crate::ast::parse_ast::*; use ahash::{AHashMap, AHashSet}; use global_counter::global_counter; /* This file collapses external automata calls. Basically, it makes new shared variables for the output, and replaces the automaton call by shared var assignation. Then it renames every shared var ...
//! Accumulator which operates on batches of data use crate::{ keypair::{PrivateKey, PublicKey}, parameters::CeremonyParams, }; use snark_utils::{BatchDeserializer, BatchSerializer, Deserializer, Serializer, *}; use zexe_algebra::{AffineCurve, PairingEngine, ProjectiveCurve, Zero}; use itertools::{Itertools, ...
//! Background worker that watches over the cache. //! //! It cleans up old cache, updates statistics and optimizes the cache. //! We allow losing some messages (it doesn't hurt) and some races, //! but we guarantee eventual consistency and fault tolerancy. //! Background tasks can be CPU intensive, but the worker thre...
use alloc::borrow::ToOwned; use alloc::{format, vec}; use alloc::vec::Vec; use core::ops::{self, Range}; use std::io::{self, Read}; use crate::{read_u16_from_be, read_u8}; use crate::error::{Error, Result, UnsupportedFeature}; use crate::huffman::{HuffmanTable, HuffmanTableClass}; use crate::marker::Marker; use crate::...
// Copyright (c) 2019 Cloudflare, Inc. All rights reserved. // SPDX-License-Identifier: BSD-3-Clause mod tests; use crate::noise::errors::WireGuardError; use crate::noise::make_array; use base64::decode; #[cfg(not(target_arch = "arm"))] use ring::rand::*; use std::ops::Add; use std::ops::Mul; use std::ops::Sub; use s...
use crate::image::PhotoHandler; use crate::video::VideoHandler; use crate::strings::Strings; use filetime::{self, FileTime}; use log::{info, debug}; use std::io; use std::fs::{self, DirEntry}; use std::path::Path; use std::process::Command; type GenError = Box<dyn std::error::Error>; pub type GenResult<T> = Result<T,...
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. use crate::config_file; use crate::text_encoding::strip_bom; use deno_ast::get_syntax; use deno_ast::swc::ast::Module; use deno_ast::swc::ast::Program; use deno_ast::swc::codegen::text_writer::JsWriter; use deno_ast::swc::codegen::Node; use de...
/* * Copyright (C) 2013 <NAME> <<EMAIL>> * Copyright (c) 2016 * <NAME> <<EMAIL>> * <NAME> <<EMAIL>> * Copyright (c) 2017-2021 <NAME> <<EMAIL>> * * Permission is hereby granted, free of charge, to any * person obtaining a copy of this software and associated * documentation files (the "Software"...
use super::attribute::{Variant, Accent}; use crate::DisplayStyle; #[derive(Debug, Clone, PartialEq)] pub enum Token { Illegal(char), EOF, Begin, End, Ampersand, NewLine, Left, Right, Middle, Paren(&'static str), LBrace, RBrace, Frac, Underscore, Circumflex, ...
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. use super::definitions::TestDefinition; use super::definitions::TestDefinitions; use super::lsp_custom; use crate::checksum; use crate::create_main_worker; use crate::emit; use crate::flags; use crate::located_script_name; use crate::lsp::clie...
#![allow(clippy::needless_range_loop, clippy::identity_op)] use super::{Digit, Grid, SquareIndex, DIM1, DIM2, DIM3, DIM4}; use lazy_static::lazy_static; use packed_simd::u32x4; use std::hint::unreachable_unchecked; use std::ops::{BitAnd, BitOr, BitXor, Not, Shr}; type GridMask = u32x4; const SQUARE_ALL: u32 = (1u32 <...
// TODO - remove once schemars stops causing warning. #![allow(clippy::field_reassign_with_default)] use std::{ array::TryFromSliceError, collections::{BTreeSet, HashMap}, error::Error as StdError, fmt::{self, Debug, Display, Formatter}, iter::FromIterator, }; use datasize::DataSize; use hex::From...
use crate::health::{StageLevel, Health}; use crate::health::disease::{ActiveStage, LerpDataNodeC, DiseaseDeltasC, ActiveDisease, Disease, LerpDataC, StageDescription}; use crate::utils::GameTimeC; use crate::state::ActiveDiseaseStateContract; use std::time::Duration; use std::collections::BTreeMap; use std::rc::Rc; us...
//! # Lasso //! //! [Linear regression](../linear_regression/index.html) is the standard algorithm for predicting a quantitative response \\(y\\) on the basis of a linear combination of explanatory variables \\(X\\) //! that assumes that there is approximately a linear relationship between \\(X\\) and \\(y\\). //! Lass...
// Sunsoft FME-7, 5A, and 5B (notably lacking expansion audio for now) // Reference implementation: https://wiki.nesdev.com/w/index.php/Sunsoft_FME-7 use ines::INesCartridge; use memoryblock::MemoryBlock; use mmc::mapper::*; use mmc::mirroring; use apu::AudioChannelState; use apu::PlaybackRate; use apu::Volume; use ...
use fenris_quadrature::polyquad::{hexahedron, prism, pyramid, quadrilateral, tetrahedron, triangle}; use fenris_quadrature::{Error, Rule}; use matrixcompare::assert_scalar_eq; use nalgebra::{SVector, Vector3}; use std::convert::TryFrom; macro_rules! assert_quadrature_size { ($quadrature_fn:ident, strength = $stre...
use std::{u32, vec}; use crate::rtmp_server::{eventbus_map, meta_data_map, video_header_map}; use crate::util::spawn_and_log_error; use smol::channel::Receiver; use crate::protocol::rtmp::RtmpMessage; use crate::protocol::h264::Nalu; use smol::io::AsyncWriteExt; /// fps = timescale / duration #[derive(Clone)] pub stru...
//! Tag mnemonics for FIX 4.2. #![allow(dead_code)] pub const ACCOUNT: u32 = 1; pub const ADV_ID: u32 = 2; pub const ADV_REF_ID: u32 = 3; pub const ADV_SIDE: u32 = 4; pub const ADV_TRANS_TYPE: u32 = 5; pub const AVG_PX: u32 = 6; pub const BEGIN_SEQ_NO: u32 = 7; pub const BEGIN_STRING: u32 = 8; pub const BODY_LENGTH: ...
#![allow(dead_code)] extern crate bytes; use std::cmp::min; use std::fmt::{self, Debug}; use std::fs; use std::io::{Cursor, Read, Seek, SeekFrom, Write}; use std::ops::Index; use std::path::{Path, PathBuf}; use std::sync::{Arc, RwLock}; use std::thread; use std::time::{SystemTime, UNIX_EPOCH}; use super::controller:...
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). #![deny(warnings)] // Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to...
use super::ISPI; use crate::rust::helper::{sinc, sinh_taylor, EXPA2N2}; use crate::Complex64; pub fn w(Complex64 { re, im }: Complex64) -> Complex64 { if re == 0.0 { return Complex64 { re: super::real::erfcx(im), im: re, }; } else if im == 0.0 { return Complex64 ...
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use super::compiler_worker::CompilerWorker; use crate::colors; use crate::compilers::CompilationResultFuture; use crate::compilers::CompiledModule; use crate::diagnostics::Diagnostic; use crate::disk_cache::DiskCache; use crate::file_fetcher::So...
use std::convert::TryFrom; use std::fmt; use anyhow::{anyhow, bail, Error}; use proc_macro2::{Span, TokenStream}; use quote::{quote, ToTokens}; use syn::{parse_str, Ident, Lit, LitByteStr, Meta, MetaList, MetaNameValue, NestedMeta, Path}; use crate::field::{bool_attr, set_option, tag_attr, Label}; /// A scalar proto...
use heck::CamelCase; use indexmap::{IndexMap as Map, IndexSet as Set}; use log::debug; use openapiv3::{ AdditionalProperties, AnySchema, Components, ObjectType, OpenAPI, Operation, Parameter, ParameterSchemaOrContent, ReferenceOr, Schema, SchemaData, SchemaKind, StatusCode as ApiStatusCode, Type as ApiType,...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Start UART receiver"] pub tasks_startrx: TASKS_STARTRX, #[doc = "0x04 - Stop UART receiver"] pub tasks_stoprx: TASKS_STOPRX, #[doc = "0x08 - Start UART transmitter"] pub tasks_starttx: TASKS_STARTTX, #[doc = "0x...
//! Provides the Foreign Type Interface for OpenCL. #![allow(non_camel_case_types, dead_code)] #![allow(missing_docs, missing_debug_implementations, missing_copy_implementations)] use libc; use std::fmt; /* Opaque types */ pub type platform_id = *mut libc::c_void; pub type device_id ...
// Copyright (c) 2020 Huawei Technologies Co.,Ltd. All rights reserved. // // StratoVirt is licensed under Mulan PSL v2. // You can use this software according to the terms and conditions of the Mulan // PSL v2. // You may obtain a copy of Mulan PSL v2 at: // http://license.coscl.org.cn/MulanPSL2 // THIS SOFTWA...
#![deny(clippy::nursery)] #![deny(clippy::pedantic)] #![allow(clippy::cargo)] // Clippy can't read our cargo.toml properly #![deny(clippy::all)] // This issue can't be fixed, due to a limitation of actix-web's API. Actix-web's API doesn't currently allow creating acceptors that use &HttpRequest instead of HttpRequest. ...
// Copyright 2018 The Druid Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
#[macro_use] extern crate clap; use std::convert::TryFrom; use std::fs::File; use std::io::{self, prelude::*, SeekFrom}; use std::num::NonZeroI64; use clap::{App, AppSettings, Arg}; use atty::Stream; use anyhow::{anyhow, Context, Error as AnyhowError}; use const_format::formatcp; use thiserror::Error as ThisError...
// Copyright 2020 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under The General Public License (GPL), version 3. // Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed // under the GPL Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTI...
/* Copyright 2021 Integritee AG and Supercomputing Systems AG 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...
use crate::utils::utils::LucetMetadata; use std::collections::HashMap; use yaxpeax_arch::{AddressBase, Arch, LengthedInstruction}; use yaxpeax_core::analyses::control_flow::VW_CFG; use yaxpeax_core::arch::x86_64::analyses::data_flow::Location; use yaxpeax_core::arch::InstructionSpan; use yaxpeax_core::data::{Direction,...
// fig.rs A 2D rasterizer. // // Copyright (c) 2017-2021 <NAME> // use crate::fixed::Fixed; use crate::imgbuf::{matte_src_over_even_odd, matte_src_over_non_zero}; use crate::path::FillRule; use crate::vid::Vid; use pix::chan::{Ch8, Linear, Premultiplied}; use pix::el::Pixel; use pix::matte::Matte8; use pix::ops::Sr...
use cookie_factory::GenError; use futures::{Async, Future, Poll}; use i2p_snow::{Builder, Session}; use nom::Err; use rand::{rngs::OsRng, Rng}; use siphasher::sip::SipHasher; use std::net::SocketAddr; use std::ops::AddAssign; use std::time::{Duration, SystemTime, UNIX_EPOCH}; use tokio::{ codec::{Decoder, Framed}, ...
//! A contract is PUT within a location distance, this entails that all nodes within //! a given radius will cache a copy of the contract and it's current value, //! as well as will broadcast updates to the contract value to all subscribers. use std::collections::HashSet; use std::future::Future; use std::pin::Pin; us...
use std::collections::{BTreeSet, HashMap, HashSet}; use std::fmt; use anyhow::Result; use serde::{Deserialize, Serialize}; use abstutil::wraparound_get; use geom::{Polygon, Pt2D, Ring}; use crate::{CommonEndpoint, Direction, LaneID, Map, RoadID, RoadSideID, SideOfRoad}; /// A block is defined by a perimeter that tr...