text
stringlengths
9.08k
47.9k
extern crate serde_json; pub mod tree; pub mod proof; pub mod merkletree; use self::tree::*; use self::merkletree::*; use errors::common::CommonError; use utils::crypto::hash::Hash; impl MerkleTree { fn count_bits(v: usize) -> usize { let mut ret = 0; let mut val = v; while val != 0 { ...
use crate::{idl::AST_STR, schema::{NP_Struct_Field, NP_Value_Kind}}; use crate::{buffer::{VTABLE_BYTES, VTABLE_SIZE}, idl::{JS_AST, JS_Schema}}; use alloc::string::String; use crate::pointer::{NP_Vtable}; use crate::{pointer::{NP_Cursor}, schema::{NP_Parsed_Schema}}; use crate::{memory::{NP_Memory}, pointer::{NP_Value}...
use super::memory::Memory; use super::utils::bit_is_set; pub struct Cpu { af: ComboRegister, bc: ComboRegister, de: ComboRegister, hl: ComboRegister, sp: u16, pc: u16, } impl Cpu { pub fn new() -> Self { Cpu { af: ComboRegister::new(), bc: ComboRegister::new...
//! //! # ProtoBuf Import & Export //! // Std-Lib use std::collections::HashMap; use std::convert::{TryFrom, TryInto}; // Local imports use crate::{ // FIXME: some of these should come from `validate` abs::{Abstract, Port}, cell::Cell, coords::{HasUnits, PrimPitches, Xy}, instance::Instance, l...
use std::borrow::Borrow; use std::fmt::Debug; use std::marker::PhantomData; use std::ops::Range; use super::dual_coord::DualCoordChartContext; use super::mesh::MeshStyle; use super::series::SeriesLabelStyle; use crate::coord::{ AsRangedCoord, CoordTranslate, MeshLine, Ranged, RangedCoord, ReverseCoordTranslate, S...
mod helper; #[cfg(not(feature = "std"))] use alloc::vec; use crate::adapter::Adapter; use crate::debug; use ckb_std::ckb_constants::Source; use eth_spv_lib::eth_types::*; use force_eth_types::{ eth_header_cell::ETHHeaderCellDataView, generated::{ basic::BytesVecReader, eth_header_cell::{ ...
use std::{ cmp::min, collections::{BTreeMap, HashMap}, io::SeekFrom, pin::Pin, sync::Arc, task::{Context, Poll}, }; use async_trait::async_trait; use camino::Utf8Path; #[cfg(feature = "sctest")] use camino::Utf8PathBuf; use futures::{ready, Future, FutureExt}; // use rkyv::{Archive, Deserialize...
// Copyright 2021 The sdcons 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 crate::{Set, Map}; use crate::types::{NonEmptyMap, VPackageName}; use crate::im_repr::{PackageOps, PackageInstance, PackageConfig, ServiceInstance, ConstantsByVariant, ConfType, VarType, ConfFormat, FileType, HiddenVarVal, FileVar, GeneratedType, ExtraGroup, Database, MigrationVersion, Migration, Alternative, PostP...
//! Implementation of font shaping for Arabic scripts //! //! Code herein follows the specification at: //! <https://github.com/n8willis/opentype-shaping-documents/blob/master/opentype-shaping-arabic-general.md> use crate::error::{ParseError, ShapingError}; use crate::gsub::{self, FeatureMask, GlyphData, GlyphOrigin, ...
use crate::assets::{SYSROOT_TAR_GZ}; use crate::config::{ApiAuth}; use crate::docker::{DockerImage}; use crate::query::{Maybe, fail}; use byteorder::{ReadBytesExt, WriteBytesExt}; use monosodium::{generic_hash}; use monosodium::util::{CryptoBuf}; use schemas::v1::{ CudaVersionV0, DistroIdV0::{self, *}, DistroCod...
//! Framer outputs for the client use std::convert::TryFrom; use std::fmt; #[cfg(feature = "chrono")] use chrono::{DateTime, Datelike, Duration, TimeZone, Utc}; use lazy_static::lazy_static; use regex::Regex; use thiserror::Error; use super::event::{EventCode, UnrecognizedEventCode}; use super::originator::Originato...
// Copyright 2017 <NAME> aka. Luxko // // 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 accordi...
// Copyright 2020-2021, The Tremor Team // // 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 agr...
use crate::stan_client::{StanClient, StanOptions, DEFAULT_DISCOVER_PREFIX, ClientInfo, StanMessage, StartPosition, DEFAULT_MAX_INFLIGHT, DEFAULT_ACK_WAIT, StanSubscribe, StanSid, Subscription, AckHandler}; use std::sync::{Arc, RwLock}; use crate::error::RatsioError; use crate::nuid::NUID; use crate::nats_client::{NatsC...
// Generated by gir (https://github.com/gtk-rs/gir @ 05fe12c0b7e7) // from gir-files (https://github.com/gtk-rs/gir-files @ b827978e7d18) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ eabb1f9cac5b) // DO NOT EDIT use gstreamer_rtsp_sys::*; use std::env; use std::error::Error; use s...
use anyhow::{bail, Error}; use serde::{Deserialize, Serialize}; use slog::{debug, info, o, Logger}; use crate::bidding::{BidPolicy, BidReinforcementPolicy, BidTakebackPolicy, JokerBidPolicy}; use crate::deck::Deck; use crate::game_state::{GameState, InitializePhase}; use crate::message::MessageVariant; use crate::scor...
use bindings::{ Windows::Win32::Graphics::Direct3D11::*, Windows::Win32::Graphics::Direct3D12::*, Windows::Win32::Graphics::DirectComposition::*, Windows::Win32::Graphics::Dxgi::*, Windows::Win32::Graphics::Gdi::*, Windows::Win32::Graphics::Hlsl::*, Windows::Win32::System::SystemServices::*, Windows::Wi...
use crate::implementation::{ append_to_filename, debug_assert_graph_has_no_consecutive_dummy_edges, make_graph_eulerian_with_breaking_edges, GraphMatchingNodeMap, MatchtigEdgeData, RelaxedAtomicBoolVec, TARGET_DIJKSTRA_BLOCK_TIME, }; use crate::{HeapType, NodeWeightArrayType, TigAlgorithm}; use atomic_count...
use std::borrow::Cow; use dbus_strings as strings; use crate::types; use crate::types::{Marshal, DemarshalError}; use std::convert::TryInto; use std::num::NonZeroU32; use std::io; use crate::marshalled::{Multi, MultiBuf, DictBuf, VariantBuf, Parsed, Single}; const FIXED_HEADER_SIZE: usize = 16; const METHOD_CALL: u8 ...
#![doc(html_root_url = "https://docs.rs/semver-rs/0.1.0")] #![deny(warnings, missing_debug_implementations)] //! Semantic version parsing and comparison ([semver](https://semver.org/)). The implementation of this crate is based on the //! [node-semver](https://github.com/npm/node-semver#readme) npm package. The tests ...
//! Items related to Vulkan and the Rust API used by Nannou called Vulkano. //! //! This module re-exports the entire `vulkano` crate along with all of its documentation while //! also adding some additional helper types. //! //! Individual items from throughout the vulkano crate have been re-exported within this modul...
use std::{ collections::HashMap, }; use core_extensions::SelfOps; use syn::{ Ident, visit_mut::VisitMut, }; use quote::{quote,ToTokens}; use proc_macro2::{Span,TokenStream as TokenStream2}; use as_derive_utils::{ datastructure::DataStructure, gen_params_in::{GenParamsIn,InWhat}, to_token_fn...
//! MC Protocol packets use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use std::io; use std::io::prelude::*; use crate::types::Var; /// A trait used for data which can be encoded/decoded as is. pub trait Protocol { type Clean; fn proto_len(value: &Self::Clean) -> usize; fn proto_encode(value:...
/* * Copyright (c) 2021 gematik GmbH * * 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 agr...
use crate::{DepKind, Edge, Error, Kid, Krates}; use cargo_metadata as cm; use std::{ collections::HashMap, path::{Path, PathBuf}, }; /// An alternative to cargo_metadata::MetadataCommand which allows correct /// feature usage, as well as ensuring that the command can run successfully /// regardless of where it...
//! Matrix server abstraction. //! //! A MatrixServer is created for every server the user configures. //! //! It will create a per server config subsection. If options are added to the //! server they need to be removed from the server section when the server is //! dropped. //! //! The server will create a tokio runt...
use std::string::String; use std::collections::{BTreeMap, HashMap}; use near_sdk::{near_bindgen, env}; use borsh::{BorshDeserialize, BorshSerialize}; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, BorshDeserialize, BorshSerialize, Debug)] pub struct ResolutionWindow { pub round: u64, pub parti...
use crate::basic_sharing::{from_secrets, reconstruct_secrets}; use sha3::digest::generic_array::GenericArray; use sha3::digest::FixedOutput; use sha3::Digest; use std::convert::TryFrom; use std::fs::File; use std::io::{Cursor, Read, Write}; use std::path::{Path, PathBuf}; const NUM_FIRST_BYTES_FOR_VERIFY: usize = 32; ...
use std::{ collections::{HashMap, HashSet}, sync::atomic::Ordering::SeqCst, time::Instant, }; use crate::{ account_lock_manage::AccountLockManage, backend_manage::BackendManage, constants::{L2TX_MAX_CYCLES, MAX_READ_DATA_BYTES_LIMIT, MAX_WRITE_DATA_BYTES_LIMIT}, error::{BlockError, Transact...
use std::ops::Mul; use crate::vec::f32x3; #[derive(Debug, Copy, Clone, PartialEq)] pub struct Matrix4x4 { m: [[f32; 4]; 4] } impl Matrix4x4 { pub fn new() -> Matrix4x4 { Matrix4x4 { m: [ [1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0,...
#![cfg(target_os = "windows")] #![allow(non_snake_case)] use std::ffi::{OsStr, c_void}; use std::os::windows::ffi::OsStrExt; use std::ptr; use std::mem; use super::*; // ////////////////////////////////////////////////////////////////////////// // // Win API bindings ...
use class::JavaClassReader; use opcodes::*; use opcodes::Opcode::*; /// Reads in a single opcode from a `JavaClassReader` and returns the read-in Opcode. /// Should never fail with a well-formed Java 8 class file. pub fn to_opcode(r: &mut JavaClassReader, method_start: u32) -> Option<Opcode> { let bytecode = r.nex...
//! A scheduler is initialized with a fixed number of workers. Each worker is //! driven by a thread. Each worker has a "core" which contains data such as the //! run queue and other state. When `block_in_place` is called, the worker's //! "core" is handed off to a new thread allowing the scheduler to continue to //! m...
use crate::util::conversions::*; use crate::util::metadata::side_metadata::{SideMetadataContext, SideMetadataSanity}; use crate::util::Address; use crate::util::ObjectReference; use crate::util::heap::layout::vm_layout_constants::{AVAILABLE_BYTES, LOG_BYTES_IN_CHUNK}; use crate::util::heap::layout::vm_layout_constants...
// Copyright (C) 2017-2018 Baidu, Inc. 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 condit...
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0. use std::convert::TryFrom; use std::hash::{Hash, Hasher}; use std::ptr::NonNull; use std::sync::Arc; use collections::HashMap; use collections::HashMapEntry; use tidb_query_datatype::{EvalType, FieldTypeAccessor}; use tikv_util::trace::*; use tipb::Ag...
use cookie_factory::bytes::{be_u16, be_u32, be_u8}; use cookie_factory::multi::all; use cookie_factory::sequence::tuple; use cookie_factory::{gen, GenResult, SerializeFn, WriteContext}; use std::io::Write; use std::net::{SocketAddr, UdpSocket}; use crate::chunk_ihello::IHelloChunkBody; use crate::chunk_iikeying::IIKey...
use std::collections::HashMap; use std::fmt; use std::fs::File; use std::io::Read; use std::path::Path; use ring::signature::{ ECDSA_P256_SHA256_FIXED, ECDSA_P384_SHA384_FIXED, RSA_PKCS1_2048_8192_SHA1_FOR_LEGACY_USE_ONLY, RSA_PKCS1_2048_8192_SHA256, RSA_PKCS1_2048_8192_SHA512, ED25519, Unp...
use crate::dataflow::{ operators::{FilterMap, FilterSplit, InspectExt, Reverse, Split}, Time, }; use abomonation_derive::Abomonation; use differential_dataflow::{ algorithms::graphs::propagate, collection::concatenate, difference::{Abelian, Multiply, Semigroup}, lattice::Lattice, operators::...
// Copyright 2020 <NAME> // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms...
use cid::Cid; use crate::pb::{FlatUnixFs, PBLink, UnixFs, UnixFsType}; use alloc::borrow::Cow; use core::fmt; use quick_protobuf::{MessageWrite, Writer}; use sha2::{Digest, Sha256}; /// File tree builder. Implements [`core::default::Default`] which tracks the recent defaults. /// /// Custom file tree builder can be ...
use std::{ convert::TryFrom, pin::Pin, task::{Context, Poll}, time::Duration, }; use async_channel as mpmc; use futures::{ pin_mut, stream::{self, Stream}, StreamExt, }; use pin_project::pin_project; use tonic::metadata::MetadataValue; use tracing::debug; use crate::{ auth::grpc::{Auth...
/* Copyright 2016 <NAME> * * Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or * http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or * http://opensource.org/licenses/MIT>, at your option. This file may not be * copied, modified, or distributed except according to those terms...
//! Drm/Kms types and backend implementations //! //! This module provide a `DrmDevice` which acts as a reprensentation for any drm //! device and can be used to create the second provided structure a `DrmBackend`. //! //! Initialization happens through the types provided by [`drm-rs`](https://docs.rs/drm/). //! //! Th...
//! core rendering and state logic use crate::debugger; use crate::ecs::{Component, Entity, UpdateInfo}; use crate::egui_util::EguiComponent; use crate::render::{RenderContext, ResizeBuffer}; use std::{collections, iter}; use wgpu::util::DeviceExt; use winit::{dpi, event, window}; /// wgpu::VertexBufferLayout that own...
//! //! Functions for parsing WAL records. //! use bytes::{Buf, Bytes}; use postgres_ffi::pg_constants; use postgres_ffi::xlog_utils::{TimestampTz, XLOG_SIZE_OF_XLOG_RECORD}; use postgres_ffi::XLogRecord; use postgres_ffi::{BlockNumber, OffsetNumber}; use postgres_ffi::{MultiXactId, MultiXactOffset, MultiXactStatus, Oi...
use std::{collections::BTreeMap, time::Instant}; use chrono::Utc; #[allow(unused_imports)] use log::{debug, error, info, trace, warn}; use crate::{ dds::{ participant::DomainParticipant, qos::HasQoSPolicy, reader::ReaderIngredients, rtps_reader_proxy::RtpsReaderProxy, rtps_writer_proxy::RtpsWriterProxy, top...
use super::lexical_env::LexicalEnv; use crate::lexer::{LexError, Token}; use crate::module::ModuleEnv; use crate::span::Span; use crate::symbols::Symbol; use crate::types::{Type, ID}; use itertools::Itertools; use std::ops::Range; use thiserror::Error; #[cfg(feature = "serialize_ast")] use serde::Serialize; ///! This...
use std::fmt::Debug; // 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 ...
use super::PerfPTConfig; use crate::errors::HWTracerError; use crate::{Block, ThreadTracer, Trace, Tracer, TracerState}; use libc::{c_char, c_int, c_void, free, geteuid, malloc, size_t}; use std::error::Error; use std::ffi::{self, CStr, CString}; use std::fmt::{self, Display, Formatter}; use std::fs::File; use std::io:...
use std::fmt::{Debug, Display, Error as FmtErr, Formatter}; use std::io::{self, BufRead, Write}; use std::iter::Peekable; use std::time::SystemTime; use termcolor::{ Color::{self, Green, Red, White}, ColorChoice, ColorSpec, StandardStream, WriteColor, }; use diffr_lib::*; mod cli_args; mod diffr_lib; #[deriv...
//! Helpers for working with change sets. use std::{fmt, time::Duration}; use chrono::{DateTime, Utc}; use enumset::EnumSet; use futures_util::TryFutureExt; use memmem::{Searcher, TwoWaySearcher}; use rusoto_cloudformation::{ Change, CloudFormation, CreateChangeSetInput, DescribeChangeSetError, DescribeChangeSetI...
//! Here we handle incoming connections and communication on the RPC socket. //! Actual JSONRPC2 commands are handled in the `api` mod. use crate::{ control::RpcUtils, jsonrpc::{ api::{JsonRpcMetaData, RpcApi, RpcImpl}, UserRole, }, }; use common::assume_some; use std::{ collections::{...
use super::batch::{Batch, BatchId, PendingBatches}; use crate::sync::block_processor::{spawn_block_processor, BatchProcessResult, ProcessId}; use crate::sync::network_context::SyncNetworkContext; use crate::sync::{RequestId, SyncMessage}; use beacon_chain::{BeaconChain, BeaconChainTypes}; use eth2_libp2p::{PeerAction, ...
//! Test assistant firmware //! //! Used to assist the test suite in interfacing with the test target. Needs to //! be downloaded to an LPC845-BRK board before the test cases can be run. #![no_main] #![no_std] extern crate panic_rtt_target; use core::marker::PhantomData; use heapless::FnvIndexMap; use lpc8xx_hal...
use std::mem; use std::ops::Deref; use std::os::raw::*; use std::ptr; use xplm_sys; use super::geometry::{Point, Rect}; /// Cursor states that windows can apply #[derive(Debug, Clone)] pub enum Cursor { /// X-Plane draws the default cursor Default, /// X-Plane draws an arrow cursor (not any other cursor ...
// silence unneeded_field_pattern due to offset_of, cast_ptr_alignment in memory management #![allow(clippy::unneeded_field_pattern, clippy::cast_ptr_alignment)] use arrayvec::ArrayVec; use ash::version::DeviceV1_0; use ash::{vk, Device}; use imgui::internal::RawWrapper; use imgui::{Context, DrawCmd, DrawCmdParams, Dr...
// Copyright (c) 2018-2020 MobileCoin Inc. //! The MobileCoin consensus service. use crate::{ admin_api_service, attested_api_service::AttestedApiService, background_work_queue::BackgroundWorkQueue, blockchain_api_service, byzantine_ledger::ByzantineLedger, client_api_service, config::Config, counters, ...
use serde::Deserialize; #[derive(Deserialize, Debug, Clone)] pub(crate) struct TgResponse<T> { /// If equals true, the request was successful and the result /// of the query can be found in the ‘result’ field pub ok: bool, /// Response object pub result: Option<T>, /// Human-readable descrip...
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021-Present Datadog, Inc. use core::fmt; use std::borrow::Borrow; use std::convert::TryInto; use std::has...
use super::validators::*; use super::*; use clap::{crate_authors, crate_name, crate_version, App, Arg}; type Parser<'a> = App<'a, 'a>; fn create_parser<'a>() -> Parser<'a> { let mut parser = App::new(crate_name!()) .version(crate_version!()) .author(crate_authors!()) .arg(Arg::with_name("c...
// Copyright (c) 2015-2017 The `img_hash` Crate Developers // // 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 distri...
use std::iter; use proc_macro2::TokenStream; use quote::{quote, quote_spanned, ToTokens}; use syn::{ punctuated::Punctuated, spanned::Spanned, Block, Expr, ExprAsync, ExprCall, FieldPat, FnArg, Ident, Item, ItemFn, Pat, PatIdent, PatReference, PatStruct, PatTuple, PatTupleStruct, PatType, Path, Signature, ...
//! Keccak [sponge function](https://en.wikipedia.org/wiki/Sponge_function). //! //! If you are looking for SHA-3 hash functions take a look at [`sha3`][1] and //! [`tiny-keccak`][2] crates. //! //! To disable loop unrolling (e.g. for constraint targets) use `no_unroll` //! feature. //! //! ``` //! // Test vectors are ...
// Copyright (c) 2017-2018, The rav1e contributors. All rights reserved // // This source code is subject to the terms of the BSD 2 Clause License and // the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License // was not distributed with this source code in the LICENSE file, you can // obtain it at ...
// Copyright (c) 2017 <NAME>, RWTH Aachen University // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed exc...
//! API for system configuration (SYSCON) //! //! The entry point to this API is [`SYSCON`]. Please refer to [`SYSCON`]'s //! documentation for additional information. //! //! This module mostly provides infrastructure required by other parts of the //! HAL API. For this reason, only a small subset of SYSCON functional...
#![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; use sp_std::prelude::*; use sp_std::cmp; use frame_support::{ensure, decl_module, decl_storage, decl_event, decl_error, dispatch}; use frame_system::{Module as System, ensure_signed, ensure_root}; use alloc::vec::Vec; use sp_runtime::{traits::AccountIdCon...
// Copyright 2020 Contributors to the Parsec project. // SPDX-License-Identifier: Apache-2.0 use super::Provider; use log::error; use log::{info, trace, warn}; use parsec_interface::operations::psa_algorithm::*; use parsec_interface::operations::psa_key_attributes::*; use parsec_interface::requests::ResponseStatus; use...
//! Tools for converting the [`ast`] (syntax tree) into an [`ivt`] //! (intermediate validation tree). //! //! This module is called "flatten" because its goal is to flatten syntax //! tree detail that's not useful for validation. //! //! [`ivt`]: crate::ivt //! [`ast`]: crate::ast use crate::ast; use crate::ivt::*; u...
use std::rc::Rc; use crate::local_env::LocalEnv; use crate::value::Extract; use crate::value::RefValue; use crate::GlobalEnv; use crate::GlobalWrite; use crate::Value; use std::cell::RefCell; use crate::ast::Ast; use crate::ast::QuasiQuote; use crate::build_top_ast; use crate::compile::build_top_ast_within_module; u...
//! Mixer API - Simple Mixer API for mixer control //! use std::ffi::{CStr, CString}; use std::{ptr, mem, fmt, ops}; use libc::{c_long, c_int, c_uint, c_short, pollfd}; use crate::poll; use crate::alsa; use super::Round; use super::error::*; const SELEM_ID_SIZE: usize = 64; /// wraps [snd_mixer_t](http://www.alsa-pr...
use std::mem; use std::marker::PhantomData; use byteorder::{LittleEndian, ByteOrder}; use allocator::Allocation; use persist::*; use memory::*; pub struct HashTable<'m, S: Storage + 'm, C: HashTableConfig = DefaultHashTableConfig> { data: Allocation, memory: &'m Memory<S>, config: PhantomData<C>, } impl<...
mod cause; pub mod domains; pub mod event; mod explanation; mod int_domains; mod presence_graph; pub use explanation::*; pub use cause::{Cause, InferenceCause}; use crate::bounds::{Bound, Disjunction, Relation}; use crate::expressions::ExprHandle; use crate::int_model::cause::{DirectOrigin, Origin}; use crate::int_m...
use std::collections::HashMap; use std::cmp::Ordering; use std::cmp; use std::iter::Iterator; use fancy_regex::Regex as FancyRegex; use regex::Regex; use chrono::{NaiveDate, Datelike, Local}; use scoring; use keygraph_rs::*; include!(concat!(env!("OUT_DIR"), "/frequency_data.rs")); lazy_static! { /// This map goe...
use super::export; use super::import_export_dtos::*; use crate::sql_util::insert_row; use diesel::dsl::count; use diesel::prelude::*; use projectpadsql::models::EnvironmentType; use projectpadsql::sqlite_is; use std::collections::HashSet; use std::path::{Path, PathBuf}; use std::{borrow, fs, process, str}; type Import...
use crate::{irc::*, MaybeOwned, MaybeOwnedIndex, Validator}; /// General notices from the server. #[derive(Clone, PartialEq)] pub struct Notice<'a> { raw: MaybeOwned<'a>, tags: TagIndices, channel: MaybeOwnedIndex, message: MaybeOwnedIndex, } impl<'a> Notice<'a> { raw!(); tags!(); str_fiel...
//! Main API entry point for reading and manipulating Metamath databases. //! //! A variable of type `Database` represents a loaded database. You can //! construct a `Database` object, then cause it to represent a database from a //! disk file using the `parse` method, then query various analysis results //! which wil...
use emulation_thread::EmulatorInput; use futures::executor::block_on; use gband::{Emulator, JoypadState}; use wgpu::util::DeviceExt; use strum_macros::EnumString; use std::{ fs::OpenOptions, io::{Read, Write}, net::SocketAddr, path::Path, sync::{atomic::AtomicBool, mpsc::Sender, Arc}, thread::...
use crate::{ error::{ArityError, GeneralError, RuntimeError}, grammar::{Form, Unparse}, intrinsic, list::List, }; use bigdecimal::BigDecimal; use im::{hashmap, HashMap, HashSet, Vector}; use num::{rational::Ratio, BigInt}; use std::cmp::{Eq, PartialEq}; use std::error::Error; use std::fmt::{self, Alignm...
// Copyright 2021 <NAME>, <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 ...
// This file is part of Substrate. // Copyright (C) 2018-2021 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the F...
// 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. //! Crate providing supporting proc-macros for the `spinel_pack` crate. //! //! **Don't use this crate directly**, use the `spinel_pack` crate instead. #!...
//! Usage: //! //! ``` no_run //! fn main() { //! puffin::set_scopes_on(true); // you may want to control this with a flag //! //! // game loop //! loop { //! puffin::GlobalProfiler::lock().new_frame(); //! //! { //! puffin::profile_scope!("slow_code"); //! slow_code(...
/* Authors: Dr. <NAME> Created: 25/08/2021 Last Modified: 29/08/2021 License: MIT */ extern crate rand; use std::env; use std::f64; use std::io::{Error, ErrorKind}; use std::path; use std::str; use std::time::Instant; use std::sync::mpsc; use std::sync::Arc; use std::thread; use num_cpus; use rand::Rng; use whitebo...
use std::{collections::BTreeMap, convert::TryFrom}; #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] pub enum Color { Black, Red, Green, Yellow, Blue, Magenta, Cyan, White, BrightBlack, BrightRed, BrightGreen, BrightYellow, BrightBlue, BrightMa...
use darling::{ util::{Flag, PathList, SpannedValue}, FromAttributes, FromMeta, }; use gobject_core::{ util, validations, PropertyOverride, PropertyPermission, PropertyStorage, TypeBase, TypeDefinition, }; use proc_macro2::{Span, TokenStream}; use quote::{quote, quote_spanned}; use syn::{parse_quote, spa...
//! Low level bindings for Ceph's RBD interface. //! Please see [Ceph librbd](http://docs.ceph.com/docs/master/rbd/librbdpy/#module-rbd) for more //! information. Those are the python docs but the parameters should be the same. #![allow(non_camel_case_types)] extern crate libc; extern crate librados_sys; use self::lib...
extern crate get_if_addrs; extern crate priority_queue; extern crate rand; extern crate simple_process_stats; extern crate tokio; extern crate ubyte; // Setup some tokens to allow us to identify which event is // for which socket. use get_if_addrs::{get_if_addrs, Interface}; use ipc::Message; use priority_queue::Prior...
//! A chat server that broadcasts a message to all connections. //! //! This example is explicitly more verbose than it has to be. This is to //! illustrate more concepts. //! //! A chat server for telnet clients. After a telnet client connects, the first //! line should contain the client's name. After that, all lines...
use crate::{ accessors, crypto::keccak256, etl::collector::*, kv::{tables, traits::*}, models::{Account, BlockNumber, RlpAccount, EMPTY_ROOT}, stagedsync::stage::{ExecOutput, Stage, StageInput, UnwindInput, *}, stages::stage_util::should_do_clean_promotion, StageId, }; use anyhow::{bail,...
//! Checks for usage of `&Vec[_]` and `&String`. use clippy_utils::diagnostics::{span_lint, span_lint_and_sugg, span_lint_and_then}; use clippy_utils::source::snippet_opt; use clippy_utils::ty::expr_sig; use clippy_utils::visitors::contains_unsafe_block; use clippy_utils::{get_expr_use_or_unification_node, is_lint_al...
// Copyright 2015 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 ...
use rtx::*; use rtx_on_rs::base::*; use rtx_on_rs::camera::*; use cgmath::{Deg, Matrix4}; use vulkan::SwapchainProperties; fn main() { env_logger::init(); ShadowsApp::new().run(); } struct ShadowsApp { base: BaseApp, rtx_data: RTXData, } impl ShadowsApp { fn new() -> Self { let base = Ba...
// Copyright 2017 pdb Developers // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to tho...
//! Modified version, originally from: https://github.com/jackm321/RustNN //! //! An easy to use neural network library written in Rust. //! //! # Description //! nn is a [feedforward neural network ](http://en.wikipedia.org/wiki/Feedforward_neural_network) //! library. The library //! generates fully connected multi-l...
// We don't care about final binary size, // we don't need to do anything fancy, // and no-one wants more than 255 chapters anyway // // Therefore, resist the temptation to write clever algorithms here; // this is fast, well-controlled, and reduces external dependencies. pub(super) const fn number_to_words(num: u8) ->...
//! Utility functions for working with X11 properties use std::convert::TryInto; use crate::connection::RequestConnection; use crate::cookie::{Cookie, VoidCookie}; use crate::errors::{ConnectionError, ParseError, ReplyError}; use crate::protocol::xproto::{self, Atom, AtomEnum, GetPropertyReply, Window}; use crate::x1...
// Copyright 2019 CoreOS, 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 in...