text
stringlengths
3.09k
13.9k
use crate::{plugins::PluginManager, prelude::*, util::StaticService, MQTTConfiguration, Result}; use async_trait::async_trait; use chrono::prelude::*; use cluster::ClusterState; use rumqttc::{self, AsyncClient, Event, EventLoop, Incoming, LastWill, MqttOptions, QoS}; use std::{sync::Arc, time::Duration}; mod cluster; ...
use hyper::{header, Method, StatusCode}; use hyper::server::{Request, Response}; use walkdir::{DirEntry, WalkDir}; use url::percent_encoding::percent_encode_byte; use futures_cpupool::{CpuFuture, CpuPool}; use futures::{Future, Poll}; use super::{Config, Error, FutureObject}; use std::path::PathBuf; use std::{mem, t...
use std::rc::Rc; use super::state::*; use shared::domain::jig::module::body::_groups::design::Trace; use utils::{drag::Drag, prelude::*, resize::get_resize_info}; use dominator::clone; use crate::debug::*; use components::audio::mixer::{AudioPath, AudioSourceExt, AUDIO_MIXER}; use components::collision::stickers_tra...
//! The top sorting algorithm; that is, the modified merge sort we keep //! talking about. #[cfg(test)] mod tests; use crate::find_run::get_run; use crate::insort; use crate::merge::merge; use std::cmp::min; /// Minimum run length to merge; anything shorter will be lengthend and /// sorted using `insort::sort`. cons...
// Copyright 2020 Contributors to the Parsec project. // SPDX-License-Identifier: Apache-2.0 use crate::{ abstraction::{cipher::Cipher, IntoKeyCustomization, KeyCustomization}, attributes::{ObjectAttributesBuilder, SessionAttributesBuilder}, constants::{AlgorithmIdentifier, SessionType}, handles::{Auth...
/// Cluster manages up to date information and connections to database nodes use crate::routing::Token; use crate::transport::connection::{Connection, ConnectionConfig}; use crate::transport::errors::QueryError; use crate::transport::node::{Node, NodeConnections}; use crate::transport::topology::{Keyspace, TopologyRead...
use ggez::{ conf, event, graphics::{self, Font, Image, Rect, Text}, nalgebra::Point2, Context, ContextBuilder, GameResult, }; use ggwp_zgui as ui; #[derive(Clone, Copy, Debug)] enum Message { A, B, C, Image, X, Y, Z, } // TODO: rework this into some more game-like fn make_g...
//! # LMX2594 initialization //! //! This program initializes an LMX2594 evaluation board using a //! Raspberry Pi Pico. //! //! ```text //! Raspberry Pi Pico Pinout //! ======================== //! //! | Pin | Purpose | //! +-----+-------------+ //! | 4 | SPI0 SCK | //! | 5 | SPI0 TX | //! | 6 | SPI0 ...
#![cfg_attr(target_os = "none", no_std)] pub mod api; use api::*; use num_traits::{FromPrimitive, ToPrimitive}; use xous::{msg_scalar_unpack, send_message, Message, CID}; use xous_ipc::Buffer; pub struct CbTestServer { conn: CID, tick_cb_sid: Option<xous::SID>, req_cb_sid: Option<xous::SID>, } static mut R...
use std::cmp; use std::f64::consts::LN_10; use crate::process::GT_HET; use libc::c_double; #[link(name = "m")] extern "C" { fn lgamma(x: c_double) -> c_double; } const LFACT_STORE_SIZE: usize = 256; pub struct FisherTest { lfact_store: [f64; LFACT_STORE_SIZE], } impl FisherTest { pub fn new() -> Self { let m...
use std::fmt; #[derive(Debug, Default)] pub struct Expr { stack: Vec<Term>, } #[derive(Debug)] pub struct ParseError { kind: ParseErrorKind, } impl fmt::Display for ParseError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match &self.kind { ParseErrorKind::InvalidTerm(s) | ParseErrorKind::Inva...
use bytemuck::{Pod, Zeroable}; use std::{borrow::Cow, mem::size_of}; use wgpu::util::DeviceExt; use winit::{ event::{Event, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::Window, }; #[repr(C)] #[derive(Clone, Copy, Pod, Zeroable)] struct Vertex { _pos: [f32; 4], _color: [f32; 4], } fn...
use self::space_image_format::Image; use crate::util::parse_digits; use anyhow::Result; pub fn part1(input: &str) -> Result<String> { let data = parse_digits(input)?; let img = Image::new(data, 25, 6); let mut min_layer = None; for layer in img.layers() { let cs = checksum_layer(layer.as_ref()...
pub mod injections; pub mod location; pub mod raw_captures; pub mod raw_grammar; pub mod raw_repository; pub mod raw_rule; pub use self::injections::InjectionMap; pub use self::location::ILocatable; pub use self::location::ILocation; pub use self::raw_captures::IRawCaptures; pub use self::raw_captures::IRawCapturesMap...
//! This is a library for converting **structured** XML to JSON based on this ["spec"](https://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html). //! Uses models from [treexml](https://github.com/rahulg/treexml-rs) and [serde-json](https://github.com/serde-rs/json). //! //! //! ## Example //! ``` //! l...
use std::net::SocketAddr; use std::fmt; use futures::Future; use errors::Error; use common::asycinit::AsyncInitWrapper; use common::wrapped::WrappedRcRefCell; use common::{ConsistencyCheck, RcSet}; use common::id::WorkerId; use common::resources::Resources; use super::{DataObjectRef, TaskRef}; use errors::Result; pu...
use std::cell::RefCell; use std::pin::Pin; use std::rc::Rc; use futures::future::{abortable, AbortHandle, TryFutureExt}; use futures::io::{AsyncRead, AsyncReadExt}; use js_sys::{Error as JsError, Promise, Uint8Array}; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::future_to_promise; use crate::util::{checked...
use crate::bind::*; use crate::exec::*; use crate::meta::*; use smallvec::*; use std::sync::*; use std::convert::*; /// /// Creates the syntax definition for the 'def' keyword /// /// ```(def <name> <value>)``` /// /// Assigns `<value>` to the atom called `<name>`. It is possible to redefine an existing atom. The v...
use dbus::{ arg::{RefArg, Variant}, channel::Sender, nonblock::stdintf::org_freedesktop_dbus::PropertiesPropertiesChanged, tree::MethodErr, Message, Path, }; use futures::{ channel::{mpsc, oneshot}, prelude::*, }; use std::{collections::HashMap, sync::Arc}; use super::{ super::{ ...
extern crate web_sys; extern crate js_sys; mod utils; use wasm_bindgen::prelude::*; use std::fmt::{Display, Formatter, Result as fmtResult}; // A macro to provide `println!(..)`-style syntax for `console.log` logging. macro_rules! log { ( $( $t:tt )* ) => { web_sys::console::log_1(&format!( $( $t )* ).in...
use arrow2::datatypes::*; use arrow2_convert::field::{FixedSizeBinary, FixedSizeVec, LargeBinary, LargeString, LargeVec}; use arrow2_convert::ArrowField; #[test] fn test_schema_types() { #[derive(Debug, ArrowField)] struct Root { name: Option<String>, is_deleted: bool, a1: Option<f64>, ...
use super::bucket::Bucket; use super::credentials::Credentials; use super::region::Region; use chrono::Utc; use rand::{self, distributions::Alphanumeric, Rng}; use rusoto_core::credential::StaticProvider; use rusoto_core::request::HttpClient; use rusoto_core::{ByteStream, RusotoError}; use rusoto_s3::S3 as RusotoS3; us...
use crate::errors::FlyError; use crate::js::*; use crate::msg; use crate::runtime::{JsRuntime, Runtime}; use flatbuffers::FlatBufferBuilder; use futures::{ future, sync::{mpsc, oneshot}, Future, Stream, }; use libfly::*; use std::ptr; use tokio_signal::unix::{Signal, SIGINT, SIGTERM}; // Buf represents a byte ar...
use super::api; use chrono::NaiveDateTime; use console::style; use dialoguer::{Confirmation, Input}; use directories::ProjectDirs; use failure::Error; use mkdirp::mkdirp; use serde_json; use std::fs::{remove_file, File}; use std::io::prelude::*; use std::path::{Path, PathBuf}; use std::time::{SystemTime, UNIX_EPOCH}; u...
//! TODO: This module structure has not aged well... //! //! Right now, this module contains several specs systems, which //! 1) logically should be where the remaining code of those components is //! 2) could potentially be rewritten to not use dispatcher at all use super::{Clickable, MouseState}; use crate::game::{...
use crate::priv_prelude::*; /// A node representing an ethernet machine pub struct MachineNode<F> { func: F, } /// Create a node for a machine with an ethernet interface. This node will run the given function /// in a network namespace with a single interface. pub fn machine<T, F>(func: F) -> MachineNode<F> where...
// Copyright (c) 2021 The Lutino Projects // // 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. use std::slice::Iter; use nh_job_system::iter::IntoParallelIterator; use nh_job_system::JobSystem; use crate::iter::indexe...
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { crate::v1::V1Realm, files_async::readdir_with_timeout, fuchsia_zircon as zx, futures::future::{BoxFuture, FutureExt}, io_util::{d...
// Copyright (C) 2021 <NAME> <<EMAIL>> // This file is subject to the terms and conditions defined in // file 'LICENSE', which is part of this source code package. use sqrid; use sqrid::Qr; use anyhow::Result; use std::convert::TryFrom; #[test] fn test_basic() -> Result<()> { let qr0 = Qr::default(); let qr1...
use log::*; use screeps::{ find, prelude::*, ConstructionSite, Part, Position, RawObjectId, StructureController, }; use crate::creeps::{Creep, Role}; pub fn get_description(capacity: u32) -> Option<Vec<Part>> { if !can_allocate_more() { return None; } let part_set = [Part::Move, P...
extern crate reqwest; extern crate serde; use serde::de::{Deserializer, Error}; use serde::{Deserialize, Serialize}; #[derive(Debug, Deserialize)] pub struct ReverseGeocodeResponse { /// This field contains information about the response. pub info: Info, pub options: Options, pub results: Vec<ReverseG...
use super::*; use crate as pallet_anchor; use sp_core::H256; pub use darkwebb_primitives::hasher::{HasherModule, InstanceHasher}; use frame_support::parameter_types; use frame_system as system; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, }; type UncheckedExtrinsic = frame_system::mocki...
/* * Copyright 2020 Fluence Labs Limited * * 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...
// Copyright Materialize, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by ...
extern crate sdl2; use std::f64::INFINITY; use std::fs::File; use std::io::Write; use std::sync::{Arc, Mutex}; use std::thread; use std::time::Instant; use threadpool::ThreadPool; use utils::math_utils::random_double; use crate::camera::{Camera, create_camera}; use crate::color::write_color; use crate::hittables::h...
use std::any::{Any, TypeId}; use std::collections::HashMap; use unsafe_any::UnsafeAny; use parameter::*; #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] enum Key { String(String), Id(TypeId), } #[cfg(not(feature = "thread_safe"))] pub type ParameterMap = AnyParameterMap; #[cfg(feature = "threa...
use std::fs::File; use std::io::{BufReader, BufRead}; use std::path::PathBuf; use futures::future::join_all; use clap::Parser; use tracing::error; use std::time::Duration; use humantime::parse_duration; use fluvio::{ Compression, Fluvio, FluvioError, TopicProducer, TopicProducerConfigBuilder, RecordKey, Produc...
use std::path::PathBuf; use std::process::Command; use std::{fs, path}; use anyhow::{anyhow, Result}; use sshkeys::Certificate; use thiserror::Error; use tracing::debug; use vaultrs::api::ssh::requests::SignSSHKeyRequest; use vaultrs::client::VaultClient; use vaultrs::error::ClientError; use vaultrs::ssh; use crate::...
use criterion::{criterion_group, criterion_main, Criterion}; fn criterion_benchmark(c: &mut Criterion) { c.bench_function("acs", move |b| { let rt = tokio::runtime::Builder::new_multi_thread().build().unwrap(); b.to_async(rt).iter(|| acs_correctness()); }); } criterion_group! { name = benc...
mod view; use std::sync::Arc; use anyhow::Result; use async_trait::async_trait; use tokio::sync::mpsc::Sender; use tokio::sync::RwLock; use self::view::View; use crate::cli::app::Return; use crate::cli::prompt::PromptHandle; use crate::cli::term::buffer::Buffer; use crate::cli::tty::{Event, KeyCode, KeyEvent}; use ...
//! API in rcl/types.h use crate::*; /// The type that holds an rcl return code. pub type rcl_ret_t = rmw_ret_t; /// Success return code. pub const RCL_RET_OK: u32 = 0; /// Unspecified error return code. pub const RCL_RET_ERROR: u32 = 1; /// Timeout occurred return code. pub const RCL_RET_TIMEOUT: u32 = 2; /// Faile...
use crate::color::ColorScheme; use crate::error::{ErrorKind, Result}; use async_std::{fs, prelude::*}; use dirs; use failure::ResultExt; use futures::future; use std::path::PathBuf; use surf::{middleware::HttpClient, Request}; /// A GitHub repository that provides color schemes. pub struct Provider { user_name: St...
// 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. //! Mold faction logic. //! //! Mold stores 0.0-1.0 fractions in `u8` bytes. Usual floating-point logic is translated into //! usual unsigned integer logic...
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use std::{collections::VecDeque, time::Duration, time::Instant}; /// The short period used for throttling update checks. const SHORT_PERIOD_DURATION: Dura...
use std::{path::PathBuf, sync::Arc}; use crate::build_events::hydrated_stream; use super::super::index_table; use bazelfe_protos::*; use dashmap::DashMap; use lazy_static::lazy_static; use regex::Regex; use std::collections::HashSet; use tokio::sync::mpsc; use tokio::sync::RwLock; pub trait ExtractClassData<U> { ...
use ring::pbkdf2::{derive, PBKDF2_HMAC_SHA512}; use ring::aead::{AES_256_GCM, NonceSequence, Nonce, BoundKey, UnboundKey, SealingKey, Aad, OpeningKey}; use ring::error::Unspecified; use byteorder::{WriteBytesExt, BE}; use std::num::NonZeroU32; use std::error::Error; #[derive(Debug)] pub(crate) struct CountingNonceSe...
use std::net::{Shutdown, SocketAddr}; use bytes::BytesMut; use log::{debug, trace}; use snafu::ResultExt; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::{TcpStream, UdpSocket}; use async_trait::async_trait; use crate::codec::DeframeError; use crate::error::box_error; use crate::error::Error as TapsErr...
use super::symbol::*; use crate::scope_stack::ScopeStack; use std::collections::HashMap; #[derive(Debug)] pub struct Scope { scope_seq: u8, scope_name: String, // 1.全局,2临时 scope_type: u8, scope_parent: Option<String>, scope_children: HashMap<String, Scope>, // 符号表,存储此域下所有符号,K:符号名,V:符号对象 symbol_table: HashMap<S...
#[macro_use] extern crate wascc_codec as codec; #[macro_use] extern crate log; use codec::capabilities::{ CapabilityDescriptor, CapabilityProvider, Dispatcher, NullDispatcher, OperationDirection, OP_GET_CAPABILITY_DESCRIPTOR, }; use codec::core::{CapabilityConfiguration, OP_BIND_ACTOR, OP_REMOVE_ACTOR}; use c...
/* * 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 ...
use self::fields_config::FieldsConfig; use crate::{ create::write_docs::DocWriteRes, metadata::FulltextIndexOptions, persistence::{Persistence, *}, tokenizer::*, util::StringAdd, }; use fnv::FnvHashMap; use fst::{self, MapBuilder}; use num::ToPrimitive; use std::{self, io, str, sync::Arc}; use s...
use std::any::type_name; use std::cmp::Ordering; use std::fmt; use std::process::Command; use edgedb_client as client; use crate::server::detect::{VersionQuery}; use crate::server::distribution::{MajorVersion, DistributionRef}; use crate::server::init::{self, Storage}; use crate::server::install; use crate::server::u...
use regex::Regex; use lazy_static::lazy_static; use select::node::{Descendants, Node}; use select::predicate::{Name, Predicate}; use std::borrow::Cow; use std::collections::HashSet; lazy_static! { /// A [`Regex`] to determine whether a `Node`'s attribute should be ignored pub static ref RE_BAD_NODES_ATTR : R...
// Copyright (c) 2017 <NAME>, RWTH Aachen University // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://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 exc...
#[doc = "Reader of register IMR"] pub type R = crate::R<u32, super::IMR>; #[doc = "Reader of field `RXRDY`"] pub type RXRDY_R = crate::R<bool, bool>; #[doc = "Reader of field `TXRDY`"] pub type TXRDY_R = crate::R<bool, bool>; #[doc = "Reader of field `RXBRK`"] pub type RXBRK_R = crate::R<bool, bool>; #[doc = "Reader of...
//! `LineIndex` maps flat `TextSize` offsets into `(Line, Column)` //! representation. use std::iter; use rustc_hash::FxHashMap; use syntax::{TextRange, TextSize}; #[derive(Clone, Debug, PartialEq, Eq)] pub struct LineIndex { /// Offset the the beginning of each line, zero-based pub(crate) newlines: Vec<TextS...
use crate::geom::Point3; use crate::glam::{EulerRot, Mat4, Quat, Vec3}; use crate::math::{deg_to_rad, turns_to_rad}; /// Orientation properties for **Drawing** a **Primitive**. #[derive(Copy, Clone, Debug, PartialEq)] pub enum Properties { /// The orientation described by an angle along each axis. Axes(Vec3), ...
pub mod enums; mod header; mod parameter; use super::super::helpers; use hyper::client::Client; use hyper::client::response; use hyper::header::Headers; use hyper::client::RedirectPolicy; #[derive(Debug, Clone)] pub struct Form { ip_addr: String, port: u16, uri: String, params: Vec<parameter::Para...
// Copyright 2018-2021 Cargill Incorporated // // 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...
//! Support for visiting XPaths. use crate::axis::Axis; use crate::expression::{Expression, Step, StepTest, Predicate, SubExpression}; use crate::{LiteralValue, OwnedPrefixedName}; pub trait Visitable { fn visit(&self, visitor: &mut dyn Visitor); } impl<T: ?Sized> Visitable for Box<T> where T: Visitable, { ...
#[macro_use] extern crate clap; extern crate cotoxy; extern crate fibers; extern crate futures; #[macro_use] extern crate slog; extern crate sloggers; #[macro_use] extern crate trackable; use clap::Arg; use cotoxy::Error; use cotoxy::ProxyServerBuilder; use fibers::executor::{InPlaceExecutor, ThreadPoolExecutor}; use ...
#[derive(StructOpt, Debug)] #[structopt(name = "alfred-pinboard")] /// Command line component of Alfred Workflow for Pinboard (Written in Rust!) pub struct Opt { #[structopt(name = "debug", default_value = "0", long = "debug")] pub debug_level: i8, #[structopt(subcommand)] pub cmd: SubCommand, } #[deri...
use {localhost, sleep_ms, TryRead, TryWrite}; use mio::*; use mio::deprecated::{EventLoop, EventLoopBuilder, Handler}; use mio::net::{TcpListener, TcpStream}; use std::collections::LinkedList; use slab::Slab; use std::{io, thread}; use std::time::Duration; // Don't touch the connection slab const SERVER: Token = Token...
#![crate_type = "lib"] #![feature(try_blocks)] //#![feature(nll)] #![feature(is_sorted)] #![feature(cell_update)] #![feature(get_mut_unchecked)] #![feature(specialization)] #![feature(coerce_unsized)] #![feature(associated_type_defaults)] #![feature(generic_associated_types)] #![feature(crate_visibility_modifier)] // #...
//! A Ledger keeps track of the double-ended stack bookkeeping. //! //! ## Design //! //! * zero-based forward index //! * one-based reverse index //! * successful allocation returns a zero-based index to the first element of the allocation //! //! ## Consequences //! //! * zero-sized allocations are not permitted ...
//! Unwind information for System V ABI (s390x). use crate::isa::unwind::systemv::RegisterMappingError; use crate::machinst::{Reg, RegClass}; use gimli::{write::CommonInformationEntry, Encoding, Format, Register}; /// Creates a new s390x common information entry (CIE). pub fn create_cie() -> CommonInformationEntry { ...
use std::collections::{HashMap, HashSet}; use std::hash::{Hash, Hasher}; #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] pub struct Point(pub usize, pub usize); impl Point { fn line(&self, other: &Point) -> Line { let m = (other.1 as f64 - self.1 as f64) / (other.0 as f64 - self.0 as f...
extern crate std; use std::io; use std::io::fs::PathExtensions; use std::str; const MESSAGE_SIZE: uint = 4096; const LINE_END: u8 = '\n' as u8; #[deriving(Encodable, Decodable)] /// Result of PeekCommand, when it was successful /// Contains message and new offset to specify to peek command /// for continuous peeking...
// follow https://wiki.osdev.org/ATA_PIO_Mode use core::slice; use io::{inb, outb, inw}; use disk::Disk; // An ATA bus typically has 9 I/O ports that control its behavior. // For the primary bus, these I/O ports are 0x1F0 through 0x1F7, and 0x3F6. // The values in this table are relative to the so-called I/O port base...
// Copyright (c) The Dijets Core Contributors // SPDX-License-Identifier: Apache-2.0 use super::{JsonRpcVersion, Method}; use dijets_types::{ account_address::AccountAddress, event::EventKey, transaction::SignedTransaction, }; use serde::{Deserialize, Serialize}; use std::sync::atomic::AtomicU64; #[derive(Debug, ...
//! # Word Guesser //! //! In order to guess word as user type, //! the program needs to have 3 threads. //! One for the main thread, which shows input and output, //! one for reading user input, //! and one for processing the guesses. use guess_core::get_word_list; use std::fmt::Display; use std::io::{self, stdin, Re...
#[repr(C)] #[allow(dead_code)] #[derive(Debug, PartialOrd, PartialEq, Hash, Copy, Clone)] pub enum SimpleTypeKind { None = 0x0000, // uncharacterized type (no type) Void = 0x0003, // void NotTranslated = 0x0007, // type not translated by cvpack HResult = 0x0008, // OLE/COM HRESUL...
use proc_macro2::TokenStream as TokenStream2; use quote::ToTokens; use syn; use syn::fold::Fold; use super::codegen::Codegen; use super::config::Config; /// The scope that fold begins, i.e. the location that `#[trace2]` is placed. /// /// When we visiting a AST node marked as `#[trace2]` whose scope is smaller, the n...
// Copyright (c) 2017 Chef Software Inc. and/or applicable contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless r...
use crossbeam::channel::{bounded, Receiver, RecvError, Sender}; use std::any::Any; use thiserror::Error; #[cfg(test)] mod tests { use std::sync::{ mpsc::{channel, Receiver, Sender}, Arc, Mutex, }; use crate::{ExecutionError, SendWrapperThread}; #[test] fn test_execute_example() { ...
use std::iter::Enumerate; use geoengine_datatypes::collections::{FeatureCollection, GeometryRandomAccess}; use geoengine_datatypes::primitives::{Geometry, MultiPoint, MultiPointAccess, MultiPolygon}; use geoengine_datatypes::raster::{GridContains, GridShapeAccess}; use geoengine_datatypes::{ primitives::TimeInterv...
use super::ast::*; use std::{collections::HashMap, fmt}; pub enum ExecutionError { NoMainProc, InvalidExpressionResult { want: usize, got: usize, }, InvalidArgs { name: String, want: usize, got: usize, }, UknownValue(String), } impl fmt::Display for Exec...
// SPDX-License-Identifier: Apache-2.0 //! Global Descriptor Table init use crate::shim_stack::{init_stack_with_guard, GuardedStack}; use crate::syscall::_syscall_enter; use core::ops::Deref; use nbytes::bytes; use spinning::Lazy; use x86_64::instructions::segmentation::{load_ds, load_es, load_fs, load_gs, load_ss, s...
use crate::{ logical::{Concrete, Logical}, tcp::opaque_transport, Accept, Outbound, }; use linkerd_app_core::{ metrics, proxy::{api_resolve::Metadata, http, resolve::map_endpoint::MapEndpoint}, svc::{self, Param}, tls, transport::{self, Remote, ServerAddr}, transport_header, Addr, Co...
use io::file::FileStatus; use io::redraw::RedrawTask; use state::editor::{Buffer, BufferManager, Editor}; use edit::buffer::{TextBuffer, SplitBuffer}; use std::process::exit; /// Prompt mode commands. pub enum PromptCommand<'a> { /// Set an option. Set { /// The option to set. option: &'a str ...
use crate::error::{Error, Result}; use crate::expr::{Col, Expr}; use crate::id::QueryID; use crate::op::{Join, JoinOp, Op, OpMutVisitor, OpVisitor}; use crate::scope::Scope; use fnv::FnvHashMap; use slab::Slab; use smol_str::SmolStr; use xsql_catalog::{SchemaID, TableID}; /// QueryPlan represents a self-contained quer...
//! Consts and functions used to generate the files comprising the "tests" package when running the //! tool. use std::path::PathBuf; use once_cell::sync::Lazy; use crate::{ common::{self, CL_CONTRACT, CL_TYPES}, dependency::Dependency, ARGS, TOOLCHAIN, }; const PACKAGE_NAME: &str = "tests"; const INTE...
use super::map::MIN_LEN; use super::node::{marker, ForceResult::*, Handle, LeftOrRight::*, NodeRef}; use super::unwrap_unchecked; use core::mem; impl<'a, K: 'a, V: 'a> Handle<NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal>, marker::KV> { /// Removes a key/value-pair from the tree, and returns that pair, as ...
use crate::{BeaconForkChoiceStore, BeaconSnapshot}; use fork_choice::ForkChoice; use itertools::process_results; use slog::{info, warn, Logger}; use state_processing::state_advance::complete_state_advance; use state_processing::{per_block_processing, per_block_processing::BlockSignatureStrategy}; use std::sync::Arc; us...
/** * [149] Max Points on a Line * * Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. * * Example 1: * * * Input: [[1,1],[2,2],[3,3]] * Output: 3 * Explanation: * ^ * | * | o * | o * | o * +-------------> * 0 1 2 3 4 ...
use std::collections::HashMap; use std::hash::{Hash, Hasher}; use std::collections::hash_map::DefaultHasher; use md5; use bisect::bisect_right; pub struct ConsistentHashing<T: ToString + Hash + Clone + WithWeightInfo> { hashing_ring: HashMap<u32, T>, real_nodes: HashMap<String, T>, sorted_keys: Vec<u32>, ...
use crate::registry::Crate; use anyhow::Context as _; /// An HTTP client for interacting with crates.io pub struct Client { host: String, } impl Client { /// Create a new HTTP client with the provided host (e.g. `https://crates.io` or `http://localhost`) pub fn new(host: impl ToString) -> Self { S...
mod bus; mod error; mod formats; mod healthcheck; mod signal_safe; mod supervisor; pub use self::formats::{get_sample_service, ExitStatus, HorustConfig}; use crate::horust::bus::Bus; use crate::horust::formats::{validate, Service}; use anyhow::Result; pub use formats::Event; use libc::{prctl, PR_SET_CHILD_SUBREAPER}; ...
use std::sync::atomic::{AtomicPtr, AtomicUsize, Ordering}; use std::sync::{Arc, Mutex}; use std::{mem, slice}; pub const K_BLOCK_SIZE: usize = 4096; #[derive(Default)] pub struct ArenaInner { alloc_ptr: AtomicPtr<u8>, remaining_bytes: AtomicUsize, memory_usage: AtomicUsize, blocks: Arc<Mutex<Vec<Vec<u...
use deno_core::error::AnyError; use hyper::http::response::Parts; use hyper::service::{make_service_fn, service_fn}; use hyper::{Body, Method, Request, Response, Server, StatusCode}; use indoc::indoc; use routerify::prelude::RequestExt; use routerify::{RequestInfo, Router, RouterService}; use std::collections::HashMap;...
/*! # Clipboard Formats This module re-exports the [standard clipboard formats](https://docs.microsoft.com/en-us/windows/win32/dataxchg/standard-clipboard-formats). This module also re-exports the `CLIPBOARD_FORMATS` type from the `windows` crate. Note that clipboard format codes are essentially simple u32 constants....
#[cfg(target_arch = "x86")] use std::arch::x86::*; #[cfg(target_arch = "x86_64")] use std::arch::x86_64::*; use super::{A, str_to_bytes, bytes_len}; pub struct Bitap8x16 { v: __m128i, start_mask: __m128i } const fn get_masks(patterns: &[&str]) -> [A; 256] { // preprecessing step to associate each charact...
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
use super::hmac_sha1; use digest::generic_array::typenum::U20; use digest::generic_array::GenericArray; type OutputSize = U20; /// Generating HOTP function /// /// Step 1: Generate an HMAC-SHA-1 value Let HS = HMAC-SHA-1(K,C) // HS is a 20-byte string /// /// Step 2: Generate a 4-byte string (Dynamic Truncation) ///...
/// Memory Bus use std::io::prelude::*; use std::fs::File; use super::memory_map; use super::cartridge_types; pub struct ROM { boot_rom_data: Vec<u8>, data: Vec<u8>, rom_cartridge_type: u8, boot_rom_enabled: bool, } pub struct RAM { data: Vec<u8>, } pub struct Memory { rom: ROM, ram: RA...
#![allow(unused_attributes)] use anyhow::Result; use chrono::Local; use env_logger::fmt::Color; use futures::{future, stream::futures_unordered::FuturesUnordered, FutureExt, StreamExt}; use log::Level; use rand::Rng; use std::{ env, fs, io::{Seek, SeekFrom, Write}, path::Path, path::PathBuf, }; use pe...
use std::fs::File; use std::io::Read; use std::io::Write; use std::path::PathBuf; use crate::beam::reader::chunk; use crate::beam::reader::chunk::Chunk; use crate::beam::reader::chunk::StandardChunk; use crate::beam::reader::parts; use crate::beam::reader::BeamFile; use crate::beam::reader::RawBeamFile; use crate::bea...
use std::collections::HashSet; use std::sync::Arc; use analyzer::Analyzer; use ast::{Definition, Span, TypeAlias}; use ast::Type; use errors::{ElmError, TypeError}; use loader::Declaration; use types::Adt; use types::AdtVariant; use util::{build_fun_type, VecExt}; use util::create_vec_inv; use util::visitors::type_vis...
use crate::scene::commands::physics::SetJointConnectedBodyCommand; use crate::scene::commands::SceneCommand; use crate::sidebar::physics::joint::prismatic::PrismaticJointSection; use crate::{ gui::{BuildContext, Ui, UiMessage, UiNode}, physics::{Joint, RigidBody}, send_sync_message, sidebar::{ m...
use multihash::{ derive::Multihash, Blake2b256, Blake2b512, Blake2s128, Blake2s256, Blake3_256, Hasher, Identity256, Keccak224, Keccak256, Keccak384, Keccak512, MultihashDigest, Sha1, Sha2_256, Sha2_512, Sha3_224, Sha3_256, Sha3_384, Sha3_512, }; #[derive(Clone, Copy, Debug, Eq, Multihash, PartialEq)] #[mh...