text stringlengths 7.05k 33.9k |
|---|
// Copyright 2013 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 super::utils::{bt_is_empty, instr_is_block_start, memory_arg_is_valid, ty_use_is_empty};
use super::{Fmt, Formatter};
use wast::{BlockType, BrTableIndices, Instruction, MemArg};
impl<'src> Fmt for &Instruction<'src> {
fn fmt(&self, formatter: &mut Formatter) {
if !instr_is_valid(self) {
uni... |
use std::collections::HashMap;
use std::fmt::Write;
use std::iter::Peekable;
use std::ops::Range;
use rustyline::Editor;
use unicode_segmentation::UnicodeSegmentation;
use unicode_width::UnicodeWidthStr;
use crate::app::MAX_BUFFER_SIZE;
use crate::flatjson::{Index, OptionIndex, PathType, Row, Value};
use crate::linep... |
// Copyright 2018 The Exonum 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 agreed to i... |
//! Format attributes and meta items.
use syntax::ast;
use syntax::source_map::{BytePos, Span, DUMMY_SP};
use syntax::symbol::sym;
use self::doc_comment::DocCommentFormatter;
use crate::comment::{contains_comment, rewrite_doc_comment, CommentStyle};
use crate::config::lists::*;
use crate::config::IndentStyle;
use cra... |
use std::str::FromStr;
use super::super::attributes::AllAttributes;
use crate::diagnostics::{DatamodelError, Diagnostics};
use crate::dml::ScalarType;
use crate::transform::helpers::ValueValidator;
use crate::{ast, configuration, dml, Field, FieldType};
use datamodel_connector::connector_error::{ConnectorError, ErrorK... |
use std::path::PathBuf;
use std::rc::Rc;
use std::sync::Arc;
use futures::{Sink, SinkExt, Stream, StreamExt};
use orion::kdf::SecretKey;
use tokio::net::{TcpListener, TcpStream};
use tokio::sync::{oneshot, Notify};
use tako::messages::gateway::{
CancelTasks, FromGatewayMessage, MonitoringEventRequest, StopWorkerR... |
use std::sync::Arc;
use std::time::{Duration, Instant};
use anyhow::Result;
use parking_lot::Mutex;
use tokio::sync::mpsc;
use ton_api::ton;
use super::incoming_transfer::*;
use super::outgoing_transfer::*;
use crate::adnl_node::AdnlNode;
use crate::subscriber::*;
use crate::utils::*;
#[derive(Clone)]
pub struct Tra... |
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//! Defines state structures for saving/restoring a Firecracker microVM.
// Currently only supports x86_64.
#![cfg(target_arch = "x86_64")]
use std::fmt::{Display, Formatter};
use std::fs::{File, OpenOpt... |
use std::collections::BTreeSet;
use abstutil::wraparound_get;
use geom::{Distance, Line, PolyLine, Pt2D, Ring};
use crate::{
Direction, DrivingSide, Intersection, IntersectionID, Lane, LaneID, LaneType, Map, Road, Turn,
TurnID, TurnType,
};
/// Generate Crosswalk and SharedSidewalkCorner (places where two si... |
mod alloc;
mod bind;
mod format;
mod mem;
pub mod frame;
pub mod texture;
use std::{collections::HashMap, sync::Arc};
use ash::vk;
use smithay::{
backend::{
allocator::Format as DrmFormat,
renderer::{Renderer, TextureFilter, Unbind},
},
reexports::wayland_server::protocol::wl_shm,
uti... |
use std::collections::HashMap;
use std::fs;
use std::fs::ReadDir;
use std::path::Path;
use rayon::prelude::*;
use crate::arc;
use crate::arc::{Arc, ArcChildData};
use crate::bres::BresChildData;
use crate::chr0::Chr0;
use crate::mdl0::bones::Bone;
use crate::sakurai::fighter_data::ArcFighterData;
use crate::sakurai::... |
// Copyright © 2015, <NAME>
// Licensed under the MIT License <LICENSE.md>
//! Standard WINNET Header File for WIN32
pub const WNNC_NET_MSNET: ::DWORD = 0x00010000;
pub const WNNC_NET_SMB: ::DWORD = 0x00020000;
pub const WNNC_NET_NETWARE: ::DWORD = 0x00030000;
pub const WNNC_NET_VINES: ::DWORD = 0x00040000;
pub const ... |
#![cfg(test)]
use chacha20::ChaCha20;
use crate::*;
use crate::types::*;
use littlefs2::{consts, fs::{Allocation, Filesystem}};
use littlefs2::const_ram_storage;
use interchange::Interchange;
use entropy::shannon_entropy;
use crate::client::{
CryptoClient as _,
};
pub struct MockRng(ChaCha20);
impl MockRng {
... |
use alloc::vec::Vec;
use alloc::{format, vec};
use core::marker::Copy;
use crate::buffer::ReadBuffer;
use crate::parsers::{Endian, FromBuffer};
use crate::record::StateMetadata;
use crate::EtError;
use crate::{impl_reader, impl_record};
/// The current state of the Inficon reader
#[derive(Clone, Debug, Default)]
pub ... |
use crate::eth::{error::PoolError, util::hex_fmt_many};
use anvil_core::eth::transaction::{PendingTransaction, TypedTransaction};
use ethers::types::{Address, TxHash, U256};
use parking_lot::RwLock;
use std::{
cmp::Ordering,
collections::{BTreeSet, HashMap, HashSet},
fmt,
str::FromStr,
sync::Arc,
... |
// Copyright 2018 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.
#![deny(missing_docs)]
use {
crate::net::EventedFd,
futures::{
future::Future,
io::{AsyncRead, AsyncWrite},
ready,
... |
//! Key structs and serialization.
use bech32::{FromBase32, ToBase32};
use curve25519_dalek::edwards::EdwardsPoint;
use rand::{rngs::OsRng, RngCore};
use secrecy::{ExposeSecret, Secret, SecretString};
use std::convert::TryInto;
use std::fmt;
use std::fs::File;
use std::io::{self, BufRead, BufReader};
use x25519_dalek:... |
use std::fmt::Display;
use std::time::Duration;
use async_std::net::ToSocketAddrs;
use async_std::pin::Pin;
use async_trait::async_trait;
use log::{debug, info};
use pin_project::pin_project;
use crate::smtp::authentication::{
Credentials, Mechanism, DEFAULT_ENCRYPTED_MECHANISMS, DEFAULT_UNENCRYPTED_MECHANISMS,
}... |
use core::ptr;
use core_io::Write;
use super::types::*;
use super::{errno, Pal};
use c_str::CStr;
use header::dirent::dirent;
use header::signal::SIGCHLD;
// use header::sys_resource::rusage;
use header::sys_stat::stat;
use header::sys_statvfs::statvfs;
use header::sys_time::{timeval, timezone};
// use header::sys_tim... |
use std::cell::RefCell;
use std::rc::Rc;
use crate::dom::window;
use crate::shapes::{Circle, Collides, Rectangle, Shape};
use crate::sprite::Sprite;
use crate::sprite_renderer::SpriteRenderer;
use crate::sprite_shader::SpriteShader;
use crate::terrain::{generate_terrain_contour, new_terrain_sprite, generate_terrain_ma... |
//! `crypto_secretbox_xsalsa20poly1305`, a particular
//! combination of Salsa20 and Poly1305 specified in
//! [Cryptography in NaCl](http://nacl.cr.yp.to/valid.html).
//!
//! This function is conjectured to meet the standard notions of privacy and
//! authenticity.
use ffi;
#[cfg(not(feature = "std"))]
use prelude::*;... |
use std::time::UNIX_EPOCH;
use deno_core::{ModuleId, ZeroCopyBuf, error::anyhow, json_op_sync};
use deno_core::url::Url;
use deno_core::error::AnyError;
use crate::deno::metrics::*;
use deno_core::{ModuleSpecifier};
use std::{env, sync::Arc, time::SystemTime};
use std::rc::Rc;
use crate::ROOT_DIR;
use deno_core::{GetEr... |
//! Contains the configuration of what is executed each time a pattern is found in the logfile. It could be either a spawned script, a TCP socket to which send
//! relevant data, or a Unix Datagram Socket. For the 2 latter cases, found data are sent as a JSON string. Otherwise, when a script is called, data are sent
//... |
// surfman/surfman/src/platform/windows/angle/surface.rs
//
//! Surface management for Direct3D 11 on Windows using the ANGLE library as a frontend.
use crate::context::ContextID;
use crate::egl::types::EGLNativeWindowType;
use crate::egl::types::EGLSurface;
use crate::egl::{self, EGLint};
use crate::gl::types::{GLenu... |
use crate::client::{BlockingHttpClient, HttpError};
use crate::cve::{Cve, CveContainer, CveFeed};
use crate::feed::{Feed, Metafile, MetafileError};
use chrono::NaiveDateTime;
use humansize::{file_size_opts as options, FileSize};
use log::debug;
use rusqlite::{params, Connection, Result, Transaction, TransactionBehavior... |
use crate::models::{
Channel, Emoji, Permissions, Role, Snowflake, StageInstance, Sticker,
Timestamp, User, VoiceState,
};
use bitflags::bitflags;
use serde::{Deserialize, Serialize};
use std::borrow::Cow;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Guild {
id: Snowflake,
name: String,
... |
#![cfg(target_os = "windows")]
use std::ptr;
use std::mem;
use std::ffi::{OsStr};
use std::os::windows::ffi::OsStrExt;
use winapi::shared::windef::{HWND, RECT, POINT, HBRUSH};
use winapi::shared::minwindef::{FALSE, WPARAM, LPARAM, LRESULT, UINT, DWORD, HINSTANCE};
use winapi::um::winnt::{LONG, LPCWSTR, VOID};
use w... |
use crate::language::{IntType, Access};
use crate::codegen::{OpCode, LocalIndex, UpvalueTarget};
use crate::debug::traceback::TraceSite;
use crate::runtime::Variant;
use crate::runtime::gc::Gc;
use crate::runtime::function::{Function, Upvalue, UpvalueIndex};
use crate::runtime::strings::StringSymbol;
use crate::runtime... |
/* MIT License
*
* Copyright (c) 2019 <NAME> <<EMAIL>>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, mo... |
//! Details of the `ruma_api` procedural macro.
use std::convert::{TryFrom, TryInto as _};
use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use syn::{
braced,
parse::{Parse, ParseStream},
Field, FieldValue, Ident, Token,
};
mod attribute;
mod metadata;
mod request;
mod response;
use s... |
//
// Copyright 2018 The Project Oak 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 o... |
use serde::de::{Deserializer, Error as DeError, Visitor};
use serde::Deserialize;
use once_cell::sync::OnceCell;
use std::collections::HashMap;
static CONFIG: OnceCell<Config> = OnceCell::new();
/// The window configuration object.
#[derive(PartialEq, Deserialize, Debug)]
#[serde(tag = "window", rename_all = "camelC... |
use std::fs::{File, OpenOptions};
use crate::page::{Page, PageType, Pos, PageError, PAGE_SIZE, PTR_SIZE};
pub use crate::byte::*;
use anyhow::Result;
use std::fmt::Debug;
use std::rc::Rc;
use std::cell::{RefCell, RefMut};
use crate::pager_manager::Pager_manager;
use crate::db_str::Db_str;
use crate::data_item::{Data_it... |
//! Mount options for filesystems.
use crate::{IGNITED_TARGET_ROOT_PATH, KConsole, PROGRAM_NAME};
use nix::{
errno::Errno,
mount::{mount, umount2, MntFlags, MsFlags},
sys::stat::Mode,
unistd::mkdir,
};
use precisej_printable_errno::{printable_error, ErrnoResult, PrintableErrno};
use std::{
path::{P... |
pub mod problems;
pub mod functions;
pub mod constraints;
pub mod solvers;
#[cfg(test)]
mod tests {
use math::variables::{AbstVar, new_var, new_const};
use math::relationships::Relationship;
use math::expressions::Expression;
use objective::problems::ProblemType;
use objective::functions::Function;... |
use std::error::Error;
use csv::StringRecord;
use getset::{Getters, MutGetters, Setters};
use itertools::Itertools;
use maplit::hashmap;
use reqwest::blocking::Client;
use serde::export::fmt::Debug;
use serde::{Deserialize, Serialize};
use serde_with;
use serde_with::CommaSeparator;
use serde_xml_rs::from_reader;
use ... |
// This file is part of Substrate.
// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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
//
// ht... |
//! Create and manage distributed applications in Rust.
//!
//! Built with the motto - *Plug the crate in, it'll be taken care of.*
//!
//! ## Usage
//! ```rust
//! # use cloud_discovery_kubernetes::KubernetesDiscoverService;
//! # use std::sync::Arc;
//! # use rust_cloud_discovery::DiscoveryClient;
//! # use cluster_m... |
//! Module containing the definitions and processing of supported assets on the Kraken exchange
use std::fmt;
use std::fmt::{Debug, Display};
use std::str::FromStr;
use std::convert::TryFrom;
use serde::{Deserialize, Serialize};
use serde::de::Deserializer;
use crate::error::{KError, KrakenErrors};
// TODO: Query As... |
use std::cell::{Cell, RefCell};
use std::os::unix::io::{AsRawFd, RawFd};
use std::os::unix::net::UnixStream;
use std::rc::Rc;
use nix::poll::PollFlags;
use once_cell::unsync::OnceCell;
use crate::handshake::{Authenticated, ClientHandshake, ServerHandshake};
use crate::raw::Connection as RawConnection;
use crate::util... |
#![doc(html_root_url = "http://docs.rs/qapi-codegen/0.5.0")]
use qapi_parser::{Parser, QemuFileRepo, QemuRepo, spec};
use qapi_parser::spec::Spec;
use std::collections::{HashMap, HashSet};
use std::path::{Path, PathBuf};
use std::fs::File;
use std::io::{self, Write};
use std::mem::replace;
// kebab-case to PascalCase... |
pub mod effects;
mod lists;
mod logics;
mod maps;
mod math;
pub mod meta;
mod records;
mod refs;
mod sets;
mod strings;
pub mod syntax;
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
use crate::call_stack::CallStackList;
use crate::primes::{Calcit, CalcitErr, CalcitItems, CalcitScope, CalcitSyntax};
pu... |
use super::Scheme;
use crate::archive::{self, FileContents};
use anyhow::Context;
use bytes::BytesMut;
use encoding_rs::SHIFT_JIS;
use once_cell::sync::Lazy;
use positioned_io::{RandomAccessFile, ReadAt};
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
use scroll::{Pread, LE};
use std::{collections::HashM... |
// Copyright 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) any la... |
/*!
# Yesvgmap: Boundaries
*/
use crate::SvgError;
use fyi_msg::Msg;
use std::{
fmt,
path::{
Path,
PathBuf,
},
};
use svg::{
node::{
Attributes,
element::{
Element,
Symbol,
tag::Type,
SVG,
},
Node,
Value,
},
parser::{
Event,
Parser,
},
};
#[derive(Debug, Clone)]
/// # SVG Map.
/... |
use alloc::vec::Vec;
use core::mem::size_of;
use once_cell::sync::Lazy;
use tiny_keccak::{Hasher, Keccak};
use zkp_u256::{Zero, U256};
use super::*;
// ceil(log2(1<<20))
static TREE_DEPTH: usize = 10;
// 1<<20 leaves
const MAX_LEAF_COUNT: usize = 1024;
static FILL_LEVEL_IVS: Lazy<Vec<U256>> = Lazy::new(|| {
le... |
use std::collections::{vec_deque::Drain, HashMap, VecDeque};
use bevy_ecs::prelude::*;
use bevy_ecs::schedule::RunOnce;
use gdnative::api::{GlobalConstants, ImageTexture, ProjectSettings, StreamTexture, VisualServer};
use gdnative::prelude::*;
use rapier2d::prelude::{
nalgebra, vector, ActiveCollisionTypes, Active... |
// Miniscript
// Written in 2019 by
// <NAME> <<EMAIL>>
//
// To the extent possible under law, the author(s) have dedicated all
// copyright and related and neighboring rights to this software to
// the public domain worldwide. This software is distributed without
// any warranty.
//
// You should have received a ... |
use std::collections::BTreeMap;
use std::fmt;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::time::Duration;
use actix_web::error::PayloadError;
use bytes::Bytes;
use chrono::{DateTime, Utc};
use futures::Stream;
use log::info;
use milli::update::IndexDocumentsMethod;
use serde::{Deserialize, Serialize};... |
/*
This code is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 21/06/2017
Last Modified: 10/02/2021
License: MIT
*/
/*!
WhiteboxTools is an advanced geospatial data analysis platform developed at
the University of Guelph's Geomorphometry and Hydrogeomatics Research Group (GHRG).
W... |
//! Groth20 forward secure encryption API.
//!
//! This file translates to and from an external library that does the
//! mathematics.
use super::types::{FsEncryptionKeySetWithPop, FsEncryptionSecretKey};
use super::ALGORITHM_ID;
use crate::api::ni_dkg_errors::CspDkgVerifyDealingError;
use crate::api::ni_dkg_errors::{... |
use std::fmt;
use std::str::FromStr;
use chrono::{DateTime, Utc};
use failure::Fail;
use serde::{Deserialize, Serialize, Serializer};
#[cfg(test)]
use chrono::TimeZone;
use crate::processor::ProcessValue;
use crate::protocol::{
Breadcrumb, ClientSdkInfo, Contexts, Csp, DebugMeta, Exception, ExpectCt, ExpectStapl... |
// Copyright 2022, 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 agreed t... |
use crate::Config;
use bitcoin::{
network::{constants::ServiceFlags, Address},
Network,
};
use ic_logger::{debug, info, ReplicaLogger};
use rand::{
prelude::{IteratorRandom, SliceRandom, StdRng},
SeedableRng,
};
use std::{
collections::{HashSet, VecDeque},
net::{SocketAddr, ToSocketAddrs},
};
us... |
use super::{ErrorPage, Headers, Location, ServerConfig, SiteConfig};
use crate::conf::{Block, BlockExt, DirectiveExt};
use crate::util::{self, absolute_path};
use crate::{check_none, check_off, check_value, compress, config, exit, matcher, option};
use compress::CompressMode;
use config::tls::{create_sni_server_config,... |
// TODO simple
// graph-log
// terminal user interface for graph logging
// [sup ] ----------------> [fare-0: || ]
// ----------------> [fare-1: || ]
use std::io::{BufRead, Stdin, Stdout, stdin, stdout};
use std::{thread, time};
use tui::{
backend::{
// RustboxBackend... |
use bytes::Bytes;
use fs;
use futures::unsync::mpsc::{self, UnboundedReceiver, UnboundedSender};
use futures::{future, Async, Future, IntoFuture, Stream};
use never::Never;
use notify_cell::{NotifyCell, NotifyCellObserver};
use project::LocalProject;
use rpc::{self, client, server};
use serde_json;
use std::cell::RefCe... |
use crate::{
bindings::signal::siginfo_t,
event::EventType::{
EvDesched, EvExit, EvGrowMap, EvInstructionTrap, EvNoop, EvPatchSyscall, EvSched,
EvSeccompTrap, EvSentinel, EvSyscall, EvSyscallInterruption, EvSyscallbufAbortCommit,
EvSyscallbufFlush, EvSyscallbufReset, EvTraceTermination,
... |
// 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 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use std::fmt::{Display, Formatter};
use std::fs::OpenOptions;
use std::io::{Seek, SeekFrom};
use std::path::Path;
use std::result;
use std::sync::{Arc, Mutex};
use super::Vmm;
use super::Error as VmmErro... |
use lazy_static::lazy_static;
use std::borrow::Cow;
use unicode_segmentation::UnicodeSegmentation;
use crate::{
app::{layout_manager::WidgetDirection, App},
canvas::{
drawing_utils::{get_column_widths, get_start_position},
Painter,
},
constants::*,
data_conversion::ConvertedCpuData,... |
//! A platform agnostic Rust driver for the RFM69 wireless chips, which are based on the
//! SX1231 chip. This crates uses the
//! [`embedded_hal`](https://github.com/japaric/embedded_hal) traits.
//!
//! ## The Device
//!
//! There are multiple variants of the RFM69, which this crate aims to support.
//! Products with... |
use std::collections::HashMap;
use std::sync::RwLock;
use ::{Instruction, InstructionEncodingError, Mnemonic, Mode, Operand, OperandSize, Reg, RegType};
use ::instruction_buffer::InstructionBuffer;
use ::instruction_defs::INSTR_DEFS;
#[derive(Debug)]
pub struct InstructionDefinition {
pub allow_prefix: bool,
p... |
use anyhow::{anyhow, Result};
use std::fs;
use std::fs::File;
use std::io::Write;
use std::path::Path;
use pulldown_cmark::{html, Options, Parser};
use serde::Deserialize;
use yaml_rust::YamlLoader;
use crate::directory_handling::check_and_create_directory;
use crate::site_data::{convert_datetime, Site};
#[derive(Cl... |
//! Paragraph builder.
use super::bidi::*;
use super::builder_data::*;
use super::font::{internal::*, Font, FontLibrary};
use super::span_style::*;
use super::Paragraph;
use super::{SpanId, MAX_ID};
use core::borrow::Borrow;
use swash::shape::{self, ShapeContext};
use swash::text::cluster::{CharCluster, CharInfo, Pars... |
//! Uses a private GitHub repository to syncronize passwords.
//! An empty file called VPassFile is used to mark this as a vpass repository
use super::super::{Error, SyncProvider, SyncResult, UpdateKey};
use crate::VResult;
use base64;
use reqwest::header::{HeaderMap, AUTHORIZATION};
use reqwest::Response;
use serde:... |
/**
* @File : vector3.rs
* @Author : dtysky (<EMAIL>)
* @Link : http://dtysky.moe
* @Date : 2019/2/7 下午9:53:03
*/
use wasm_bindgen::prelude::*;
use super::common::*;
use super::matrix3::*;
use super::matrix4::*;
use super::quaternion::*;
#[wasm_bindgen]
pub struct Vector3(pub f32, pub f32, pub f32);
#[was... |
//! [`SourceMap`] is a structure holding all of the source code used in a
//! compilation.
//!
//! It is inspired by the analagous `SourceManager` in clang. In addition to holding the source
//! code, it is responsible for tracking detailed location information within the code, and can
//! resolve a [`SourcePos`] or [`... |
//! Recognizes URL patterns with support for dynamic and wildcard segments
//!
//! # Examples
//!
//! ```
//! use route_recognizer::{Router, Params};
//!
//! let mut router = Router::new();
//!
//! router.add("/thomas", "Thomas".to_string());
//! router.add("/tom", "Tom".to_string());
//! router.add("/wycats", "Yehuda"... |
use std::fmt;
use std::fs;
use std::fs::OpenOptions;
use std::path::PathBuf;
use std::time::SystemTime;
use csv::{WriterBuilder, ReaderBuilder};
use handlebars::Handlebars;
use parser::{html_from_markdown, PostData};
use templates::{AllTemplates, TemplateError, PATH_POST, PATH_INDEX};
use rss::{CoreData, RSSError, Rss... |
mod gk;
mod master_key;
use crate::std::convert::TryInto;
use crate::{benchmark, std::prelude::v1::*, types::BlockInfo};
use anyhow::Result;
use core::fmt;
use log::info;
use chain::pallet_registry::RegistryEvent;
pub use enclave_api::prpc::{GatekeeperRole, GatekeeperStatus};
use parity_scale_codec::{Decode, Encode};... |
use crate::CoordinateTuple;
/// Handler for the **G**eodetic grid **A**uthoring **S**ystem
#[derive(Debug, Default)]
pub struct Gas {
header: GasHeader,
grid: Vec<f64>,
}
#[derive(Debug, Default)]
pub struct GasHeader {
bbox: [CoordinateTuple; 2],
delta: CoordinateTuple,
dim: [usize; 5],
skip:... |
// Lumol, an extensible molecular simulation engine
// Copyright (C) Lumol's contributors — BSD license
//! This module allow to convert from and to the internal unit system.
//!
//! Internal units are:
//!
//! - Angstrom (A) for distances;
//! - femtosecond (fs) for time;
//! - Unified atomic mass unit (u or Da) f... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Clock Control Register"]
pub clc: CLC,
_reserved1: [u8; 4usize],
#[doc = "0x08 - Module Identification Register"]
pub id: ID,
_reserved2: [u8; 28usize],
#[doc = "0x28 - OCDS Control and Status Register"]
pub... |
use crate::{Hermite, Particle, Spin, Vector, a, det};
use nalgebra::{SMatrix, base::dimension::DimMin, Const};
// Hard-coding quantum states of up to 20 particles. This is done for speed, an should be
// generalized if this code is to be used seriously
pub const QUANTUM_NUMBERS: [(usize, usize, Spin); 20] = [
(0, ... |
//! A rectangle with rounded corners.
use std::f64::consts::{FRAC_PI_2, FRAC_PI_4};
use std::ops::{Add, Sub};
use crate::{arc::ArcAppendIter, Arc, PathEl, Point, Rect, RoundedRectRadii, Shape, Size, Vec2};
/// A rectangle with equally rounded corners.
///
/// By construction the rounded rectangle will have
/// non-n... |
/*
Copyright 2017 <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, softw... |
use crate::channel::{tcp, DomainConnectionBuilder, TcpSender};
use crate::data::*;
use crate::debug::trace::Tracer;
use crate::error::TransportError;
use crate::internal::*;
use crate::{ExclusiveConnection, LocalOrNot, SharedConnection};
use nom_sql::CreateTableStatement;
use std::cell::RefCell;
use std::collections::H... |
//! # Presolving linear programs
//!
//! A `GeneralForm` can be presolved by building an index, repeatedly applying reduction rules and
//! applying the changes proposed. This module contains data structures and logic for presolving.
use std::iter::Iterator;
use crate::data::linear_algebra::traits::SparseElement;
use ... |
// Copyright (C) 2018-2019, Cloudflare, 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... |
// Copyright 2021 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 ... |
#![no_std]
//! This HAL takes a layered approach.
//!
//! 1. raw PAC peripherals
//! 1. HAL peripheral wrappers (under `peripherals`)
//! 1. HAL drivers (under `drivers`, typically take ownership of one or more peripherals)
//!
//! The middle layer is quite thin, notably we model pins and the clock tree
//! as drivers... |
use cargo_platform::Platform;
use log::trace;
use semver::VersionReq;
use serde::ser;
use serde::Serialize;
use std::borrow::Cow;
use std::fmt;
use std::path::PathBuf;
use std::rc::Rc;
use crate::core::compiler::{CompileKind, CompileTarget};
use crate::core::{PackageId, SourceId, Summary};
use crate::util::errors::Car... |
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
//! Engines for use in the test suite, implementing both the KvEngine
//! and RaftEngine traits.
//!
//! These engines link to all other engines, providing concrete single storage
//! engine type to run tests against.
//!
//! This provides a simple way... |
//! 任务池
//! 可以向任务池中放入不同权重的任务,任务池提供弹出功能,任务池大概率会弹出权重高的任务。
//! 任务池支持的任务可以大致分为三类:
//! 1. 串行任务:插入串行任务需要先创建队列,放入到同一个队列的任务,会按顺序弹出。
//! 创建队列会返回队列key,可以通过该key获取队列引用。
//! 可以获得队列状态-是否被锁定,可以从队列头或尾放入任务,也可弹出任务。
//! 可设置队列权重。调整队列权重立刻在下一次弹出队列时生效。
//! 队列可以设置为弹出任务后自动锁定,直到外部将队列解开锁定,锁定的队列不会在弹出任务。
... |
use crate::components::{EditState, Icon, ToolPalette, Sprite, CollisionsPoint, FallingBlock, Hitbox, Moveable, PlatformController, Triggerbox, EditBtn, DragBox, Position};
use raylib::consts::KeyboardKey::*;
use raylib::consts::MouseButton::*;
use raylib::prelude::*;
use specs::{
prelude::*,
saveload::{
... |
use thoth_api::model::funding::FundingWithInstitution;
use thoth_api::model::institution::Institution;
use uuid::Uuid;
use yew::html;
use yew::prelude::*;
use yew::ComponentLink;
use yewtil::fetch::Fetch;
use yewtil::fetch::FetchAction;
use yewtil::fetch::FetchState;
use yewtil::future::LinkFuture;
use yewtil::NeqAssig... |
use crate::compositor::{Component, Compositor, Context, EventResult};
use crate::{alt, ctrl, key, shift, ui};
use crossterm::event::Event;
use helix_view::input::KeyEvent;
use helix_view::keyboard::KeyCode;
use std::{borrow::Cow, ops::RangeFrom};
use tui::buffer::Buffer as Surface;
use tui::widgets::{Block, Borders, Wi... |
use fltk::{
app,
enums::Event,
prelude::{WidgetBase, WidgetExt, GroupExt, WindowExt},
window::{GlutWindow, Window},
};
use image::*;
use image::io::Reader as ImageReader;
use speedy2d::{GLRenderer, color::*, dimen::Vector2, image::*, font::*, shape::*};
use dyn_clone::DynClone;
use std::cell::RefCell... |
//! # Fee Module
//! Based on the [specification](https://interlay.gitlab.io/polkabtc-spec/spec/fee.html).
#![deny(warnings)]
#![cfg_attr(test, feature(proc_macro_hygiene))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(any(feature = "runtime-benchmarks", test))]
mod benchmarking;
mod default_weights;
#[cfg(test... |
use super::hash::{Hashable, H256};
use ring::{digest};
use log::info;
/// A Merkle tree.
//Use Option<Box<>> for Tree implementation
//Tree implementation reference: https://gist.github.com/aidanhs/5ac9088ca0f6bdd4a370
#[derive(Debug, Default, Clone)]
pub struct TreeNode {
val: H256,
left: Option<Box<TreeNode>... |
use super::*;
use app::constants::*;
use app::Event;
use backend::messagebus::{Inbox, Message, PubSub, ReceiveDrain, Whiteboard};
use backend::obj;
use backend::obj::*;
use backend::world;
use backend::world::agent;
use backend::world::segment;
use backend::world::segment::Intent;
use backend::world::segment::PilotRota... |
#[cfg(feature = "zstd")]
use zstd::block::{compress, decompress};
use crate::*;
use super::{
arr_to_u32, pwrite_all, raw_segment_iter_from, u32_to_arr, u64_to_arr,
BasedBuf, DiskPtr, HeapId, LogIter, LogKind, LogOffset, Lsn, MessageKind,
};
/// A snapshot of the state required to quickly restart
/// the `Pag... |
// Copyright (c) 2020 <NAME> <<EMAIL>>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publi... |
// 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 std::collections::hash_map::DefaultHasher;
use std::collections::HashMap;
use std::ffi::OsStr;
use std::hash::Hasher;
use std::path::{Path, PathBuf};
use std::str;
use crate::code_move::{new_module, NewModuleCtx};
use crate::collector::global_collect;
use crate::entry_strategy::EntryPolicy;
use crate::transform::{... |
use std::mem;
use reader_writer::{FourCC, Reader};
use structs::{Connection, ConnectionMsg, ConnectionState, Pickup, Resource, ResourceKind};
use crate::{custom_asset_ids,door_meta::DoorLocation};
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub enum PickupType
{
Missile,
EnergyTank,
ThermalVisor,
... |
use std::{cmp::Ordering, fmt::Write, iter, sync::Arc, time::Duration};
use enterpolation::{linear::Linear, Curve};
use eyre::Report;
use image::{
codecs::png::PngEncoder, ColorType, DynamicImage, GenericImageView, ImageEncoder, Luma, Pixel,
};
use plotters::{
element::{Drawable, PointCollection},
prelude::... |
// Copyright 2016 Openmarket
//
// 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 w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.