text
stringlengths
7.05k
33.9k
//! This algorithm is not intended to be an optimization, it is rather for legalization. //! Specifically, spir-v disallows things like a `StorageClass::Function` pointer to a //! `StorageClass::Input` pointer. Our frontend definitely allows it, though, this is like taking a //! `&Input<T>` in a function! So, we inline...
use std::collections::HashSet; use std::fmt::Formatter; use std::fs::read_to_string; /// Returns the square root of a usize. /// Panics if the number is not a perfect square. fn usize_sqrt(n: usize) -> usize { let result = (n as f64).sqrt().round() as usize; assert_eq!(result * result, n); result } #[tes...
//! Keeping track of all operations. //! //! The types in this module are used for logging all operations to disk. This information can be //! used for debugging purposes, but is more directly used as a [`Checker`] to help prevent //! synchronized changes from being overwritten. //! //! It does this by parsing synchron...
use std::convert::TryInto; use std::path::Path; use crate::datasets::storage::{AddDataset, DatasetDefinition, DatasetStore, MetaDataDefinition}; use crate::datasets::upload::{UploadId, UploadRootPath}; use crate::error; use crate::error::Result; use crate::pro::contexts::ProContext; use crate::pro::projects::ProProjec...
extern crate cargo; extern crate clap; extern crate rustc_serialize; extern crate term; extern crate toml; #[macro_use] extern crate failure; use std::path::PathBuf; use cargo::core::Workspace; use cargo::core::compiler::{BuildConfig, CompileMode, MessageFormat}; use cargo::ops::{CompileFilter, CompileOptions, Packa...
use crate::circuits::{ domains::EvaluationDomains, gate::{CircuitGate, CurrOrNext, GateType}, lookup::tables::{ combine_table_entry, get_table, GateLookupTable, GatesLookupMaps, GatesLookupSpec, LookupTable, XOR_TABLE_ID, }, }; use ark_ff::{FftField, Field, One, Zero}; use ark_poly::{Eva...
#![warn(missing_docs)] //! All the different messages which can be sent/received to/from the control //! plane services and mayastor //! We could split these out further into categories when they start to grow mod mbus_nats; /// Message bus client interface pub mod message_bus; /// received message traits pub mod rece...
use crate::error::{UseCaseError, UseCaseResult}; use anyhow::Context; use sos21_domain::context::{ project_repository::{self, ProjectRepository}, Login, }; use sos21_domain::model::{permissions::Permissions, project, user}; #[derive(Debug, Clone)] pub enum Error { InsufficientPermissions, } #[derive(Debu...
// use crate::get_chain_id; use crate::get_fee; use crate::get_gas_price; use crate::utils::*; use crate::MINER_ADDRESS; use crate::MINER_CLIENT; use crate::OPERATION_TIMEOUT; use crate::TOTAL_TIMEOUT; use clarity::Uint256; use cosmos_gravity::crypto::PrivateKey as CosmosPrivateKey; use cosmos_gravity::send::{send_requ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 120usize], #[doc = "0x78 - Enable constant latency mode."] pub tasks_constlat: TASKS_CONSTLAT, #[doc = "0x7c - Enable low power mode (variable latency)"] pub tasks_lowpwr: TASKS_LOWPWR, _reserved2: [u8; 120usize], ...
//! FFI bindings and loader for the Logitech LED SDK //! //! [LogitechLed](struct.LogitechLcd.html) will try to locate and load //! `LogitechLed.dll` at Runtime for dynamic linking. The library //! will be unloaded if dropped, but it is reference counted by internally //! Windows. //! #![allow(non_camel_case_types, no...
/// **Anthos Config Management**: State for a single cluster. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MembershipState { /// The user-defined name for the cluster used by ClusterSelectors to group /// clusters together. This should match Membership's membership_name, /// unless the user inst...
pub mod event_msg_builder; pub mod parse; pub mod serialization_info; pub mod serializer; pub mod payload_size; pub mod signed_event_message; pub mod attachment; use std::cmp::Ordering; use crate::{error::Error, event::{ event_data::{DummyEvent, EventData}, Event, }, prefix::{ AttachedSigna...
#[macro_use] extern crate serde_derive; use chrono::{DateTime, Local}; use diesel::{Connection, RunQueryDsl}; use serde; use std; use std::path::{Path, PathBuf}; const MAX_RETRIES: usize = 4; type DB = diesel::sqlite::Sqlite; type DBConnection = diesel::SqliteConnection; fn get_args() -> clap::ArgMatches<'static> { ...
//! Module containing the all SMTLIB string functions, and their operator representations //! For each function, we implement functionality for getting the argument and return types, //! a representation of these types, and a type-based listing of the string properties that need to //! be maintained given the usage of ...
#![allow(dead_code)] use super::package::PkgVarPairs; use super::types::TypeLookup; use goscript_parser::ast::*; use goscript_parser::objects::Objects as AstObjects; use goscript_vm::instruction::*; use goscript_vm::objects::{key_to_u64, EntIndex, FunctionVal}; use goscript_vm::value::*; use slotmap::KeyData; use std:...
use crate::chunked_array::ops::explode::offsets_to_indexes; use crate::prelude::*; use crate::utils::get_supertype; use arrow::buffer::Buffer; use polars_arrow::kernels::concatenate::concatenate_owned_unchecked; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; fn get_exploded(series: &Series) -> Result<(...
//! Unfortunately, sending a [`CrashContext`] to another process on Macos //! needs to be done via mach ports, as, for example, `mach_task_self` is a //! special handle that needs to be translated into the "actual" task when used //! by another process, this _might_ be possible completely in userspace, but //! examinin...
//! web_sys::WebSocket-based `Transport` implementation. use crate::prelude::*; use ensogl_system_web::js_to_string; use ensogl_system_web::event::listener::Slot; use failure::Error; use futures::channel::mpsc; use json_rpc::Transport; use json_rpc::TransportEvent; use utils::channel; use wasm_bindgen::JsCast; use we...
//! [Specification document](https://github.com/awakecoding/qmux/blob/protocol-update/SPEC.md) pub mod listener; mod codec; mod id; mod proto; use self::codec::JmuxCodec; use self::id::{DistantChannelId, IdAllocator, LocalChannelId}; use self::proto::{Message, ReasonCode}; use crate::pipe::PipeMode; use crate::proxy...
//! This crate provides a client to the watchman file watching service. //! //! Start with the [Connector](struct.Connector.html) struct and use //! it to connect and return a [Client](struct.Client.html) struct, //! [Client::resolve_root](struct.Client.html#method.resolve_root) to //! resolve a path and initiate a wat...
use core::fmt; use flash_lso::errors::Error; use flash_lso::read::Reader; use nom::error::ErrorKind; // #[cfg(test)] // use pretty_assertions::assert_eq; /// Wrapper around Vec<u8> that makes `{:#?}` the same as `{:?}` /// Used in `assert*!` macros in combination with `pretty_assertions` crate to make /// test failure...
use crate::{ ast::{Level, Message}, events::AppEvent, log::Log, widgets::{BindingDisplay, IconPack, LazyParagraph, LazyParagraphState, State, WithLog}, }; use crossterm::event::{Event, KeyCode}; use indexmap::IndexMap; use itertools::{Either, Itertools}; use tracing::trace; use tui::{ buffer::Buffer...
// Copyright 2020 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under The General Public License (GPL), version 3. // Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed // under the GPL Licence is distributed on an "AS IS" BASIS, WITHOUT WARRANTI...
//! Implementation of construction and extraction of custom linker section records used to store //! probe information in an object file. // Copyright 2021 Oxide Computer Company // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. //...
#![macro_use] //! HAL interface to the RADIO peripheral. //! //! See product specification: //! //! - nRF52810: v1.3 Section 6.14 //! //! Open Points: //! *) rx and tx traits (what signature should be used) //! *) "rx then tx" and "tx then rx" support (interesting for protocols) //! use crate::pac; use crate::util::sl...
use failure::Error; use std::io::{self, Error as IoError, Result as IoResult}; extern crate winapi; use crate::pty::conpty::winapi::shared::minwindef::DWORD; use crate::pty::conpty::winapi::shared::winerror::{HRESULT, S_OK}; use crate::pty::conpty::winapi::um::fileapi::{ReadFile, WriteFile}; use crate::pty::conpty::win...
use crate::core::prelude::*; use crate::sim::sdr_sdram::chip::SDRAMSimulator; use crate::widgets::dff::DFF; use crate::widgets::prelude::{DelayLine, MemoryTimings, SynchronousFIFO, TristateBuffer}; use crate::widgets::sdram::cmd::SDRAMCommand; // Controller states... #[derive(Copy, Clone, PartialEq, Debug, LogicState)...
/* * Copyright (c) 2018-2019, Trustees of Indiana University * ("University Works" via Baojun Wang) * Copyright (c) 2018-2019, <NAME> * ("Traditional Works of Scholarship") * * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root d...
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
#[macro_use] extern crate anyhow; #[macro_use] extern crate janus_plugin as janus; #[macro_use] extern crate serde_derive; use std::os::raw::{c_char, c_int}; use std::path::Path; use std::slice; use std::{ ffi::{CStr, CString}, time::Instant, }; use anyhow::{bail, Context, Result}; use chrono::Utc; use janus:...
use crate::onion::crypto::{self, EphemeralPublicKey, RsaPrivateKey, SessionKey}; use crate::onion::protocol::{ CircuitOpaque, CircuitOpaqueBytes, SignKey, TryFromBytesExt, TunnelExtendedError, TunnelProtocolError, TunnelRequest, TunnelTruncatedError, VerifyKey, }; use crate::onion::socket::{OnionSocket, OnionSo...
#![cfg(target_arch = "x86_64")] use std::any::type_name; use std::any::Any; use std::marker::PhantomData; use std::collections::HashMap; use std::fmt::Display; use std::ops::AddAssign; use std::sync::Mutex; use std::thread::{current, ThreadId}; use std::time::Instant; use std::io::*; use crate::cell::LazyCell; #[deri...
// 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 { anyhow::{format_err, Error}, bt_rfcomm::{profile::build_rfcomm_protocol, ServerChannel}, fidl_fuchsia_bluetooth_bredr as bredr, fuchs...
use std::collections::{BTreeMap, HashMap}; use std::convert::TryFrom; use std::num::NonZeroUsize; use std::ops::Range; use std::path::PathBuf; use std::rc::Rc; use std::sync::Arc; use vob::Vob; use crush::algebra; use crush::algebra::Matrix; use crush::soc::bdd::differential::StyledProgressBar; use crush::soc::Id; us...
/// Mocks for the RiskManager pallet. use super::*; use crate as risk_manager; use controller::{ControllerData, PauseKeeper}; use frame_support::{ord_parameter_types, pallet_prelude::GenesisBuild, parameter_types, PalletId}; use frame_system::EnsureSignedBy; use liquidity_pools::{PoolData, PoolUserData}; use minterest_...
use mem; use msgs; use hwcore::Message; use std::fmt; use std::rc::Rc; use std::cell::RefCell; pub struct HardwarePica { event_tx: msgs::Client<Message>, fb_state: FramebufState, mem: mem::MemController, } impl HardwarePica { pub fn new(client: msgs::Client<Message>, mem: mem::MemController) -> Self ...
use super::{Error, Result}; use crate::emitter::{self, ir::*}; use crate::string; use if_chain::if_chain; use itertools::Itertools; use ordered_float::OrderedFloat; use std::cmp::Ordering; use std::fmt; use std::sync::{Arc, Mutex}; #[derive(Debug, Clone)] pub enum Value { S(Ct, i64), U(Ct, u64), F32(Ordere...
use sauron::{ html::{self, attributes::*, events::*, units::*, *}, Component, Node, }; use crate::{ app::{ self, tab_view::{self, TabView}, toolbar_view::{self, ToolbarView}, }, assets, }; use diwata_intel::{TableName, Window}; use diwata_intel::data_container::WindowData; ...
// Copyright 2019-2021 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any...
//! yaskkserv2 //! //! # はじめに //! //! SKK server 本体。 `yaskkserv2_make_dictionary` で作成した dictionary を使用する。 //! //! `yaskkserv2_make_dictionary` に比べるとメモリなどのリソースを抑えて使用する。ファイルは //! 一気読みせず、メモリに保持するデータも限定的。実行速度も重要となるため、ヒープや map の //! 使用も最低限に抑えてある (現代的な Rust が動作がするような環境に対して、いささか神経質に //! なり過ぎかもしれない)。 mod dictionary_reader; mo...
/*********************************************************************************************************************** * Copyright (c) 2020 by the authors * * Author: <NAME> <<EMAIL>> * License: Apache License 2.0 / MIT *********************************************************************************************...
use crate::{gradient, math::vectors::*, permutationtable::NoiseHasher}; const TO_REAL_CONSTANT_2D: f64 = -0.211_324_865_405_187; // (1 / sqrt(2 + 1) - 1) / 2 const TO_SIMPLEX_CONSTANT_2D: f64 = 0.366_025_403_784_439; // (sqrt(2 + 1) - 1) / 2 const TO_SIMPLEX_CONSTANT_3D: f64 = -2.0 / 3.0; // Determined using the Math...
/* Future works: - See, https://docs.near.org/docs/api/naj-cookbook#wrap-and-unwrap-near for NEAR to wNEAR - Integrate expiry system, using use std::time::SystemTime; // Will need to getting over due escrows SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).as_sec(); */ use near_s...
/** PLL configuration */ #[derive(Debug, PartialEq, Eq)] pub struct Params { pub clkr: u8, pub clkf: u8, pub clkod: u8, pub bwadj: u8, } /* * The PLL included with the Kendryte K210 appears to be a True Circuits, Inc. * General-Purpose PLL. The logical layout of the PLL with internal feedback is * a...
use imgui::{CollapsingHeader, Condition, ImStr, ImString, Slider, Window}; use itertools::Itertools; use crate::framework::context::Context; use crate::framework::error::GameResult; use crate::scene::game_scene::GameScene; use crate::scripting::tsc::text_script::TextScriptExecutionState; use crate::shared_game_state::...
// Copyright 2014 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...
use std::collections::HashMap; use std::sync::Arc; use crate::{ endpoint::{BoxedEndpoint, Endpoint}, Middleware, }; use path_table::{PathTable, RouteMatch}; /// A core type for routing. /// /// The `Router` type can be used to set up routes and resources, and to apply middleware. pub struct Router<Data> { ...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 06/06/2017 Last Modified: 30/01/2020 License: MIT */ use whitebox_raster::*; use crate::tools::*; use num_cpus; use std::collections::VecDeque; use std::env; use std::f64; use std::io::{Error, ErrorKind}; use std::path;...
//! Decoding of GIF Images //! //! GIF (Graphics Interchange Format) is an image format that supports lossless compression. //! //! # Related Links //! * <http://www.w3.org/Graphics/GIF/spec-gif89a.txt> - The GIF Specification //! //! # Examples //! ```rust,no_run //! use image::gif::{GifDecoder, GifEncoder}; //! u...
use std::{ alloc::{handle_alloc_error, Layout}, cell::UnsafeCell, ptr::NonNull, }; use crate::ptr::{OwningPtr, Ptr, PtrMut}; /// A flat, type-erased data storage type /// /// Used to densely store homogeneous ECS data. pub struct BlobVec { item_layout: Layout, capacity: usize, /// Number of el...
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the root directory of this source tree. // // In an ideal world there would be a stable well documented set of crates containing a specific // version of the Rust compiler along w...
use core; use cortex_m; use stm32f407; use smoltcp::{self, phy::{self, DeviceCapabilities}, time::Instant, wire::EthernetAddress}; const ETH_BUF_SIZE: usize = 1536; const ETH_NUM_TD: usize = 4; const ETH_NUM_RD: usize = 4; use ::config::ETH_PHY_ADDR; /// Transmit Descriptor representation /// /// * tdes0: ownership...
// Copyright 2017-2019 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) a...
// Copyright 2020-2022 <NAME> // SPDX-License-Identifier: Apache-2.0 use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; use std::sync::Arc; use identity_account_storage::identity::ChainState; use identity_account_storage::identity::IdentityState; use identity_account_storage::storage::Storage; use i...
use distribution; use source::Source; /// A beta distribution. #[derive(Clone, Copy, Debug)] pub struct Beta { alpha: f64, beta: f64, a: f64, b: f64, ln_beta: f64, } impl Beta { /// Create a beta distribution with shape parameters `alpha` and `beta` /// on interval `[a, b]`. /// //...
/*! * MQTT protocol types. */ use std::convert::TryInto; use bytes::{Buf, BufMut}; #[cfg(feature = "serde1")] use serde::{Deserialize, Serialize}; mod packet; pub use packet::{ ConnAck, Connect, Disconnect, Packet, PacketCodec, PacketIdentifierDupQoS, PingReq, PingResp, PubAck, PubComp, PubRec, PubRel, Pub...
mod bag; mod input_state; mod shapes; pub mod tetromino; mod ui_element; mod well; use self::bag::PieceBag; use self::input_state::InputState; use self::tetromino::{Piece, PieceType}; use self::ui_element::{UIBlockView, UITextView}; use self::well::Well; use crate::states::game_over_state::{GameEndMode, GameEndState};...
// 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...
// Copyright 2020. The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following // disclai...
// Copyright 2014 <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 writing, ...
//! Style and formatting of text displayed in a terminal, //! following the ANSI, VT100, and xterm standards. use core::fmt; use alloc::borrow::Cow; use crate::{ForegroundColor, BackgroundColor, UnderlinedColor}; /// The style of text, including formatting and color choice, /// for the character(s) displayed in a `U...
//! This module provides tools to load //! and parse meta-data for a pangaea dataset use crate::error::Error; use futures::StreamExt; use geoengine_datatypes::collections::VectorDataType; use geoengine_datatypes::primitives::{ AxisAlignedRectangle, BoundingBox2D, Coordinate2D, FeatureDataType, MultiPoint, MultiPol...
use anyhow::{anyhow, Result}; use bytes::Bytes; use cassandra_protocol::compression::Compression; use cassandra_protocol::consistency::Consistency; use cassandra_protocol::events::SchemaChange; use cassandra_protocol::frame::frame_batch::{BatchQuery, BatchQuerySubj, BatchType, BodyReqBatch}; use cassandra_protocol::fra...
//! Helpers to convert between LSP representations of text documents and Rust //! strings. //! //! ## Motivation: //! LSP uses UTF16-encoded strings while Rust's strings are UTF8-encoded. This //! means that text offsets in LSP and in Rust are different: //! - LSP offsets are in 16-bit code-units and each character is ...
#![feature(rustc_private)] #![feature(once_cell)] extern crate rustc_ast; extern crate rustc_ast_pretty; extern crate rustc_attr; extern crate rustc_driver; extern crate rustc_error_codes; extern crate rustc_errors; extern crate rustc_feature; extern crate rustc_hash; extern crate rustc_hir; extern crate rustc_interfa...
use std::collections::HashMap; use std::fmt; use std::thread; use std::sync::mpsc; use std::sync::{Arc, Mutex}; use std::cell::RefCell; use std::cmp::PartialEq; use std::io; use std::io::prelude::*; use std::io::stdin; use std::fs::File; use lalrpop_util; use queue; use unicode_segmentation::UnicodeSegmentation; use as...
//! Types that specify what is contained in a ZIP. #[cfg(doc)] use {crate::read::ZipFile, crate::write::FileOptions}; #[cfg(not(any( all(target_arch = "arm", target_pointer_width = "32"), target_arch = "mips", target_arch = "powerpc" )))] use std::sync::atomic; #[cfg(any( all(target_arch = "arm", targ...
//! Rust-socket.io is a socket.io client written in the Rust Programming Language. //! ## Example usage //! //! ``` rust //! use rust_socketio::{SocketBuilder, Payload, Socket}; //! use serde_json::json; //! use std::time::Duration; //! //! // define a callback which is called when a payload is received //! // this cal...
use itertools::Itertools; use proc_macro2::{ Delimiter, Group, Ident, Literal, Punct, Span, TokenStream, TokenTree }; use std::{ convert::TryFrom, hint::unreachable_unchecked, iter::{Filter, Sum}, ops::{Add, Sub} }; #[cfg(feature = "nightly")] mod nightly { use self::super::{ super::compile::lints::{Level, Lin...
use actix::prelude::*; use actix_web::web::{Data, Payload}; use actix_web::{web, App, Error, HttpRequest, HttpResponse, HttpServer}; use actix_web_actors::ws; use mediasoup::prelude::*; use mediasoup::worker::{WorkerLogLevel, WorkerLogTag}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::nu...
use std::error; use std::fmt; use std::collections::HashMap; static DEV_ERR_LIST: [(i32, &'static str); 225] = [ // Command Errors (-100, "Command error"), (-101, "Invalid character"), (-102, "Syntax error"), (-103, "Invalid separator"), (-104, "Data type error"), (-108, "Parameter not all...
mod mem_map; use crate::{ offsets::{Win32ArchOffsets, Win32Offsets}, prelude::{VirtualReadUnicodeString, Win32ExitStatus, EXIT_STATUS_STILL_ACTIVE}, }; use super::{ process::IMAGE_FILE_NAME_LENGTH, Win32KernelBuilder, Win32KernelInfo, Win32Keyboard, Win32ModuleListInfo, Win32Process, Win32ProcessInfo,...
//! The module contains the implementation of HTTP/2 frames. use std::io; use std::mem; use bytes::Bytes; use solicit::StreamId; use solicit::frame::flags::*; /// A helper macro that unpacks a sequence of 4 bytes found in the buffer with /// the given identifier, starting at the given offset, into the given integer...
pub mod processing; #[cfg(feature = "monstermos")] pub mod monstermos; #[cfg(feature = "putnamos")] pub mod putnamos; #[cfg(feature = "katmos")] pub mod katmos; use crate::gas::Mixture; use auxtools::*; use crate::constants::*; use crate::GasArena; use dashmap::DashMap; use fxhash::FxBuildHasher; use rayon; ...
//! ECIES-ed25519: An Integrated Encryption Scheme on Twisted Edwards Curve25519. //! //! ECIES can be used to encrypt data using a public key such that it can only be decrypted //! by the holder of the corresponding private key. It is based on [curve25519-dalek](https://docs.rs/curve25519-dalek). //! //! There are tw...
//! This module contains the logic for solving Sudoku. //! //! Most importantly, this module contains the definition of the [Solver] trait //! and the [BacktrackingSolver] as a generally usable implementation. use crate::{Sudoku, SudokuGrid}; use crate::constraint::Constraint; pub mod strategy; /// An enumeration of...
//! This module implements arithmetic over the quadratic extension field Fp6. use blst::*; use core::{ fmt, ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; use crate::{ fp::{FROBENIUS_COEFF_FP6_C1, FROBENIUS_COEFF_FP6_C2}, Fp, Fp2, }; use fff::Field; /// This represents an element $c...
// Copyright (c) 2020 kprotty // // 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 wri...
// 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 { at_commands as at, std::{fmt, iter::once}, thiserror::Error, }; use crate::{ peer::{ calls::Call, gain_control::Gain...
use crate::onion; use crate::onion::circuit::Circuit; use crate::onion::crypto::{self, EphemeralPrivateKey, SessionKey}; use crate::onion::protocol::{ CircuitOpaque, CircuitOpaqueBytes, TryFromBytesExt, TunnelRequest, VerifyKey, }; use crate::onion::socket::{OnionSocket, OnionSocketError, SocketResult}; use crate::...
//! A crate that provides several perceptual hashing algorithms for images. //! Supports images opened with the [image] crate from Piston. //! //! ```rust,no_run //! # use img_hash::{HasherConfig, HashAlg}; //! let image1 = image::open("image1.png").unwrap(); //! let image2 = image::open("image2.png").unwrap(); //! ...
/* * __ __ _ _ _ * | \/ | ___ ___ __ _| | (_)_ __ | | __ * | |\/| |/ _ \/ __|/ _` | | | | '_ \| |/ / * | | | | __/\__ \ (_| | |___| | | | | < * |_| |_|\___||___/\__,_|_____|_|_| |_|_|\_\ * * Copyright (c) 2017-2018, The MesaLink Authors. * All rights reserved. * *...
use crate::components::light::LightType; use crate::components::{ KinematicComponent, LightComponent, MeshComponent, MetadataComponent, RigidBodyComponent, TransformComponent, }; use crate::managers::orbit::{BodyDescription, BodyInstanceDescription, BodyType, StateVector}; use crate::managers::resource::materia...
use rand::rngs::ThreadRng; use rand::seq::SliceRandom; use std::{ cmp::{max, min}, collections::VecDeque, f64, rc::Rc, }; use tau::TAU; use wasm_bindgen::JsValue; use web_sys::CanvasRenderingContext2d; // how many pixels from a side you have to be before we say you clicked there const MARGIN: i32 = 50;...
// Copyright 2017 <NAME>. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law...
//! [Spanned] and aliases thereof - //! spanned::{[Value], [Null], [Bool], //! [Num]\[[ber](Number)\], //! [Str]\[[ing](String)\], //! [Obj]\[[ect](Object)\], //! [Span], [Array]} use super::{start, end}; use serde::de::*; use std::borrow::Borrow; use std::cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering}; use std::co...
// QuiZX - Rust library for quantum circuit rewriting and optimisation // using the ZX-calculus // Copyright (C) 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 // /...
mod sptree; mod vptree; use num_traits::{AsPrimitive, Float}; use rand_distr::{Distribution, Normal}; use rayon::{ iter::{ IndexedParallelIterator, IntoParallelRefIterator, IntoParallelRefMutIterator, ParallelIterator, }, slice::ParallelSliceMut, }; pub(crate) use sptree::SPTree; use std::{...
//! Event handling //! //! This module defines the `EventHandler` trait and some event types: `RawMidiEvent`, //! `SysExEvent`, ... //! //! Custom events //! ============= //! //! Implement `Copy` if possible //! ---------------------------- //! //! If possible, implement the `Copy` trait for the event, //! so that the...
use crate::{multicore::Worker, EvaluationDomain}; use crate::{FpParameters, PrimeField}; use rayon::prelude::*; use std::any::Any; use std::fmt; /// Defines a domain over which finite field (I)FFTs can be performed. Works /// only for fields that have a large multiplicative subgroup of size that is /// a power-of-2 an...
use std::cmp; use svgdom::{AttributeId as AId, Node}; use super::layout::{Layout, CalcLayout, DrawLayout}; use super::adaptors::Adaptor; use super::Rect; use font::FontMetrics; use config; static FIRST_TICK_COLOR: &'static str = "#333"; static OTHER_TICKS_COLOR: &'static str = "#ccc"; static TICKS_TEXT_COLOR: &'stat...
//! A CRDT-based engine for collaborative text editing with meta and undo support. //! //! Undo/redo edits are shared but undo stack is local. use crdts::{ orswot::{Member, Op}, CmRDT, CvRDT, Orswot, }; use rand::random; pub use ropey::Rope; use serde::{Deserialize, Serialize}; use std::collections::{HashMap, ...
use crate::common::*; use crate::raw_enum; /// Cf https://github.com/CTCaer/Nintendo_Switch_Reverse_Engineering/blob/ir-nfc/mcu_ir_nfc_notes.md use ir::*; use std::fmt; pub mod ir; mod ir_register; #[repr(u8)] #[derive(Copy, Clone, Debug, Eq, PartialEq, FromPrimitive, ToPrimitive)] pub enum MCUReportId { Empty = ...
use std::fs::File; use std::io::Read; use std::path::Path; use model::*; use std::path::PathBuf; use std::collections::HashMap; use sanskrit_core::model::{Module as RModule, FunSigShared, CallableImpl, DataImpl, ImplementComponent, SigComponent, Generic as RGeneric, BodyImport, PublicImport, BitSerializedVec}; u...
// This file contains a threaded decoder use core; use core::hash::Hasher; use interface::{DivansOpResult, DivansResult, DivansOutputResult, DivansInputResult, StreamDemuxer, StreamID, ErrMsg}; use mux::DevNull; use ::probability::{CDF16}; use ::slice_util::{AllocatedMemoryPrefix, AllocatedMemoryRange}; use ::alloc_uti...
// 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
// Copyright (C) 2019 <NAME> <<EMAIL>> // Copyright (C) 2019-2020 <NAME> <<EMAIL>> // SPDX-License-Identifier: MIT use crate::edit_view::EditView; use gdk::{Cursor, CursorType, DisplayManager, WindowExt}; use gettextrs::gettext; use gio::prelude::*; use gio::Resource; use glib::{clone, Bytes}; use gtk::prelude::*; use...
//! This module implements import-resolution/macro expansion algorithm. //! //! The result of this module is `DefMap`: a data structure which contains: //! //! * a tree of modules for the crate //! * for each module, a set of items visible in the module (directly declared //! or imported) //! //! Note that `Def...
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...