text
stringlengths
9.08k
47.9k
use std::{ borrow::Borrow, collections::HashSet, path::{Path, PathBuf}, }; use anyhow::Result; use lsp_document::TextMap; use lsp_types::{ CodeLens, CodeLensParams, Command, CompletionItem, CompletionParams, DidChangeTextDocumentParams, DocumentLink, DocumentLinkParams, Documentation, GotoDef...
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 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 a...
use crate::amf3::custom_encoder::ExternalDecoderFn; use crate::amf3::type_marker::TypeMarker; use crate::amf3::length::Length; use crate::nom_utils::AMFResult; use crate::types::*; use crate::types::{Element, Value}; use crate::PADDING; use enumset::EnumSet; use nom::bytes::complete::tag; use nom::combinator::map; use...
use blake2_rfc::blake2b::{Blake2b, Blake2bResult}; use std::vec::Vec; const HASH_LENGTH: usize = 32; type HashValue = Blake2bResult; /// A merkle tree pub struct MerkleTree { tree: Vec<HashValue>, } impl MerkleTree { /// Calculate and return the length of vector required to build a tree for the input vector ...
//! Library supporting converting CIFF to PISA uncompressed collection format. //! Refer to [`osirrc/ciff`](https://github.com/osirrc/ciff) on Github //! for more detailed information about the format. //! //! For more information about PISA's internal storage formats, see the //! [documentation](https://pisa.readthedo...
use crate::ast::{ BinaryOp, CallTarget, Datatype, Expr, ExprX, Fun, Function, FunctionKind, Ident, InvAtomicity, Krate, Mode, Path, Pattern, PatternX, Stmt, StmtX, UnaryOpr, VirErr, }; use crate::ast_util::{err_str, err_string, get_field}; use crate::util::vec_map_result; use air::ast::Span; use air::errors::{e...
//! WMATA-defined codes for each MetroRail station. use crate::{ error::Error, rail::{client::responses, line::Line, traits::NeedsStation}, requests::Fetch, }; use serde::{ de::{Deserializer, Error as SerdeError}, Deserialize, }; use std::{error, fmt, str::FromStr}; /// Every MetroRail station code...
use bevy::prelude::*; use rand::{seq::SliceRandom, Rng}; pub struct Ship { pub hit_points: i32, } #[derive(Clone, Copy, PartialEq, Debug)] pub enum RotationDirection { Clockwise, CounterClockwise, } impl RotationDirection { pub fn to_factor(&self) -> f32 { match self { RotationDir...
use crate::frame::*; use bytes::{Buf, BufMut, BytesMut}; use std::collections::HashMap; use tokio_util::codec::{Decoder, Encoder}; const FRAME_METHOD_FRAME: u8 = 0x01; const FRAME_CONTENT_HEADER: u8 = 0x02; const FRAME_CONTENT_BODY: u8 = 0x03; const FRAME_HEARTBEAT: u8 = 0x08; const FRAME_AMQP_VERSION: u8 = 0x41; ///...
extern crate gl; extern crate glfw; extern crate gumdrop; extern crate x11_dl; extern crate x11rb; use gumdrop::Options; use glfw::{ Action, Context, Key, Modifiers, MouseButton, OpenGlProfileHint, Window, WindowEvent, WindowHint, }; // include the OpenGL type aliases use gl::types::*; use std::ffi::{c_void,...
// 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. // All files in the project carrying such notice may not be copied, modified, or distributed // except according ...
//! Here we construct a polynomial commitment that enables users to commit to a //! single polynomial `p`, and then later provide an evaluation proof that //! convinces verifiers that a claimed value `v` is the true evaluation of `p` //! at a chosen point `x`. Our construction follows the template of the construction /...
// SPDX-License-Identifier: Apache-2.0 //! Host <-> Shim Communication use crate::allocator::ALLOCATOR; use crate::debug::_enarx_asm_triple_fault; use crate::eprintln; use crate::exec::{BRK_LINE, NEXT_MMAP_RWLOCK}; use crate::paging::SHIM_PAGETABLE; use crate::random::{random, CPU_HAS_RDRAND}; use crate::snp::attesta...
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor 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 ...
// local_mod.rs //! Module contains all functions for local external disk. #[allow(unused_imports)] use dropbox_content_hasher::DropboxContentHasher; use log::error; use std::fs; use std::io::Write; use std::path; use uncased::UncasedStr; use unwrap::unwrap; use crate::*; /// list all local files and folders. It can...
use near_sdk::{ near_bindgen, ext_contract, borsh::{self, BorshDeserialize, BorshSerialize}, collections::{ UnorderedMap, TreeMap}, json_types::{ ValidAccountId, Base58PublicKey, Base64VecU8, U128 }, serde_json::json, serde::{Deserialize, Serialize}, AccountId, Balance, BlockHeig...
//! Main entrypoint to the rehydrator. #![deny(unused_must_use)] #![deny(unsafe_code)] use crate::riverdelta::{ArtifactExt, RiverDelta}; use crate::streamid::stream_url_from_id; use anyhow::{anyhow, Context, Result}; use camino::{Utf8Path, Utf8PathBuf}; use coreos_stream_metadata::Artifact; use coreos_stream_metadata...
//! Client implmentation use std::collections::{BTreeSet, HashMap}; use std::io::{Read, Write}; use std::net::{Shutdown, TcpStream}; use std::path::PathBuf; #[cfg(target_family = "unix")] use std::os::unix::process::CommandExt; use chrono::{offset::Utc, DateTime}; use expjobserver::{ deserialize_ts, protoco...
// This code is from version 4.3.4. use libc::{c_char, c_int, c_long, c_short, c_uchar, c_void, size_t}; pub const ZMQ_HAUSNUMERO: c_int = 156384712; pub const EFSM: c_int = ZMQ_HAUSNUMERO + 51; pub const ENOCOMPATPROTO: c_int = ZMQ_HAUSNUMERO + 52; pub const ETERM: c_int = ZMQ_HAUSNUMERO + 53; pub const EMTHREAD: c_i...
use crate::error::CliError; use std::env::args; use std::error::Error; use std::path::Path; mod base64; mod block_crypto; mod distance; mod error; mod hex; mod otp; mod xor; fn decode_single(bytes: &[u8], single: u8) -> Result<(String, f64), Box<dyn Error>> { let english = &distance::ENGLISH_ALPHABET; let dec...
pub mod groth16_verifier; pub mod instructions; pub mod nullifier_state; pub mod poseidon_merkle_tree; pub mod processor; pub mod state; pub mod utils; use solana_program::{ account_info::{next_account_info, AccountInfo}, entrypoint, entrypoint::ProgramResult, msg, program_error::ProgramError, ...
use glib::{ToValue, Type}; use gtk::{Box, Button, ButtonExt, CellRendererExt, ComboBox, ComboBoxExt, EntryCompletionExt, Inhibit, Label, LabelExt, RangeExt, Scale, TreeModelExt, WidgetExt}; use gtk::{Builder, prelude::{GtkListStoreExtManual, BuilderExtManual}, Adjustment, DrawingArea, EntryExt, ListStore, T...
//---------------------------------------------------------------------------// // Copyright (c) 2017-2022 <NAME>. All rights reserved. // // This file is part of the Rusted PackFile Manager (RPFM) project, // which can be found here: https://github.com/Frodo45127/rpfm. // // This file is licensed under the MIT license...
// Copyright 2017-2019 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) a...
use std::error::Error; use std::fmt; use std::sync::{Arc, Mutex, RwLock}; use actix_web::{middleware, web, App, HttpRequest, HttpResponse, HttpServer}; #[macro_use] extern crate serde_json; use serde::Serialize; use handlebars::Handlebars; use std::io::{Read, BufReader, BufRead}; use std::ops::Index; use tokio::io::{...
extern crate bio; extern crate itertools; #[macro_use] extern crate failure; #[cfg_attr(test, macro_use)] extern crate gb_io; #[macro_use] extern crate log; use bio::alignment::sparse; use bio::alphabets::dna::revcomp; use gb_io::seq::{Seq, Topology}; use itertools::Itertools; use std::cmp; use std::collections::{Has...
//! Provides the parser for layout files of the original LiveSplit. use super::{Component, Layout, LayoutDirection}; use crate::{ component::separator, settings::{ Alignment, Color, Font, FontStretch, FontStyle, FontWeight, Gradient, ListGradient, }, timing::{ formatter::{Accuracy, Digi...
// Copyright 2017 TiKV Project Authors. Licensed under Apache-2.0. use std::fs; use std::io::{Error, ErrorKind, Result}; use std::sync::Mutex; use std::time::{Duration, Instant}; use collections::HashMap; use libc::{self, pid_t}; use prometheus::core::{Collector, Desc}; use prometheus::{self, proto, CounterVec, IntCo...
//! The `ObligationForest` is a utility data structure used in trait //! matching to track the set of outstanding obligations (those not yet //! resolved to success or error). It also tracks the "backtrace" of each //! pending obligation (why we are trying to figure this out in the first //! place). //! //! ### Externa...
/// An algorithm to extract the maximal node-centric trivial omnitigs. pub mod default_node_centric_trivial_omnitigs; /// An algorithm to extract the maximal trivial omnitigs. pub mod default_trivial_omnitigs; /// An algorithm to extract non-trivial omnitigs from macrotigs using the incremental hydrostructure. pub mod ...
//! Implements hashing for Weld types. //! //! The main trait this module exposes is `GenHash`, which provides an interface for generating a //! hash function for the specified Weld type. Currently, this module only supports hashing with //! CRC32 using Intel's SSE 4.2 CRC32 intrinsics. Eventually, the module is slated...
use geometry::camera::Camera; use geometry::ray; use light::SamplableShape; use math::hcm::{point3, vec3, Point3, Vec3}; use radiometry::color::Color; use crate::Scene; use material as mtl; use shape::Sphere; use std::f32::consts::PI; use std::sync::Arc; use texture as tex; use tlas::instance::Instance; const WIDTH: ...
extern crate ansi_term; extern crate box_drawing; extern crate clap; #[macro_use] extern crate error_chain; extern crate itertools; #[macro_use] extern crate log; extern crate atty; extern crate env_logger; extern crate libc; extern crate ndarray; extern crate pbr; #[macro_use] extern crate tract_core; #[cfg(feature = ...
// Copyright 2018 Cloudbase Solutions Srl // Copyright 2018-2019 CrowdStrike, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); you may // not use this file except in compliance with the License. You may obtain // a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // ...
use std::collections::VecDeque; use std::fmt::Debug; use proctor::elements::{Point, SignalDetector}; use proctor::error::PlanError; use serde::{Deserialize, Serialize}; use super::WorkloadForecast; use crate::phases::plan::forecast::regression::{LinearRegression, QuadraticRegression}; use crate::phases::plan::forecas...
/* MIT License Copyright (c) 2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distrib...
//! Interface to the DBMS. //! use crate::common::errors::Error; use crate::common::defs::Sequence; use crate::common::defs::ObjectId; use crate::common::defs::SeekFrom; use crate::common::defs::SharedSequences; use crate::tran_mgr::tran_mgr::TranMgr; use crate::log_mgr::log_mgr::RecType; use crate::log_mgr::log_mgr:...
use metrics::config::*; use chrono::{Date, DateTime, Datelike, TimeZone, Utc, Weekday}; use clap::{App, Arg}; use env_logger; use lazy_static::lazy_static; use metrics::asana::*; use regex::Regex; use std::collections::{HashMap, HashSet}; use std::fmt::Write as FmtWrite; use std::fs; use std::fs::File; use std::io::Wr...
pub use libretro_rs_sys as sys; pub mod core_macro; use std::ffi::{CStr, CString}; use sys::*; #[allow(unused_variables)] pub trait RetroCore { const SUPPORT_NO_GAME: bool = false; /// Called when a new instance of the core is needed. The `env` parameter can be used to set-up and/or query values /// required ...
//! # Farm Pallet //! //! ## Overview //! //! Farm pallet provides functionality for managing liquidity mint. #![cfg_attr(not(feature = "std"), no_std)] #![allow(clippy::unused_unit)] #![allow(clippy::upper_case_acronyms)] use codec::{Decode, Encode}; use core::convert::{TryFrom}; use frame_support::{ traits::{Get, ...
use std::collections::VecDeque; use plex::lexer; use unicode_xid::UnicodeXID; use symbol::pos::{span, spanned, spanned2, Location, Span}; use crate::lexer::error::{LexerError, PlexLexerError}; use crate::lexer::escaped::unescape; use crate::lexer::numeric::{float_literal, non_float_literal}; use crate::lexer::token:...
#![allow(non_snake_case)] use std::collections::VecDeque; use std::sync::mpsc; use ::{ spsc, worker_thread, ToReplicate, ToWorker, DistributeToWorkers, Troption, Recovery, SkeensMultiStorage, ToSend, ChainReader, }; use shared_slice::RcSlice; use hash::HashMap; use socket_addr::Ipv4SocketAddr; use packet...
use clippy_utils::ast_utils::{eq_id, is_useless_with_eq_exprs, IdentIter}; use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::source::snippet_with_applicability; use core::ops::{Add, AddAssign}; use if_chain::if_chain; use rustc_ast::ast::{BinOpKind, Expr, ExprKind, StmtKind}; use rustc_data_structure...
// todo: When error, the error info still updates some nodes.. pub mod util; use util::makenode; pub mod error; pub use error::{EngineError, get_error_info}; use hashbrown::HashMap; use petgraph::{graph::NodeIndex}; use glicol_parser::{get_ast}; use glicol_synth::{AudioContext, AudioContextConfig, NodeData, BoxedNode...
// Copyright (c) The diem-devtools Contributors // SPDX-License-Identifier: MIT OR Apache-2.0 use crate::{ reporter::{CancelReason, TestEvent}, stopwatch::{StopwatchEnd, StopwatchStart}, test_list::{TestInstance, TestList}, SignalEvent, SignalHandler, }; use crossbeam_channel::{RecvTimeoutError, Sender...
use anyhow::{anyhow, Error}; use anyhow::{ensure, Context}; use graph::blockchain::TriggerWithHandler; use graph::components::store::StoredDynamicDataSource; use graph::prelude::ethabi::ethereum_types::H160; use graph::prelude::ethabi::StateMutability; use graph::prelude::futures03::future::try_join; use graph::prelude...
use std::{ collections::HashMap, intrinsics::{copy_nonoverlapping, unlikely}, mem, slice, }; use base::mem::shape_slice; use libc::{c_void, close}; use meta::{ store::{ parts::{ ensure_table_path_existed, gen_ompath_from_part_path, get_part_path, open_file_as_fd, PartSto...
use std::borrow::Cow; use std::cmp::{self, Ordering}; use std::collections::binary_heap::PeekMut; use std::collections::{btree_map, BTreeMap, BinaryHeap, HashMap}; use std::mem::take; use roaring::RoaringBitmap; use super::{resolve_query_tree, Context, Criterion, CriterionParameters, CriterionResult}; use crate::sear...
use rand::prelude::*; use bob::{ Blob, BlobKey, BlobMeta, BobApiClient, ExistRequest, GetOptions, GetRequest, GetSource, PutOptions, PutRequest, }; use clap::{App, Arg, ArgMatches}; use std::collections::HashMap; use std::error::Error; use std::fmt::{Debug, Formatter, Result as FmtResult}; use std::ops::Sub; ...
mod opcodes; mod status; mod unofficial_opcodes; mod debug; use crate::cpu::status::Status; use crate::cartridge::Mapper; use crate::ppu::PPU; use crate::controller::Controller; use std::rc::Rc; use std::cell::RefCell; #[derive(Copy, Clone, Debug)] pub enum Mode { ABS, // Absolute ABX, // AbsoluteX ABY, ...
//! Module for entities and their storage. use crate::actor::Actor; use crate::battle::BattleRules; use crate::character::Character; use crate::creature::{Creature, CreatureId, RemoveCreature}; use crate::error::{WeaselError, WeaselResult}; use crate::event::{Event, EventProcessor, EventTrigger}; use crate::object::{O...
extern crate byteorder; use vec_map::VecMap; use self::byteorder::{BigEndian, ByteOrder}; use classfile::attribute_info::{ AttributeInfo, ExceptionTableEntry, LineNumberTableEntry, LocalVariableTableEntry, }; use classfile::class_file::ClassFile; use classfile::constant_info::ConstantInfo; use classfile::constan...
// Copyright 2021 <NAME> // SPDX-License-Identifier: Apache-2.0 use crate::MilestoneData; use anyhow::{ anyhow, bail, }; use indicatif::{ ProgressBar, ProgressStyle, }; use serde::Deserialize; use serde_json::Value; use std::{ fmt::Display, ops::{ Deref, DerefMut, Range,...
use std::collections::{HashMap, HashSet}; use std::slice; use crate::frontend::Expr; use crate::function_translator::SVariable; use crate::jit::{ArraySized, Env, SValue, StructDef}; use crate::validator::{bool_t, f32_t, i64_t, str_t, u8_t, ArraySizedExpr, ExprType, TypeError}; use crate::{ decl, frontend::{Arg...
#![allow(dead_code)] use packed_struct::prelude::*; use ppu::{OamEntry, PpuRegisters}; #[cfg(test)] use proptest_derive::Arbitrary; use read_view_u8::*; use register::R16; use sound; use std::borrow::Cow; use std::convert::TryInto; use std::fmt; use std::string::String; use these::These; /* 5.1. General memory map I...
//! A collection of default help commands for the framework. //! //! # Example //! //! Using the [`with_embeds`] function to have the framework's help message use //! embeds: //! //! ```rs,no_run //! use serenity::framework::standard::help_commands; //! use serenity::Client; //! use std::env; //! //! let mut client = C...
use std::error::Error; use std::fs; use std::io; use std::collections::{BTreeMap, HashMap, HashSet}; use alphabets::dna; use bio::alphabets; use bio::io::fasta; use statrs::distribution::{Binomial, Discrete}; use bio::stats::LogProb; extern crate bincode; use bincode::{deserialize_from, serialize_into}; use crate:...
//! Performant cross-platform timing with goodies. //! //! `quanta` provides a simple and fast API for measuring the current time and the duration between //! events. It does this by providing a thin layer on top of native OS timing functions, or, if //! available, using the Time Stamp Counter feature found on modern ...
// Copyright 2018 <NAME> // // 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...
use std::{collections::BTreeMap, ops::Deref, sync::Arc}; use value::Value; use super::VmFunctionClosure; use super::{state::VmState, Variable}; #[cfg(feature = "expr-op")] use crate::value::VrlValueArithmetic; use crate::value::VrlValueConvert; use crate::{vm::argument_list::VmArgument, Context, ExpressionError, Func...
// Copyright (c) 2020 <NAME> <<EMAIL>>. All rights reserved. // Use of this source is governed by Apache-2.0 License that can be found // in the LICENSE file. pub const LS_SIZE: i32 = 256 * 1024; pub const LS_ADDR_MASK: i32 = LS_SIZE - 1; pub const MFC_PUT_CMD: i32 = 0x20; pub const MFC_PUTS_CMD: i32 = 0x28; pub cons...
mod load_gltf; use std::{cmp, fs, io, iter, ops}; use std::borrow::Cow; use std::collections::hash_map::{Entry, HashMap}; use std::io::Read; use std::path::{Path, PathBuf}; use animation; use camera; use cgmath::Vector3; use color; use genmesh::{Polygon, Triangulate}; use gfx; use gfx::format::I8Norm; use gfx::traits...
// Example code that deserializes and serializes the model. // extern crate serde; // #[macro_use] // extern crate serde_derive; // extern crate serde_json; // // use generated_module::[object Object]; // // fn main() { // let json = r#"{"answer": 42}"#; // let model: [object Object] = serde_json::from_str(&jso...
use cgmath::{Point2, Vector2}; use gfx::{self, *}; use ggez::conf; use ggez::event; use ggez::graphics::{self, BlendMode, Canvas, DrawParam, Drawable, Shader}; use ggez::input::keyboard::{self, KeyCode}; use ggez::nalgebra as na; use ggez::timer; use ggez::{Context, GameResult}; use rand::{self, thread_rng, Rng}; use s...
use crate::{ core::{ geometry::{Normal3f, Point2f, Vector3f}, interaction::{BaseInteraction, SpawnRayTo, SurfaceInteraction}, interpolation::{ catmull_rom_weights, integrate_catmull_rom, invert_catmull_rom, sample_catmull_rom_2d, }, material::{MaterialDt, Transpor...
use crate::packets::PacketBody; use crate::SliceCursor; /// World Info. /// /// Direction: Server -> Client. #[derive(Debug, Clone, Default)] pub struct WorldInfo { pub time: i32, // bitflags { pub day_time: bool, pub blood_moon: bool, pub eclipse: bool, // } pub moon_phase: u8, pub max...
use std::{cmp::Ordering, convert::TryInto, error::Error as _, io, mem, ops::Range}; use crate::{ allocate_block_bytes, block_group, calculate_crc32c, disk::BlockKind, inode::Blocks, Filesystem, }; use quick_error::quick_error; use scroll::{Pread, Pwrite}; mod pairs; pub use pairs::Pairs; /// The magic number id...
pub type shmatt_t = ::c_ulong; pub type msgqnum_t = ::c_ulong; pub type msglen_t = ::c_ulong; pub type regoff_t = ::c_int; pub type __rlimit_resource_t = ::c_uint; pub type __priority_which_t = ::c_uint; cfg_if! { if #[cfg(doc)] { // Used in `linux::arch` to define ioctl constants. pub(crate) type ...
// Copyright Materialize, Inc. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License...
// Copyright 2018 The xi-editor 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 ag...
/*--------------------------------------------------------------------------------------------- * Copyright © 2016-present Earth Computing Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE.txt in the project root for license information. *----------------------------------------------...
// Copyright (c) 2017-2020, The rav1e contributors. All rights reserved // // This source code is subject to the terms of the BSD 2 Clause License and // the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License // was not distributed with this source code in the LICENSE file, you can // obtain it at ...
//! Utils for Holochain tests use crate::conductor::api::RealAppInterfaceApi; use crate::conductor::api::ZomeCall; use crate::conductor::config::AdminInterfaceConfig; use crate::conductor::config::ConductorConfig; use crate::conductor::config::InterfaceDriver; use crate::conductor::p2p_store; use crate::conductor::Con...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Start TWI receive sequence"] pub tasks_startrx: TASKS_STARTRX, _reserved1: [u8; 4usize], #[doc = "0x08 - Start TWI transmit sequence"] pub tasks_starttx: TASKS_STARTTX, _reserved2: [u8; 8usize], #[doc = "0x14 - ...
// Copyright (c) SimpleStaking and Tezedge Contributors // SPDX-License-Identifier: MIT use std::{convert::TryInto, sync::Arc}; use std::convert::TryFrom; use getset::{CopyGetters, Getters, Setters}; use rocksdb::{Cache, ColumnFamilyDescriptor, MergeOperands}; use slog::{warn, Logger}; use crypto::hash::{BlockHash,...
use std::result; use std::fmt::{self, Display}; use std::collections::{BTreeMap,HashSet}; use std::collections::btree_map::Entry; use num::{zero, one}; use std::io::{Read,Write}; use std::iter::FromIterator; use alt::Alt; use integer::Integer; use rpc_common::{ChoiceRow,Subject}; use codec::{self,Encode,Decode,Packed}...
use alacritty_terminal::{grid::Dimensions, term::cell::Flags}; use anyhow::Result; use crossbeam_channel::{unbounded, Receiver, Sender, TryRecvError}; use druid::{Command, ExtEventSink, Lens, Modifiers, Target, WidgetId}; use druid::{Data, Env, EventCtx}; use fuzzy_matcher::skim::SkimMatcherV2; use fuzzy_matcher::Fuzzy...
// Copyright 2019 The xi-editor 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 ag...
use std::fs; use std::time; use std::time::Duration; use rand::prelude::*; use gfx::Gfx; use memory::Memory; use register::Registers; use crate::multimedia::Multimedia; use crate::multimedia::screen::Drawable; use crate::multimedia::sound::Beeper; use crate::multimedia::input::EventManager; use std::rc::Rc; use std:...
//! This module defines the `NiftiHeader` struct, which is used //! to provide important information about NIFTI-1 volumes. #[cfg(feature = "nalgebra_affine")] use crate::affine::*; use crate::error::{NiftiError, Result}; use crate::typedef::*; use crate::util::{is_gz_file, validate_dim, validate_dimensionality}; use ...
//! Power Management Controller registers. use mirage_mmio::{Mmio, VolatileStorage}; /// Base address for the PMC registers. pub(crate) const PMC_BASE: u32 = 0x7000_E400; /// Representation of the PMC registers. #[repr(C)] pub struct Pmc { pub cntrl: Mmio<u32>, pub sec_disable: Mmio<u32>, pub pmc_swrst: ...
/* * Copyright (c) 2017 <NAME> <<EMAIL>> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, pu...
use std::{ collections::{BinaryHeap, VecDeque}, fmt, num::NonZeroUsize, task::Poll, }; use futures::{poll, FutureExt, Stream, StreamExt, TryFutureExt}; use futures_util::future::poll_fn; use tokio::{pin, select}; use tower::Service; use tracing::Instrument; use vector_buffers::{Ackable, Acker}; use vec...
use crate::line_or_point::Float; use log::trace; use slab::Slab; use std::{cmp::Ordering, collections::{BinaryHeap, BTreeSet}, fmt::Debug}; use crate::{ active::{Access, Active, SplayWrap}, events::{Event, EventType, SweepPoint}, line_or_point::LineOrPoint::{self, *}, Crossable, Crossing, }; /// A seg...
use super::*; use percent_encoding::{percent_decode, utf8_percent_encode, AsciiSet, CONTROLS}; use reqwest::StatusCode; use serde_json::Value; use url::Url; const FRAGMENT: &AsciiSet = &CONTROLS.add(b' ').add(b'"').add(b'<').add(b'>').add(b'`'); pub fn new_domain_with_path_re(domain: &str) -> Result<Regex, regex::Er...
//! Code specific to the ZIP file format specification. //! //! We try to keep the nitty gritty here, //! and higher-level stuff in the [`read`] module. //! (This pattern, like several others, was inspired by the Zip crate.) //! //! Most comments quote the ZIP spec, [`APPNOTE.TXT`]. //! //! [_Zip Files: History, Explan...
use std::fs::{self, OpenOptions}; use std::io::{Cursor, Read, Seek, SeekFrom}; use std::path::Path; use binrw::{binrw, BinRead}; use byteordered::ByteOrdered; use io::BinInvertedReader; use thiserror::Error; use crate::io::ReverseReader; pub mod io; #[derive(Error, Debug)] pub enum AHDDError { #[error("Can't ge...
// Copyright (c) 2019 Chaintope Inc. // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. mod message_processor; mod node_parameters; mod utils; use crate::blockdata::Block; use crate::crypto::multi_party_schnorr::*; use crate::net:...
// Copyright 2017 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 ...
// 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. // This module contains the bulk of the logic for connecting user applications to a // vsock driver. // // Handling user requests is complicated as there a...
// 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 ...
//! A collection of resource pool types used internally to cache GFX-HAL types. mod layouts; mod lease; #[rustfmt::skip] mod skydome { include!(concat!(env!("OUT_DIR"), "/skydome.rs")); } pub use self::lease::Lease; use { self::{layouts::Layouts, skydome::SKYDOME}, super::{ adapter, def:...
use crate::{ cells::{Cartesian2DCoordinate, Cell, CompassPrimary, SquareCell}, grid::{Grid, IndexType}, grid_traits::GridIterators, pathing, sdl, sdl::SdlSetup, }; use lazy_static::*; // macro use sdl2::{ event::{Event, WindowEvent}, hint, image::SaveSurface, pixels::{Color, PixelFo...
#![allow(clippy::from_over_into)] use std::{ collections::{BTreeMap, HashMap}, env, fs, io::{copy, Write}, process::Command, }; use anyhow::{bail, Result}; use async_bb8_diesel::AsyncRunQueryDsl; use async_trait::async_trait; use chrono::Duration; use chrono::{DateTime, Utc}; use chrono_tz::Tz; use goo...
// Copyright (C) 2022 <NAME> <<EMAIL>> // SPDX-License-Identifier: MIT OR Apache-2.0 // // The `ErrorKind` variant names, numbers, and descriptions are copied from // Google source code. I believe this is fair use of an API as established in // Google LLC v. Oracle America, Inc. In any case, the original Google code is...
use crate::formatter_traits::FormatTokenAndNode; use crate::utils::has_formatter_suppressions; use crate::{ block_indent, concat_elements, empty_element, empty_line, format_elements, group_elements, hard_line_break, if_group_breaks, if_group_fits_on_single_line, indent, join_elements_hard_line, line_suffix,...
use std::num::NonZeroUsize; use reqwest::{ blocking::get as reqwest_get }; use serde::{Deserialize, Deserializer}; use scraper::{Html, Node}; use crate::util::{MsgBunchBuilder, MsgBunch, to_subscript, to_superscript, split_trim}; #[derive(Debug, Clone, Deserialize)] pub struct SprotinResponse { search_inflect...
use std::convert::{TryFrom, TryInto}; use std::fmt::{self, Debug, Formatter}; use std::marker::PhantomData; use anyhow::ensure; use filecoin_hashers::Hasher; use log::info; use sha2raw::Sha256; use storage_proofs_core::{ api_version::ApiVersion, crypto::{ derive_porep_domain_seed, feistel::{sel...
use proc_macro2::TokenStream; use quote::{format_ident, quote}; use std::collections::BTreeMap; use syn::{ self, parse_quote, punctuated::Punctuated, AngleBracketedGenericArguments, AttributeArgs, Error, FnArg, ImplItem, ItemImpl, Lit::Str, Meta, Meta::NameValue, MetaList, MetaNameValue, NestedMeta, PatType...
// 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 crate::hid::command::Command; use crate::hid::connection::{Connection, FidlConnection}; use crate::hid::message::{BuilderStatus, Message, MessageBuilde...