text
stringlengths
3.09k
13.9k
//! # Rustupolis CLI //! //! A tuple space client implementation. //! Ultimately this will work offline as a self-sufficient tuple space server as well as by //! connecting to a remote tuple space server. //! // TODO list: // - input parsing loop // - processing of parsed commands #[macro_use] extern crate rustupol...
// #![deny(warnings)] use std::convert::Infallible; use hyper::service::{ make_service_fn, service_fn }; use hyper::{ Body, Method, Request, Response, Server, StatusCode }; use hyper::header::HeaderValue; use lazy_static::lazy_static; use riven::{ RiotApi, RiotApiConfig }; use riven::consts::Region; lazy_static! { ...
use std; use duktape::*; macro_rules! make_ret { ($err:ident, $ret:ident) => { pub const $ret: duk_int_t = -$err; } } macro_rules! make_increasing_sequence { ($t:ty, $val: expr) => {}; ($t:ty, $val:expr, $arg:ident) => { pub const $arg: $t = $val; }; ($t:ty, $val:expr, $arg: ...
use std::{ fs, path::{Path, PathBuf}, thread, time::{Duration, SystemTime}, }; use thiserror::Error; use super::{init_config, Config, Deserializers, Handle, RawConfig}; use crate::handle_error; /// Initializes the global logger as a log4rs logger configured via a file. /// /// Configuration is read f...
#![feature(uniform_paths, tool_lints)] #![allow(unknown_lints)] #![warn(clippy::all)] pub mod lexer; pub mod parser; #[macro_use] extern crate log; use simplelog; use structopt; #[macro_use] extern crate structopt_derive; use simplelog::Config; use simplelog::LogLevelFilter; use simplelog::TermLogger; use structopt...
use std::default::Default; use std::iter::once; use std::marker::PhantomData; use std::sync::Arc; use crypto::{SecretKey, SecretKeySet, SecretKeyShare}; use rand::{self, Rand, Rng}; use serde::{Deserialize, Serialize}; use super::{ChangeState, DynamicHoneyBadger, JoinPlan, Result, Step, VoteCounter}; use honey_badger...
mod commands; mod consume; mod data; mod publish; mod register; pub use commands::*; pub use consume::*; pub use publish::*; pub use register::*; use crate::{ backend::{Backend, Token}, data::SharedDataBridge, examples::data::ExampleData, }; use anyhow::Error; use data::CoreExampleData; use drogue_cloud_s...
use regex::Regex; use std::io::Write; use std::io; use std::process::exit; use std::iter::IntoIterator; use crate::codegen; use crate::codegen::{Codegen, IRBuilder, Module}; use crate::lexer::*; use crate::parser::*; use crate::util; use crate::target::write_asm_code; use llvm_sys_wrapper::{fn_type,LLVMFunctionType,LL...
// Built-in uses use std::time::Duration; // External uses use futures::channel::mpsc::{Receiver, Sender}; use futures::{SinkExt, StreamExt}; use tokio::{task::JoinHandle, time}; // Workspace uses use crate::eth_sender::ETHSenderRequest; use crate::mempool::MempoolRequest; use models::{node::block::PendingBlock, Action...
//! A manager of Vim plugins. #![warn(missing_docs)] #![feature(ascii_ctype)] #![feature(slice_patterns)] mod parse; mod version; pub use parse::{Flavor, Parser, ParseError}; use std::env; use std::error::Error; use std::fmt; use std::io; use std::path::{Path, PathBuf}; use std::process::{Command, ExitStatus}; /// ...
// Copyright 2020 The OctoSQL 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 agree...
use common::event_loop::{Core, CoreState, CoreTimer}; use common::types::{PeerId, PeerMsg, PlainTextMsg}; use maidsafe_utilities::serialisation::deserialise; use mio::{Poll, Ready, Token}; use mio_extras::timer::Timeout; use p2p::{msg_to_read, msg_to_send, Interface}; use socket_collection::UdpSock; use sodium::crypto:...
// Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). use std::io; use std::net::Ipv4Addr; use futures::channel::mpsc; use futures::{try_join, SinkExt, Stream, StreamExt}; use nails::execution::{stream_for, ChildInput, ChildOutput, ExitCod...
// LNP/BP Core Library implementing LNPBP specifications & standards // Written in 2019 by // Dr. <NAME> <<EMAIL>> // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to // the public domain worldwide. This software is distributed...
// This file is part of MinSQL // Copyright (c) 2019 MinIO, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later ve...
use std::{self, mem, ptr, slice, io}; use std::ops::BitAnd; use std::sync::atomic::{AtomicBool, Ordering}; use window::MouseCursor; use winapi::ctypes::wchar_t; use winapi::shared::minwindef::{BOOL, DWORD}; use winapi::shared::windef::{HWND, POINT, RECT}; use winapi::um::errhandlingapi::GetLastError; use winapi::um::w...
use vec3::{Vec3,Normalise}; // 4x4 Matrix module // Constants pub const DIM: usize = 4; // Types // If I want to add traits for this I need to use a newtype... // and then manually add all the inner type traits... // TODO wait for Rust to fix this pub type Matrix = [[f64; DIM]; DIM]; // Private functions fn zero...
use crate::{ world::{Entity, World}, Component, }; use core::marker::PhantomData; /// Provides the ability to immutably fetch a single query element. /// /// A query element can be a reference type, like `&Position` pub trait Fetch<'a>: Sized { /// Returns a single query element from the [Entity] in the [World] f...
use std::collections::HashMap; struct HNode { freq: i32, ch: Option<char>, left: Option<Box<HNode>>, right: Option<Box<HNode>>, } impl HNode { pub fn new(freq: i32, ch: Option<char>) -> Self { HNode { freq: freq, ch: ch, left: None, right: None, } } }...
//! [`ActionDiff`] event streams are minimalistic representations //! of the action state, intended for serialization and networking //! While they are less convenient to work with than the complete [`ActionState`], //! they are much smaller, and can be created from and reconstructed into [`ActionState`] //! //! N...
use std::{error::Error, io::BufRead}; use rio_api::parser::{QuadsParser, TriplesParser}; use sophia_api::{ quad::{stream::QuadSource, Quad}, term::{term_eq, CopiableTerm, CopyTerm, TTerm}, triple::{ self, stream::{StreamResult, TripleSource}, streaming_mode::{ByValue, StreamedTriple...
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ use crate::error::ErrorPrinter; use crate::visitor::Visitor; use anyhow::{anyhow, bail}; use anyhow::{Context, Result}; use cargo_metadata::{CargoOpt, Metadata}; use clap::Parser; use owo_colors::{OwoCo...
use crate::app::components::{Alert, BusyIndicator, ChatInput}; use crate::app::workers::main_worker::Request::{ ChatLoadHistory, ChatPoll, ChatSendMessage, LoadPublicUserProfileByUsername, }; use crate::app::workers::{main_worker, main_worker::MainWorker}; use devand_core::chat::ChatMessage; use devand_core::{Publi...
use std::borrow::Cow; use std::collections::HashMap; use serde::Deserialize; use serde::Serialize; use warc::BufferedBody; use warc::Record; use warc::WarcHeader; use crate::identifiers::Identification; use crate::lang::Lang; #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] /// OSCAR-specific metadata /// ...
use super::prelude::*; use crate::interface::net::NetChannelInfo; use std::os::raw::c_char; // Temp pub type EDict = c_void; #[repr(transparent)] // Temp pub struct CSteamID(u64); #[vtable] /// "VEngineServer021" /// "engine" pub struct EngineServer { pub ChangeLevel: extern "C" fn(s1: *const c_char, s2: *const c_...
use crate::extractor::FirebaseId; use anyhow::{anyhow, bail, Context}; use jsonwebtoken as jwt; use jwt::{Algorithm, DecodingKey, TokenData, Validation}; use reqwest::{header, Response}; use serde::Deserialize; use std::{ sync::Arc, time::{Duration, Instant}, }; use tokio::{sync::RwLock, task::JoinHandle}; #[d...
use std::{error::Error, fs, time::SystemTime}; use padlock_blockchain::block::Block; use padlock_blockchain::block::BlockHeader; use padlock_blockchain::block::Entry; use padlock_blockchain::block::MempoolEntry; use padlock_blockchain::Blockchain; use bls_signatures::{PrivateKey, Serialize}; use rand::{rngs::OsRng, R...
use std::collections::{BTreeMap, BTreeSet}; use cardano_multiplatform_lib::{utils::ScriptHashNamespace, RequiredSignersSet}; use entity::{ prelude::*, sea_orm::{prelude::*, Condition, DatabaseTransaction, Set}, }; use pallas::ledger::primitives::alonzo::{self, TransactionBodyComponent}; use crate::{dsl::defau...
// Full list of MCCS v2.2a VCP codes. #[repr(u8)] pub enum PresetOperation { CodePage = 0x00, RestoreFactoryColorDefaults = 0x08, RestoreFactoryDefaults = 0x04, RestoreFactoryGeometryDefaults = 0x06, RestoreFactoryLuminanceContrastDefaults = 0x05, RestoreFactoryTvDefaults = 0x0a, SaveRestor...
// SPDX-License-Identifier: MIT use futures::stream::StreamExt; use crate::{ packet::{ tc::{constants::*, nlas}, NetlinkMessage, RtnlMessage, TcMessage, NLM_F_ACK, NLM_F_REQUEST, TC_H_MAKE, }, try_nl, Error, Handle, }; pub struct QDiscNewReq...
// "Tifflin" Kernel // - By <NAME> (thePowersGang) // // arch/amd64/acpi/mod.rs //! ACPI (Advanced Control and Power Interface) handling code //! //! Provides access to the ACPI tables #[allow(unused_imports)] use prelude::*; module_define!{ACPI, [], init} #[cfg_attr(any(use_acpica,feature="acpica"), path="acpica/mod...
use super::*; use std::fmt::Debug; use std::ops::Add; fn test_empty<T: Array<i32>>(mut arr: T) { assert_eq!(arr.len(), 0); assert_eq!(arr.is_empty(), true); assert_eq!(arr.first(), None); assert_eq!(arr.first_mut(), None); assert_eq!(arr.last(), None); assert_eq!(arr.last_mut(), None); asse...
use crate::{ key::Key, request::{Request, RequestBuckets}, worker::QueueHandle, }; use rayon::prelude::*; use std::{ collections::{HashMap, HashSet}, marker::PhantomData, sync::Arc, }; use tokio::runtime::Handle; /// A type-state control flow for driving tasks from assignment to completion. As task assignm...
use super::BlockType; use std::convert::From; pub trait Type {} #[derive(Copy, Clone, Debug)] pub enum ValueType { None = 0, Any = 1, I32 = 2, I64 = 3, F32 = 4, F64 = 5, V128 = 6, AnyRef = 7, AnyFunc = 8, NullRef = 9, } impl Default for ValueType { fn default() -> Self { ...
use crate::{file, PartialName}; use std::{ convert::TryInto, io::{self, Read}, path::{Path, PathBuf}, }; enum Transform { EnforceRefsPrefix, None, } impl file::Store { /// Find a single reference by the given `path` which is required to be a valid reference name. /// /// Returns `Ok(No...
use crate::paste::PasteType; use actix_web::{error, Error as ActixError}; use glob::glob; use lazy_regex::{lazy_regex, Lazy, Regex}; use ring::digest::{Context, SHA256}; use std::io::{BufReader, Read}; use std::path::{Path, PathBuf}; use std::time::Duration; use std::time::{SystemTime, UNIX_EPOCH}; /// Regex for match...
//! Asynchronous HTTP client implementation sending instances of [KrakenInput] to the Kraken servers use hyper::body; use hyper::client::HttpConnector; use hyper::header::{CONTENT_TYPE, USER_AGENT}; use hyper::{Body, Client, Request}; use hyper_tls::HttpsConnector; use serde::de::DeserializeOwned; use super::auth::Kra...
use crate::blocks::get_timeout; use crate::blocks::tokens::gather_inputs; use crate::blocks::tokens::var_to_tokens; use crate::blocks::ContractUser; use crate::blocks::{ContractData, EthData, NodeData}; use crate::blocks::{CONTRACT_TYPE, CONTRACT_VAR, NODE_TYPE}; use chainblocks::block::Block; use chainblocks::cblog; u...
use bevy::{input::mouse::MouseMotion, prelude::*}; #[derive(Component)] pub struct FlyCamera { pub accel: f32, pub max_speed: f32, pub sensitivity: f32, pub friction: f32, pub yaw_pitch: Option<(f32, f32)>, pub velocity: Vec3, pub key_forward: KeyCode, pub key_backward: KeyCode, pub key_left: KeyCode, pub k...
use std::path::PathBuf; use std::sync::{Arc, Mutex}; use std::time::Duration; use scoped_pool::Pool; use wgpu::BufferUsage; use zerocopy::AsBytes; use std::sync::mpsc::Sender; use crate::gui::GuiProgram; use crate::ui::align::Anchor; pub fn render( gui: &mut GuiProgram, frame: &wgpu::SwapChainOutput, dev...
use std::collections::BTreeMap; use ::value::Value; use vrl::prelude::*; #[derive(Clone, Copy, Debug)] pub struct TagTypesExternally; impl Function for TagTypesExternally { fn identifier(&self) -> &'static str { "tag_types_externally" } fn examples(&self) -> &'static [Example] { &[ ...
#![no_std] #![no_main] // pick a panicking behavior extern crate panic_halt; // you can put a breakpoint on `rust_begin_unwind` to catch panics // extern crate panic_abort; // requires nightly // extern crate panic_itm; // logs messages over ITM; requires ITM support ...
use parking_lot::RwLock; use rand::{thread_rng, RngCore}; use rayon::iter::ParallelIterator; use crate::memory_data_size::*; use std::cmp::{max, min}; use std::io::Write; use std::marker::PhantomData; use std::mem::{size_of, swap}; use std::path::PathBuf; pub trait BucketType: Send { type InitType: ?Sized; ty...
use std::collections::{HashSet, VecDeque}; use std::mem; use std::path::PathBuf; use std::pin::Pin; use anyhow::{anyhow, Result}; use derive_getters::Getters; use futures::{ stream::FuturesUnordered, task::{Context, Poll}, Future, Stream, }; use indicatif::ProgressBar; use serde::{Deserialize, Serialize}; ...
// Copyright 2020 <NAME> <<EMAIL>> // // 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 std::fmt; use crate::{ Buffer, ParseError, err::{perr, ParseErrorKind::*}, parse::{end_dec_digits, first_byte_or_empty}, }; /// A floating point literal, e.g. `3.14`, `8.`, `135e12`, `27f32` or `1.956e2f64`. /// /// This kind of literal has several forms, but generally consists of a main /// number ...
// Copyright 2020 <NAME> <<EMAIL>> // // This file is part of conec. // // Licensed under the Apache License, Version 2.0 (see // LICENSE or https://www.apache.org/licenses/LICENSE-2.0). // This file may not be copied, modified, or distributed // except according to those terms. use super::{ControlMsg, CtrlStream, Ctr...
// Copyright (c) 2018 10x Genomics, Inc. All rights reserved. use std::sync::Arc; use std::collections::HashMap; use boomphf::hashmap::{BoomHashMap2, NoKeyBoomHashMap}; use config::{KmerType, MEM_SIZE, REPORT_ALL_KMER, STRANDED}; use debruijn; use debruijn::compression::*; use debruijn::dna_string::{DnaString, DnaStr...
use std::collections::HashMap; /// Node of the graph. /// /// `id` - unique identifier /// `data` (optional) - data of some type pub struct Node<T> { id: usize, pub data: Option<T>, } impl<T> Node<T> { /// Gets an *id* of the node /// pub fn id(&self) -> usize { self.id } } /// Edge ...
fn main() { for test_file in ["2021-12-21.sample.txt", "2021-12-21.txt"] { println!("------------------ {} ------------------", test_file); let test_path = advent_of_code::env::get_puzzle_input_path(test_file); let (p1, p2) = parse_puzzle_input(&std::fs::read_to_string(&test_path).unwrap());...
/*! This crate provides a bitmatrix based on [bitvec](https://docs.rs/bitvec), akin to [bit-matrix](https://docs.rs/bit-matrix) which is based on [bit-vec](https://docs.rs/bit-vec). Access can be done through the `Index<usize>`, `Index<(usize, usize)>` and `IndexMut<usize>` traits. As the `IndexMut` trait is incompati...
//! Deserialization use encoding::Encoding; use java_properties::LineContent::{Comment, KVPair}; use java_properties::PropertiesIter; use serde::de::{self, IntoDeserializer, MapAccess, Visitor}; use serde::forward_to_deserialize_any; use std::fmt; use std::io; use std::num::{ParseFloatError, ParseIntError}; use std::s...
//! Internal macros for the Varisat SAT solver. #![recursion_limit = "128"] use std::fmt::Write; use proc_macro2::TokenStream; use quote::quote; use syn::{ parse_quote, punctuated::Punctuated, Attribute, Fields, Ident, Lit, LitStr, Meta, MetaNameValue, Token, }; use synstructure::decl_derive; /// Get the doc ...
use model::anyvalue::AnyValue; use model::missing::Missing; use model::value::Value; use model::variable::Variable; use readstat::bindings::*; use readstat::context::Context; use chrono::naive::NaiveDateTime; use std::collections::HashMap; use std::ffi::CStr; use std::os::raw::{c_char, c_double, c_int, c_void}; us...
use std::sync::atomic::Ordering::{Acquire, Release, Relaxed}; use std::sync::atomic::{AtomicBool, AtomicUsize}; use std::fmt; use std::{ptr, mem}; use std::cmp; use std::cell::UnsafeCell; use mem::epoch::{self, Atomic, Owned}; const SEG_SIZE: usize = 32; /// A Michael-Scott queue that allocates "segments" (arrays of...
// Copyright (c) 2015 Hewlett-Packard Development Company, L.P. // // 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 b...
use codec::{Decode, Encode}; use frame_metadata::StorageHasher; use jsonrpsee::{ http_client::{HttpClient, HttpClientBuilder}, types::{to_json_value, traits::Client, DeserializeOwned, Error as RpcError, JsonValue}, ws_client::{WsClient, WsClientBuilder}, }; use sp_core::{ storage::{StorageData, StorageKey}, Bytes,...
use proc_macro::TokenStream; use quote::quote; use syn::spanned::Spanned; use syn::{parse_macro_input, Data, DataEnum, DeriveInput, Fields}; /* See the documentation in the parse-variants crate on how to use the macro. Here is a quick example for how the generated code looks. We apply the macro to this enum: ...
use crate::import_map::{ImportHashMap, ImportMap}; use indexmap::IndexSet; use path_slash::PathBufExt; use regex::Regex; use relative_path::RelativePath; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, path::PathBuf, str::FromStr}; use url::Url; #[derive(Clone, Debug, Eq, PartialEq, Serialize)] #[...
use core::{ convert::{From, TryFrom}, fmt, iter::Iterator, result::Result, }; use crate::{ codec::{self, Decodable, Encodable}, error::{DecodeError, EncodeError}, qos, status::Status, }; pub struct Iter<'a> { offset: usize, sub: &'a Subscribe<'a>, } impl<'a> Iter<'a> { fn ...
mod create_table; mod drop_table; mod insert; mod nothing; mod projection; mod scan; use self::nothing::Nothing; use self::projection::Projection; use self::scan::Scan; use super::ast::{self, ColumnSpec, Statement}; use super::expression::Expression; use super::schema::{Column, Table}; use super::storage::Storage; use...
use crate::{ device::Queue, image::ImageAbstract, physical_device::QueueFamily, sync::{GpuFuture, Semaphore}, }; pub use ash::vk::CompositeAlphaFlagsKHR as CompositeAlphaFlags; use std::sync::Mutex; use crate::{ device::Device, image::Format, surface::{ColorSpace, PresentMode, Surface, SurfaceTransformFlags}, ...
extern crate monorail; extern crate term; use monorail::action::Move; use monorail::board::Board; use monorail::player::Player; use std::env; use std::io; #[derive(Copy, Clone, Debug)] enum GameResult { JunSeokWin, YeonSeungWin, } impl GameResult { fn win_for(&self, p: Player) -> bool { match (*s...
// Copyright 2021 The piet-gpu 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
use super::child_struct::ByteIndexable; use super::http::Method; use super::node::{Node, NodeKind}; use regex::Regex; use wasm_bindgen::prelude::*; const OPTIONAL_PARAM_REGEXP: &str = r"(/:[^/()]*?)\?(/?)"; #[wasm_bindgen] #[derive(Debug)] pub struct Router { default_route: Option<String>, on_bad_url: Option<...
use quoted_string; use internals::grammar::is_atext; use internals::grammar::encoded_word::EncodedWordContext; use internals::error::{EncodingError, EncodingErrorKind}; use internals::encoder::{EncodingWriter, EncodableInHeader}; use internals::bind::encoded_word::{EncodedWordEncoding, WriterWrapper}; use internals::b...
use crate::{MsgType, ProtoFamily}; use nftnl_sys::{self as sys, libc}; use std::{ convert::TryFrom, ffi::{c_void, CStr, CString}, fmt::Debug, os::raw::c_char, }; use tracing::error; /// Abstraction of `nftnl_table`. The top level container in netfilter. A table has a protocol /// family and contain [`C...
// MIT License // Copyright (c) 2018 <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, p...
pub mod model; pub mod scene; use std::{cell::RefCell, ffi::CString, path::PathBuf, rc::Rc, time::Instant}; use env_logger::Env; use katla_math::Vec3; use katla_vulkan::VulkanRenderer; pub use model::*; pub use scene::*; use winit::{event::VirtualKeyCode, event_loop::EventLoop}; use crate::{ cameracontroller, ca...
use std::fmt::Debug; use syn::{braced, parse::Parse, punctuated::Punctuated, spanned::Spanned, Error, LitStr, Token}; use super::kw; pub struct Packages { pub packages_kw: kw::packages, pub packages: Vec<Package>, } impl Parse for Packages { fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> ...
//! CDC-ACM serial port example using cortex-m-rtfm. #![no_main] #![no_std] #![allow(non_snake_case)] #![allow(dead_code)] #![allow(unused_imports)] use core::{ panic::PanicInfo, sync::atomic::{self, Ordering}, str::from_utf8_unchecked, ptr::{ read_volatile, write_volatile, }, c...
use crate::file_fns; use file_fns::*; pub const ARG_HELP: &'static [&'static str] = &["-h", "-v", "--help", "--version"]; pub const ARG_MERGE: &'static [&'static str] = &["-m", "--merge"]; pub const ARG_OVERWRITE: &'static [&'static str] = &["-n", "--no-bup"]; pub const ARG_RENEWLOGS: &'static [&'static str] = &...
use crate::{ client::{self, upload::internal::DocumentMetadata, AuthorizedClient, GeneralErrHandler}, errors::{ErrorKind, Result}, }; use failure::Fail; use hex; use log::debug; use mime::*; use mime_multipart::{write_multipart, FilePart, Node, Part}; use reqwest::{blocking::Response, header, StatusCode}; use ...
//! The implementation of the SP804 Dual Timer driver. use r3::kernel::{cfg::CfgBuilder, InterruptHandler, InterruptLine, Kernel, PortToKernel, UTicks}; use r3_portkit::tickless::{TicklessCfg, TicklessStateTrait}; use crate::sp804::{cfg::Sp804Options, sp804_regs}; /// Implemented on a system type by [`use_sp804!`]. /...
// 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. //! fuchsia.IO Utility library //! //! Also, IOU a more complete set of typesafe wrappers around fuchsia.io. use { fidl::endpoints::ServerEnd, fid...
use crate::sys::exports::{ExportError, Exportable}; use crate::sys::externals::Extern; use crate::sys::store::Store; use crate::sys::types::{Val, ValFuncRef}; use crate::sys::RuntimeError; use crate::sys::TableType; use std::sync::Arc; use wasmer_engine::Export; use wasmer_vm::{Table as RuntimeTable, TableElement, VMTa...
use crate::{ physics::{PhysicsEvents, PhysicsState}, TestbedGraphics, }; use plugin::HarnessPlugin; use rapier::dynamics::{CCDSolver, IntegrationParameters, IslandManager, JointSet, RigidBodySet}; use rapier::geometry::{BroadPhase, ColliderSet, NarrowPhase}; use rapier::math::Vector; use rapier::pipeline::{Chan...
use crate::voxel_map::VoxelMap; use bevy_utilities::{bevy::tasks::ComputeTaskPool, noise::generate_noise_chunks}; use building_blocks::{ mesh::{ greedy_quads, padded_greedy_quads_chunk_extent, GreedyQuadsBuffer, IsOpaque, MergeVoxel, PosNormMesh, RIGHT_HANDED_Y_UP_CONFIG, }, prelude::*, ...
use crate::config::PrevNextDaySkipWeekends; use crate::icons::*; use chrono::prelude::*; use gtk::prelude::*; use relm::Widget; use relm_derive::{widget, Msg}; #[derive(Msg)] pub enum DatePickerMsg { ButtonClicked, DayClicked, MonthChanged, NextDay, PreviousDay, DayPicked(Date<Local>), Prev...
use pyo3::prelude::*; use serde::{ de::{Error, MapAccess, SeqAccess, Visitor}, Deserialize, Deserializer, }; use std::cmp::PartialEq; use std::fmt; /** * PriceSize * Eq PartialEq, when price and size are equal * Ord, Ordered by price field */ #[pyclass] #[derive(Debug, Copy, Clone)] pub struct PriceSize {...
use super::fma::fmadd_pd; use super::intrinsics::*; pub(crate) unsafe fn dgemm_ukr_8x4( k: usize, alpha: f64, pa: *const f64, pb: *const f64, beta: f64, c: *mut f64, ldc: usize, ) { let mut mt00 = _mm256_setzero_pd(); let mut mt01 = _mm256_setzero_pd(); let mut mt02 = _mm256_set...
use crate::sqlite::{DefaultType, Type}; use crate::sqlx_types::{sqlite::SqliteRow, Row}; use sea_query::{ foreign_key::ForeignKeyAction as SeaQueryForeignKeyAction, Alias, Index, IndexCreateStatement, }; use std::num::ParseIntError; /// An SQLite column definition #[derive(Debug, PartialEq, Clone)] pub struct Colu...
use super::Context; use crate::swcify::Swcify; use swc_ecma_ast::{ClassMember, Function, MethodKind, ParamOrTsParamProp, TsExprWithTypeArgs}; use swc_estree_ast::{ ClassBody, ClassBodyEl, ClassImpl, ClassMethodKind, TSExpressionWithTypeArguments, }; impl Swcify for ClassBody { type Output = Vec<ClassMember>; ...
// Copyright 2015 The Gfx-rs Developers. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
pub mod data; pub mod error_format; pub mod interpreter; pub mod linter; pub mod parser; pub use interpreter::components::load_components; pub use parser::step_checksum::get_step; use interpreter::{interpret_scope, json_to_literal}; use parser::parse_flow; use data::ast::{Expr, Flow, InstructionScope, Interval}; use...
use std::fs; use mod_exp::mod_exp; use regex::Regex; struct Deck { count: i128, } #[derive(Copy, Clone)] enum Technique { DealIntoNewStack, CutNCards(i128), DealWithIncrement(i128), } impl Deck { fn new(count: i128) -> Self { Deck { count } } fn shuffle(&self, input: &str, card:...
// Test for parametrisation on the number of roles use rand::{thread_rng, Rng}; use mpstthree::binary::struct_trait::{end::End, recv::Recv, send::Send, session::Session}; use mpstthree::role::broadcast::RoleBroadcast; use mpstthree::role::end::RoleEnd; use mpstthree::{bundle_impl, choose_mpst_create_multi_to_all, offe...
use super::ParseMention; use std::{iter::Iterator, marker::PhantomData, str::CharIndices}; /// Iterator of mentions within a buffer. /// /// Unlike when parsing a mention directly via [`ParseMention::parse`], /// incomplete mentions - such as when a "<" is found but not valid trailing /// mention syntax - will not res...
// Copyright 2021 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::{ Context, DaemonServiceProvider, FidlService, NameToStreamHandlerMap, ServiceRegister, StreamHandler, }, anyhow::...
use crate::utils::ParseError; use pathfinding::prelude::*; use std::cmp::max; use std::collections::{HashMap, HashSet}; use std::fmt::{Display, Write}; use std::str::FromStr; type Coords = (i64, i64); #[derive(Debug, PartialEq, Clone)] pub enum Tile { Floor, Wall, Entry, Key(char), Door(char), } ...
use super::{completion::*, *}; use ::libs::{fxhash::FxHashMap as HashMap, parking_lot::RwLock}; use lsp_types::{TextDocumentContentChangeEvent, Url}; use ogma::lang::{ast::Tag, Definitions}; use std::{collections::VecDeque, sync::Arc}; type Version = i32; type ChgList = Vec<TextDocumentContentChangeEvent>; /// Docume...
//! Exercises load balancers with mocked services. use futures::{future, stream, Async, Future, Poll, Stream}; use hdrhistogram::Histogram; use rand::{self, Rng}; use std::time::{Duration, Instant}; use tokio::{runtime, timer}; use tower::{ discover::{Change, Discover}, limit::concurrency::ConcurrencyLimit, ...
use std::pin::Pin; use std::task::{Context, Poll}; use std::time::{Duration, Instant}; use crate::future::Future; use crate::stream::Stream; use futures_timer::Delay; /// Creates a new stream that yields at a set interval. /// /// The stream first yields after `dur`, and continues to yield every /// `dur` after that....
use crate::types::*; use crate::env::{Environment, EmptyEnvironment}; use ic_cdk::export::Principal; use std::collections::HashMap; /// Implements the Basic DAO interface pub struct BasicDaoService { pub env: Box<dyn Environment>, pub accounts: HashMap<Principal, Tokens>, pub proposals: HashMap<u64, Propo...
use automata::{M, State, StateSet, TRAP_STATE}; use std::collections::BTreeSet; pub fn stateset_name(states: &StateSet) -> String { let states_vec: Vec<State> = states.iter().cloned().collect(); states_vec.join("-") } pub fn lambda_closure(q: &StateSet, m: &M) -> StateSet { let mut closure: StateSet = q...
//#![feature(collections)] //! Simple [libtecla](http://www.astro.caltech.edu/~mcs/tecla/libtecla.html) wrapper. extern crate libc; use libc::{c_char, c_int, size_t}; use std::ffi::{CString, CStr}; use std::string::ToString; use std::str::from_utf8_unchecked; use std::ptr; pub type CplMatchFn = fn(*mut WordCompletio...
use super::{PosNormMesh, PosNormTexMesh}; use building_blocks_core::{ axis::{Axis3Permutation, SignedAxis3}, prelude::*, }; /// Metadata that's used to aid in the geometric calculations for one of the 6 possible cube faces. #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct OrientedCubeFace { /// Det...
use crate::config::Config; use crate::error::{Result, UdfsError}; use crate::proto; use crate::proto::client_protocol_client::ClientProtocolClient; use crate::utils::proto_utils; use prost::Message; use tokio::fs::{File, OpenOptions}; use tokio::io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt, BufStream, SeekFrom}; us...
use crate::Field; use std::fmt::{self, Display}; /// Object types represent concrete instantiations of sets of fields. /// /// The introspection types (e.g. `__Type`, `__Field`, etc) are examples of /// objects. /// /// *ObjectTypeDefinition*: /// Description<sub>opt</sub> **type** Name ImplementsInterfaces<sub>opt...
//! The syntax of the language, unchecked and with implicit parts that need to //! be elaborated in a type-directed way during type checking and inference use codespan::ByteSpan; use moniker::{Binder, Embed, Nest, Scope, Var}; use std::fmt; use std::ops; use std::rc::Rc; use syntax::pretty::{self, ToDoc}; use syntax:...