text
stringlengths
3.09k
13.9k
// Import iced modules. use iced::{ Align, Column, Container, Element, Length, Sandbox, Settings, Text, }; // Import iced_audio modules. use iced_audio::{ h_slider, knob, tick_marks, v_slider, xy_pad, FloatRange, FreqRange, HSlider, IntRange, Knob, LogDBRange, Normal, VSlider, XYPad, }; // The message when...
// Copyright 2017 PingCAP, 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 // // Unless required by applicable law or agreed to i...
// Copyright (c) 2016-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 // // Unl...
use std::collections::*; // TODO: see if these `cfg`s can be avoided/merged #[cfg(target_arch = "wasm32")] use collect_mac::*; #[cfg(target_arch = "wasm32")] use futures::future::*; #[cfg(target_arch = "wasm32")] use js_sys::*; #[cfg(target_arch = "wasm32")] use std::cell::RefCell; #[cfg(target_arch = "wasm32")] use s...
use bytes::{BufMut, ByteOrder, BytesMut}; use std::borrow::Cow; use nom::{IResult, be_i16, be_i32, be_i64}; use errors::Result; use protocol::{parse_opt_string, parse_response_header, parse_string, ApiVersion, Encodable, ErrorCode, Offset, ParseTag, PartitionId, Record, RequestHeader, ResponseHeader, W...
use colored::*; use sqlparser::dialect::MySqlDialect; use std::{ borrow::Cow::{self, Borrowed, Owned}, collections::{HashMap, HashSet}, }; use crate::mysql::Session; use super::highlight::{MonoKaiSchema, SQLHighLight, Schema}; use rustyline::completion::{Completer, Pair}; use rustyline::config::OutputStreamTy...
use core::iter; use std::borrow::Cow; use crate::Error; /// This is an extension trait that adds the below method to `bool`. /// Those methods are already planned for the standard library, but are not /// stable at the time of writing this comment. /// /// The current status can be seen here: /// <https://github.com/...
use log::{info, error, debug}; use image; use node_crunch::{NCServer, NCJobStatus, NCConfiguration, NCError, Array2DChunk, ChunkList, ChunkData, NodeID, NCServerStarter}; use crate::{RayTracer1Opt, ServerData, NodeData}; /// This contains teh final image and the list of chunks #[derive(Debug, Clone)] struct RayT...
#![allow(clippy::many_single_char_names)] pub trait Float: Copy { fn abs(self) -> Self; fn sqrt(self) -> Self; } impl Float for f64 { #[inline] fn abs(self: f64) -> f64 { f64::from_bits(self.to_bits() & (core::u64::MAX / 2)) } fn sqrt(self: f64) -> f64 { #[cfg(target_feature =...
use core::{ cell::{Cell, UnsafeCell}, future::Future, mem::MaybeUninit, pin::Pin, sync::atomic::{self, AtomicBool, Ordering}, task::{Context, Poll, RawWaker, RawWakerVTable, Waker}, }; use heapless::Vec; use pin_utils::pin_mut; use crate::{alloc::Alloc, NTASKS}; /// A single-threaded executor...
use crate::config::HOST; use reqwest; use skat::card::Card; use yew::prelude::*; pub struct PlayerView { hand: [Option<Card>; 10], game_id: u32, player_id: u32, name: String, link: ComponentLink<Self>, } pub enum Msg { NewGame(Result<u32, reqwest::Error>), NewGameRequest, JoinGame(Resu...
//! Crate that wraps the `sendfile` system call. //! //! To create a new [`SendFile`] [`Future`] see [`send_file`]. #![warn( anonymous_parameters, bare_trait_objects, missing_debug_implementations, missing_docs, rust_2018_idioms, trivial_casts, trivial_numeric_casts, unused_extern_crate...
use std::str::FromStr; use syn::{GenericArgument, Generics, PathArguments, Type, TypePath}; use ts_json_subset::{ ident::StrictTSIdent, types::{ PrimaryType, PropertyName, PropertySignature, TsType, TypeArguments, TypeMember, TypeReference, }, }; use crate::{ contexts::exporter::Export...
mod attention_descriptor; mod seq_data_axis; mod seq_data_descriptor; pub use attention_descriptor::*; pub use seq_data_axis::*; pub use seq_data_descriptor::*; use crate::{sys, CudnnContext, CudnnError, DataType, IntoResult}; use cust::memory::GpuBuffer; use std::mem::MaybeUninit; impl CudnnContext { /// This f...
use crate::capture::*; use crate::data::*; use crate::resource::battle_history; use crate::scene::*; /// スマブラを管理するコントローラークラス pub struct SmashBrogEngine { scene_manager: SceneManager, prev_saved_time: std::time::Instant, prev_find_chara_list: Vec<String>, data_latest_10: Vec<SmashbrosData>...
use crate::messages::receiver::ReceiverState; use crate::messages::ack_nack::AckNack; use crate::messages::data::Data; use crate::messages::gap::Gap; use crate::messages::heartbeat::Heartbeat; use crate::messages::heartbeat_frag::HeartbeatFrag; use crate::messages::nack_frag::NackFrag; use crate::messages::submessage::...
#![no_std] #[deprecated( since = "0.13.0", note = "`atsamd_hal::hal` is deprecated and will be removed in a future release. \ Use `atsamd_hal::ehal` instead" )] pub use embedded_hal as hal; pub use embedded_hal as ehal; pub use paste; pub mod typelevel; #[cfg(not(any(feature = "library", feature = "devi...
extern crate mqtt; extern crate native_tls; extern crate serde; extern crate serde_json; extern crate uuid; extern crate raiot_types; extern crate raiot_codec; use raiot_codec::iot_codec::IotCodec; use serde_json::Value; use std::collections::HashMap; use native_tls::{TlsStream}; use std::error::Error; use std::fmt; u...
use super::{Private, Public}; use crate::Vec; use ark_crypto_primitives::{crh::CRHGadget, CRH}; use ark_ff::fields::PrimeField; use ark_r1cs_std::{fields::fp::FpVar, prelude::*}; use ark_relations::r1cs::{Namespace, SynthesisError}; use ark_std::marker::PhantomData; use core::borrow::Borrow; #[derive(Clone)] pub struc...
use std::os::unix::io::RawFd; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::Sender; use std::sync::{Arc, Mutex}; use std::thread; use super::super::super::legacy::Gic; use super::super::Queue as VirtQueue; use super::super::VIRTIO_MMIO_INT_VRING; use super::muxer::{push_packet, MuxerRx, ProxyMap...
use super::packet; use super::link; use super::engine; use super::lib; use super::header as hdr; use super::ethernet; use super::ethernet::Ethernet; use super::ipv4; use super::ipv4::IPv4; use super::tcp::TCP; use super::udp::UDP; use std::cmp; // Checksum app: offload checksum computation // // Recei...
use crate::vault::Secret; use cfg_if::cfg_if; use serde::{Deserialize, Serialize}; use zeroize::Zeroize; /// Curve25519 private key length. pub const CURVE25519_SECRET_LENGTH: usize = 32; /// Curve25519 public key length. pub const CURVE25519_PUBLIC_LENGTH: usize = 32; /// AES256 private key length. pub const AES256_S...
use std::io; use std::ops::{DerefMut, Range}; use std::sync::Mutex; use bytemuck::{bytes_of, bytes_of_mut}; use read_write_at::ReadAtMut; bitflags::bitflags! { #[derive(Default)] #[repr(transparent)] pub struct MemoryFlags : u32 { const NONE = 0; const READ = 0x00000001; ...
include!(concat!(env!("OUT_DIR"), "/data.rs")); pub mod constants; pub mod lexer; pub mod strings; use constants::*; use std::collections::{BTreeMap, HashMap}; use std::string::String; use strings::*; fn to_hiragana(input: &str) -> String { match (is_katakana(&input), is_hiragana(&input), is_romaji(&input)) { ...
use pumice::error::PumiceResult; use pumice::winit::{self, DeviceEvent, ElementState, Event, VirtualKeyCode, WindowEvent}; use pumice::GraphicsContext; extern crate rand; use rand::prelude::*; const BIRD_WIDTH: f32 = 0.195; const BIRD_HEIGHT: f32 = 0.135; const PIPE_WIDTH: f32 = 0.3; const PIPE_HEIGHT: f32 = 3.5; co...
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use heck::ToSnakeCase; use proc_macro::TokenStream; use proc_macro2::{Span, TokenStream as TokenStream2, TokenTree}; use quote::{format_ident, quote, quote_spanned}; use syn::{ ...
use std::cmp::{max, min}; use bytesize::MIB; use open_metrics_client::metrics::counter::Counter; use open_metrics_client::metrics::gauge::Gauge; use open_metrics_client::metrics::histogram::Histogram; use open_metrics_client::registry::Registry; #[derive(Clone)] pub struct VmPoolMetrics { pool_size: Gauge, pu...
use std::fmt::{Display, Formatter}; use Language::*; use crate::cache::WordIndex; use crate::{SecretIndices, WordAsCharVec}; pub type Word = Vec<char>; pub struct Words { lang: Language, secret_cnt: usize, words: Vec<Word>, } impl Words { pub fn new(lang: Language) -> Self { const USE_FULL_W...
use crate::gpu::palette::{ColorSpace, text_palette}; use crate::gpu::palette::ColorSpace::RGB; const DEBUG_DAC: bool = false; #[derive(Clone)] pub struct DAC { /// DAC bits, usually 6 or 8 bits: u8, pub pel_mask: u8, /// color component for next out 03c9, 0 = red, 1 = green, 2 = blue pub pel_ind...
use settings::AppSettings; use sidebar::Sidebar; use signature_stylesheet::SignatureStylesheet; use wasm_bindgen::closure::Closure; use workspace::WorkspaceView; use yew::prelude::*; use crate::{ components::{ icon::{Icon, IconSize}, panzoom::PanZoom, settings::Settings, toast::{Toa...
// Copyright (c) 2022, Mysten Labs, Inc. // SPDX-License-Identifier: Apache-2.0 use std::path::Path; use anyhow::anyhow; use async_trait::async_trait; use ed25519_dalek::ed25519::signature::Signature; use jsonrpsee::core::RpcResult; use move_core_types::identifier::Identifier; use tracing::debug; use sui_core::gatew...
use models::errors::CountModelError; use models::ngram_model::NGramModel; use models::sigma::{Sigma, NGramExt}; use models::text_model::TextModel; use smoothing::{smoothing, SmoothingType}; use std::collections::HashMap; /// Hold ngram occurence models of various length pub struct CountModel { max_ngram_length: us...
//! # onedrive-api //! //! `onedrive-api` crate provides middle-level HTTP APIs [`OneDrive`][one_drive] to the //! [OneDrive][ms_onedrive] API through [Microsoft Graph][ms_graph], and also [`Auth`][auth] //! with utilities for OAuth2. //! //! ## Example //! ``` //! use onedrive_api::{OneDrive, FileName, DriveLocation, ...
//! A driver for the LIS3DSH accelerometer //! //! This crate provides implementations using either the SPI and I2C interface, //! with a simplified interface abstrcting away the serial port being used. //! The `embedded_hal` crate is used to define the interface to both serial //! buses. #![no_std] pub mod interface...
use winit::VirtualKeyCode; use crate::input::EventController; use crate::{Vec3F, Mat4F}; /// A simple flight through camera. /// /// This camera is mainly modified from https://learnopengl.com. pub struct FlightCamera { /// Camera position. pos : Vec3F, /// Front direction. front: Vec3F, /// U...
use super::{ Error, CpError }; use super::super::asn1_der; use super::super::asn1_der::{ FromDerObject, IntoDerObject }; use super::libsodium; pub trait AuthEnc { /// Seals the data using the specified key and returns `Ok(encrypted_data_length)` on success or /// an error on error fn seal(&self, data_buffer: &mut[u...
use std::collections::{HashMap, VecDeque}; struct InternalCell<'a, T> { value: T, compute_func: Option<Box<dyn Fn(&[T]) -> T>>, deps: Vec<CellID>, callbacks: HashMap<CallbackID, Box<dyn FnMut(T) -> () + 'a>>, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub struct InputCellID(usize); #[derive...
//! The Client Table Interface //! //! This module contains items used for defining pubsub tables, which //! are the primary way of specifying the topics that the client is //! interested in publishing or subscribing to. //! //! Each client may define their own table of publish and subscribe topics, //! or may use a ta...
use secp256k1::{All, Context, Secp256k1, Signing}; use serde_json::{from_reader, json, Map, Value}; use std::{env, fs::File, rc::Rc}; use terra_rust_api::{errors::TerraRustAPIError, GasOptions, PrivateKey, Terra}; use crate::error::TerraRustScriptError; pub type Wallet<'a> = &'a Rc<Sender<All>>; pub struct Sender<C:...
use std::net::SocketAddr; use std::time::{Duration, SystemTime}; use anyhow::{Result}; use serde::{Serialize, Deserialize}; use std::cmp::Ordering; use std::collections::HashSet; use std::ops::Sub; use std::alloc::System; use rand::prelude::*; use uuid::Uuid; #[derive(Serialize, Deserialize, Debug)] pub struct Appeara...
#![deny(clippy::all)] //! Crate for fetching and modifying the intel_pstate kernel parameters. //! //! # Example //! //! ```rust,no_run //! use intel_pstate::{PState, PStateError}; //! //! fn main() -> Result<(), PStateError> { //! let pstate = PState::new()?; //! //! pstate.set_min_perf_pct(50)?; //! psta...
use std::collections::VecDeque; use std::{cell::RefCell, fmt, future::Future, pin::Pin, rc::Rc, task::Context, task::Poll}; use loony::util::{poll_fn, Either, Ready }; use loony::{channel::pool, framed::State, service::Service}; use loony::service::Transform; use loony::web::{ WebRequest, WebResponse, ErrorRenderer };...
//! This library is used to simulate and debug programs written for //! the IBCM (Itty Bitty Computing Machine), as described in //! the [documentation](https://aaronbloomfield.github.io/pdr/book/ibcm-chapter.pdf) //! for the machine. In short, the IBCM is a vastly simplified "computer", //! with only 16 instructions a...
//! Functions related to the local network //! - subnet scanning //! - healthchecks //! - etc // Maybe look into this for ideas for safety // https://github.com/babariviere/port_scanner-rs/blob/master/src/lib.rs use futures::future; use log::info; use pnet::{datalink, ipnetwork::IpNetwork}; // Constants to restrict s...
#![forbid(unsafe_code)] // #![warn(missing_docs)] // #![warn(clippy::pedantic, clippy::nursery)] //! # `git_config` //! //! This crate is a high performance `git-config` file reader and writer. It //! exposes a high level API to parse, read, and write [`git-config` files], //! which are loosely based on the [INI file ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 64usize], #[doc = "0x40 - Peripheral Availability Register 0"] pub avail0: AVAIL0, #[doc = "0x44 - Peripheral Availability Register 1"] pub avail1: AVAIL1, #[doc = "0x48 - Peripheral Availability Register 2"] p...
//! BRK abstractions. //! //! This module provides safe abstractions over BRK. use prelude::*; use core::convert::TryInto; use core::ptr; use shim::{config, syscalls}; use {fail, sync}; /// The BRK mutex. /// /// This is used for avoiding data races in multiple allocator. static BRK_MUTEX: Mutex<BrkState> = Mutex:...
use super::{Commutate, ControlHardware, LoopState, SensorState}; use crate::{ comms::fdcan::{FdcanMessage, IncomingFdcanFrame, OutgoingFdcanFrame}, current_sensing::PhaseCurrents, pwm::PwmDuty, }; // Drive a zero-centered square wave through the phases, which should result in a triangle wave of // current ...
mod handlers { pub(crate) mod command; pub(crate) mod event; pub(crate) mod register; } mod models { mod team; mod user; pub use self::team::Team; pub use self::user::User; } use anyhow::Result; use async_std::task; use async_trait::async_trait; use serde_json::Value; use sqlx::pool::Pool...
use base_db::fixture::WithFixture; use expect_test::{expect, Expect}; use crate::{db::DefDatabase, test_db::TestDB}; fn check(ra_fixture: &str, expect: Expect) { let (db, file_id) = TestDB::with_single_file(ra_fixture); let item_tree = db.file_item_tree(file_id.into()); let pretty = item_tree.pretty_print...
// Copyright (c) 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 t...
use super::store::OwnedStore; use crate::keyhouse::{self, ErrorCode}; use crate::prelude::*; use crate::server_suite::acceptor::WrappedStream; use crate::util; use crate::{KeyhouseImpl, Metric}; use spire_workload::SpiffeID; use tonic::{ transport::server::{Connected, TlsConnectInfo}, Request, Response, Status,...
use proc_macro2::Ident; use proc_macro2::Span; use proc_macro2::TokenStream; use syn::*; use crate::config::Config; use crate::endian::*; use crate::enums::*; use crate::gen::get_extra_args; use crate::meta; use crate::structs::get_pre_post_exec; use crate::Result; use super::Generator; pub struct GenEnum { pub ...
// Copyright 2015 Michael 'ExpHP' Lamparski // // Licensed under the terms of the MIT License, available at: // http://opensource.org/licenses/MIT // and also included in the file COPYING at the root of this distribution. // This file may not be copied, modified, or distributed except according // to those terms. use...
// Copyright (c) 2018, <NAME> // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright // notice, this list of condition...
use crate::event::event_name::EventName; use crate::event::EventHandler; use std::cell::RefCell; use std::collections::HashMap; use std::rc::Rc; use wasm_bindgen::JsValue; /// Private type used to attach identifiers to DOM elements so that we can look up their event /// callbacks. #[doc(hidden)] pub const EVENTS_ID_PR...
const MAILBOX_IN_HIGH: u32 = 0x00; const MAILBOX_IN_LOW: u32 = 0x02; const MAILBOX_OUT_HIGH: u32 = 0x04; const MAILBOX_OUT_LOW: u32 = 0x06; const CONTROL_STATUS: u32 = 0x0A; const AR_SIZE: u32 = 0x12; const AR_MODE: u32 = 0x16; const AR_REFRESH: u32 = 0x1A; const A...
use std::{marker, mem, ops, ptr}; // Implementation Notes // ----- // // The data array is filled from the back, with the metadata stored before (at a lower memory address) // the actual data. This so the code can use a single integer to track the position (using size_of_val // when popping items, and the known size w...
use std::collections::VecDeque; use itertools::Itertools; #[derive(Debug, Clone, PartialEq)] struct Point { pub x: u32, pub y: u32, pub depth: u8, } impl Point { pub fn new(x: u32, y: u32, depth: u8) -> Self { Self { x, y, depth } } } #[derive(Debug)] struct HeightMap { pub width: u3...
pub mod auth; pub mod books; pub mod config; mod error; pub mod signals; pub mod simple_broker; pub mod keyed_broker; mod telemetry; use actix_web::{guard, web, App, HttpMessage, HttpRequest, HttpResponse, HttpServer}; use async_graphql::extensions::{Tracing, TracingConfig}; use async_graphql::http::{playground_source...
use crate::objects::Graphics; use wasm_bindgen::prelude::*; pub const WIDTH: u8 = 84; pub const HEIGHT: u8 = 48; pub const PLAYER_WIDTH: u8 = 10; pub const PLAYER_HEIGHT: u8 = 7; /* Fájlba áthelyezett objektumok */ pub const G_PROTECTION_A1: u8 = 250; pub const G_PROTECTION_A2: u8 = 251; pub const G_MISSILE: u8 = 25...
// #![feature(plugin)] // #![plugin(clippy)] extern crate piston_window; extern crate find_folder; extern crate rand; // extern crate ears; mod tetris; mod consts; use piston_window::*; use tetris::*; use consts::*; // use ears::{Sound, Music, AudioController}; #[derive(PartialEq)] enum GameState { Init, Pl...
//! APIs related to DMA channels use core::marker::PhantomData; use crate::{ init_state::{Disabled, Enabled}, pac::{ self, dma0::{ channel::{CFG, XFERCFG}, ACTIVE0, BUSY0, ENABLESET0, ERRINT0, INTA0, INTB0, INTENCLR0, INTENSET0, SETTRIG0, }, }, ...
#[cfg(test)] mod tests; use std::error::Error; use std::fmt; use crate::alloc::boxed_zeroed_memory; use crate::opcode::Opcode; const ROM_START_ADDR: u16 = 0x200; pub(crate) const RAM_SIZE: u16 = 1 << 12; // const DISPLAY_REFRESH_START_ADDR: u16 = 0xF00; const CALL_STACK_START_ADDR: u16 = 0xEA0; const INSTRUCTION_SIZ...
use crate::targets; use anyhow::{anyhow, Context, Error, Result}; use shiika_parser::Parser; use skc_ast2hir; use skc_codegen; use skc_corelib; use skc_mir::LibraryExports; use std::env; use std::fs; use std::io::{Read, Write}; use std::path::Path; use std::process::Command; /// Generate .ll from .sk pub fn compile<P:...
use super::{Action, Error, Index, TransitionMutableState, TransitionState, TransitionSystem}; #[derive(Debug)] pub enum ArcStandardActionType { Shift, LeftArc(Index), RightArc(Index), } impl ArcStandardActionType { pub fn from_action(action: Action) -> Self { if action == 0 { ArcSt...
#[derive(Debug)] pub enum AddressingMode { Immediate, Direct, Relative, IndexX, NoneAddressing, } pub mod flags { /* 68HC11 status flags: */ pub const NO_FLAG: u8 = 0x00; /* No flags set */ pub const C_FLAG: u8 = 0x01; /* Carry occured ...
use crate::{ dataflow::{ algorithms::reachable, operators::{Flatten, Split}, }, vsdg::{ node::{NodeExt, NodeId, Place}, Edge, ProgramGraph, }, }; use differential_dataflow::{ difference::{Abelian, Multiply}, lattice::Lattice, operators::{ arrange::{Arr...
use std::fs::File; use std::io::prelude::*; use std::collections::{HashSet, HashMap}; fn get_input() -> std::io::Result<String> { let mut file = File::open("16.txt")?; let mut contents = String::new(); file.read_to_string(&mut contents)?; Ok(contents) } #[derive(Debug, Copy, Clone, Hash, Eq, PartialE...
//! Producer and consumer configuration. //! //! ## C library configuration //! //! The Rust library will forward all the configuration to the C library. The most frequently //! used parameters are listed here. //! //! ### Frequently used parameters //! //! For producer-specific and consumer-specific parameters check t...
#![recursion_limit="2048"] #[macro_use] extern crate stdweb; #[macro_use] extern crate lazy_static; use stdweb::web::{ self, IEventTarget, // INode, // IElement, // FileReader, // FileReaderResult, // Element, // ArrayBuffer }; use stdweb::web::event::{ IEvent, IKeyboardEvent, // ...
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
/** * \file flow-rs/src/config/mod.rs * MegFlow is Licensed under the Apache License, Version 2.0 (the "License") * * Copyright (c) 2019-2021 Megvii Inc. All rights reserved. * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BA...
extern crate sdl2; use std::path::Path; use sdl2::rect::Rect; use sdl2::render::Renderer; use sdl2::render::Texture; use sdl2::image::LoadTexture; use sdl2::event::Event; use std::cell::RefCell; use std::rc::Rc; use sdl2::keyboard::Keycode; use display::Displayable; use bird::Bird; use pipes::Pipes; pub struct Sc...
use std::cell::Cell; use std::collections::HashMap; use std::ffi::OsString; use std::fs::{DirEntry, read_to_string}; use std::io::{Error, ErrorKind}; use std::path::{Path, PathBuf}; use gtk::{Adjustment, Application, ApplicationWindow, Scrollbar}; use gtk::prelude::*; use v4l::control::Description; use v4l::prelude::*...
extern crate glutin; extern crate trdl; extern crate rand; use std::f32; use std::os::raw::c_void; use rand::StdRng; use rand::distributions::{IndependentSample, Range}; const MAX_PARTICLES: usize = 500; // Make the glutin window into the TRDL window struct Window { w: glutin::Window } impl trdl::Window for Wind...
//! Represent `reduced` transaction, i.e. unsigned transaction where each unsigned input //! is augmented with ReducedInput which contains a script reduction result. use std::rc::Rc; use ergotree_interpreter::eval::env::Env; use ergotree_interpreter::eval::reduce_to_crypto; use ergotree_interpreter::eval::ReductionRe...
//! Type validating that the account is the given Program use crate::error::ErrorCode; use crate::*; use safecoin_program::account_info::AccountInfo; use safecoin_program::bpf_loader_upgradeable::{self, UpgradeableLoaderState}; use safecoin_program::instruction::AccountMeta; use safecoin_program::pubkey::Pubkey; use s...
use crate::frame::Frame; use crate::headers::*; use crate::obu::*; use crate::util::Pixel; use crate::internal::*; use std::rc::Rc; use std::{cmp, fmt, io}; use std::vec::Vec; use arg_enum_proc_macro::ArgEnum; use num_derive::*; #[derive(Clone, Copy, Debug)] #[repr(C)] pub enum CodecStatus { /// ...
use crate::registry_helper::RegistryHelper; use crate::{ error::{NodeManagerError, NodeManagerResult}, metrics::NodeManagerMetrics, }; use ic_config::firewall::{Config as FirewallConfig, FIREWALL_FILE_DEFAULT_PATH}; use ic_logger::{debug, info, warn, ReplicaLogger}; use ic_protobuf::registry::firewall::v1::Fire...
use std::cmp::{Ord, Ordering}; use std::collections::HashMap; use std::io; use std::io::BufRead as _; use std::vec::Vec; #[derive(Clone,Copy,PartialEq)] enum Colour { White, Black } impl Colour { fn flip(&self) -> Self { match self { Colour::White => Colour::Black, Colour::Black => Colour::White, } } } ...
use async_channel::Receiver; use futures::executor::block_on; use std::any::Any; use std::fmt; use std::mem; use std::panic; pub use std::thread::{current, sleep, Result, Thread}; use wasm_bindgen::prelude::*; use wasm_bindgen::JsValue; use web_sys::{Blob, Url, Worker, WorkerOptions}; struct WebWorkerContext { f...
// Copyright 2020 <NAME> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writi...
use cv_core::{ nalgebra::{UnitVector3, Vector3}, Se3TangentSpace, }; // Produces a gradient on the translation and rotation that attempts to fold the two epipolar planes // into the same plane. // // The tangent space acts on the pose that transforms `a` into the same reference frame as `b`. // The `translatio...
use crate::controller::*; use crate::editor::*; use crate::game::*; use crate::menu::*; use crate::render::*; use crate::resource::*; use crate::utility::*; use sdl2::keyboard::{Keycode, TextInputUtil}; use sdl2::pixels::Color; use sdl2::Sdl; use sdl2::{event::Event, EventPump}; use std::mem::replace; ...
//! Module to handle combat. use crate::battle::{Battle, BattleRules, BattleState}; use crate::character::Character; use crate::entropy::Entropy; use crate::error::WeaselResult; use crate::event::{Event, EventKind, EventProcessor, EventQueue, EventTrigger, LinkedQueue}; use crate::metric::WriteMetrics; use crate::stat...
use std::io::prelude::*; use std::path::{Path, PathBuf}; use std::process::Command; use std::fs::File; use std::env; use clap::*; arg_enum!{ #[allow(non_camel_case_types)] #[derive(Debug)] enum Platform { x64, ARM, x86, ARM64, } } fn main() { let arg_matches = App::...
//! Trust evaluation support. use core_foundation::array::CFArray; use core_foundation::base::TCFType; use core_foundation_sys::base::{Boolean, CFIndex}; use security_framework_sys::trust::*; use std::ptr; use crate::base::Result; use crate::certificate::SecCertificate; use crate::cvt; use crate::key::SecKey; use cr...
//! Audio plugin for the game engine Bevy //! //! It uses the library Kira to play audio and offers an API to control running game audio //! via Bevy's ECS. //! //! ```edition2018 //! # use bevy_kira_audio::{AudioChannel, Audio, AudioPlugin}; //! # use bevy::prelude::*; //! # use bevy::asset::AssetPlugin; //! # use bev...
#![allow(dead_code)] #[macro_use] extern crate lambda_runtime as lambda; #[macro_use] extern crate serde_derive; #[macro_use] extern crate log; extern crate simple_logger; use lambda::error::HandlerError; use serde_json::json; use std::error::Error; static POLICY_VERSION: &str = "2012-10-17"; // override if necessar...
use crate::{db::IdDbEntry, sensor::SensorState}; use ble_ws_api::{ data::Timestamp, proto::{ self, ble_weatherstation_service_server::BleWeatherstationService, BackupRequest, BackupResponse, ChangeLabelRequest, ChangeLabelResponse, OverviewRequest, OverviewResponse, OverviewResponseField...
use crate::traits::{CryptoBox, Error}; use aead::{ generic_array::{ sequence::{Concat, Split}, typenum::{Sum, U12, U16, U32}, GenericArray, }, Aead, Error as AeadError, NewAead, }; use aes_gcm::Aes128Gcm; use blake2::Blake2b; use core::convert::TryFrom; use hkdf::Hkdf; use keys::{Co...
// Copyright 2022 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::{convert::TryFrom, error::Error, fmt}; use crate::{path::MAX_ERROR, Point, MAX_HEIGHT, MAX_WIDTH}; const MAX_SCALING_FACTOR_X: f32 = 1.0 + MAX_E...
use std::env::var; use std::fmt; use std::fmt::{Display, Formatter}; use std::fs::read_to_string; use std::path::PathBuf; use anyhow::{Context, Result}; use serde::de::DeserializeOwned; use serde::Serialize; use crate::cfg::global::GLOBAL_FILE_NAME; use crate::cfg::{GlobalCfg, LocalCfg}; use crate::utils::find::find_...
extern crate env_logger; extern crate indy_vdr; extern crate log; #[macro_use] extern crate serde_json; mod app; mod handlers; use std::cell::RefCell; use std::fs; use std::net::IpAddr; use std::process::exit; use std::rc::Rc; use std::time::SystemTime; #[cfg(feature = "fetch")] use hyper::body::Buf; use hyper::serv...
use super::super::grid_loop::GridLoopField; use super::super::{Grid, D, P}; use super::*; use rand::Rng; use FOUR_NEIGHBOURS; #[derive(Clone, Copy, Eq, PartialEq)] pub enum ClueConstraint { Fixed(Clue), None, Any, } pub struct GeneratorOption { pub clue_constraint: Option<Grid<ClueConstraint>>, p...
//! This part of the API is still being designed - no guarantees are made //! whatsoever. use crate::{ error::*, format::*, reader::sync::decoder::{Decoder, EOFNormalizer, LimitedReader, StoreDecoder}, }; use libflate::non_blocking::deflate; use log::*; use nom::Offset; use std::io; struct EntryReadMetric...
use crate::models::*; use crate::onvista::json_utils::*; use reqwest::Response; use scraper::{Html, Selector}; use serde_json::Value; use std::error::Error; pub async fn parse_info( url: String, resp: Response, ) -> Result<(StockInfo, Vec<StockExchange>), Box<dyn Error>> { // scope is needed to fix proble...
//! All process environment related Windows types. use crate::string::WideChar; /// Allows querying the command line string of a process. pub struct CommandLine { buffer: *const WideChar } impl CommandLine { /// Retrieves the command line arguments of the current process. #[cfg_attr(not(debug_assertions)...
use std::{ ffi::OsString, io::Write, path::PathBuf, process::{Child, Command}, str::FromStr, }; use bitcoinsuite_error::{Result, WrapErr}; use bitcoinsuite_test_utils::{bin_folder, pick_ports}; use tempdir::TempDir; use tonic::transport::Channel; use crate::{ bchd_grpc::{bchrpc_client::BchrpcC...