text stringlengths 7.05k 33.9k |
|---|
// Copyright 2018-2021 <NAME>.
// See the "LICENSE.txt" file at the top-level directory of this distribution.
//
// Licensed under the the MIT license. This file may not be copied, modified,
// or distributed except according to those terms.
use std::mem;
use goblin::pe::section_table::{IMAGE_SCN_CNT_INITIALIZED_DATA... |
//! GraphSON V1 [docs](http://tinkerpop.apache.org/docs/current/dev/io/)
//!
use crate::structure::{
Edge, GKey, GValue, IntermediateRepr, List, Map, Metric, Path, Property, TraversalExplanation,
TraversalMetrics, Vertex, VertexProperty, GID,
};
use crate::GremlinError;
use crate::GremlinResult;
use serde_json... |
// Copyright © 2018 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use, copy, modify, merge, publish,
// distribu... |
/*!
# Bootstrap containers
bootstrap-containers ensures that bootstrap containers are executed as defined in the system settings
It queries the API for their settings, then configures the system by:
* creating a user-data file in the host container's persistent storage area, if a base64-encoded
user-data setting i... |
#![forbid(unsafe_code)]
//! Parses and serializes the JSON dependency tree embedded in executables by the
//! [`auditable`](http://docs.rs/auditable/) crate.
//!
//! This crate defines the data structures that a serialized to/from JSON
//! and implements the serialization/deserialization routines via `serde`.
//! It a... |
mod cheatbook;
use bevy::{app::Events, math::Vec3Swizzles, prelude::*};
use example_shared::{AllExistingMoles, ClientMessage, ServerMessage};
use litlnet_client_bevy::{ClientPlugin, MessagesToRead, MessagesToSend};
#[cfg(target_arch = "wasm32")]
type ComClient = litlnet_websocket_web::WebsocketClient;
#[cfg(not(tar... |
use imgui::{
Context, DrawCmd::Elements, DrawData, DrawIdx, DrawList, DrawVert, TextureId, Textures,
};
use smallvec::SmallVec;
use std::error::Error;
use std::fmt;
use std::mem::size_of;
use wgpu::util::{BufferInitDescriptor, DeviceExt};
use wgpu::*;
pub type RendererResult<T> = Result<T, RendererError>;
#[cfg(f... |
// search(D, value)
// insert(D, value)
// delete(D, value)
// min(D)
// max(D)
// successor(D, node)
// predecessor(D, node)
pub fn fn_01(s: &str) -> Option<usize> {
// [3] A common problem for compilers and text editors is determining
// whether the parentheses in a string are balanced and properly nested. F... |
// Copyright 2020 The Matrix.org Foundation C.I.C.
//
// 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... |
// Source: https://www.iso.org/obp/ui/#search
pub const AD: &str = "Andorre (l')";
pub const AE: &str = "Émirats arabes unis (les)";
pub const AF: &str = "Afghanistan (l')";
pub const AG: &str = "Antigua-et-Barbuda";
pub const AI: &str = "Anguilla";
pub const AL: &str = "Albanie (l')";
pub const AM: &str = "Arménie (l'... |
use std::{
str::FromStr,
f64,
rc::Rc,
};
use crate::common::{
source::Source,
span::{ Span, Spanned },
data::Data,
};
use crate::compiler::{
token::Token,
syntax::Syntax,
};
type Bite = (Token, usize);
/// Simple function that lexes a source file into a token stream.
/// Exposes the ... |
#[cfg(test)]
use smallstring::SmallString;
#[cfg(test)]
use smallvec::SmallVec;
use std::fs;
use std::os::unix::fs::PermissionsExt;
use shell::Shell;
#[cfg(test)]
use shell::flow_control::{Function, Statement};
#[cfg(test)]
use shell;
pub(crate) fn exists(args: &[&str], shell: &Shell) -> Result<bool, String> {
le... |
use clap::{app_from_crate,crate_name,crate_description,crate_authors,crate_version,Arg};
use std::collections::HashMap;
use std::path::Path;
use rust_htslib::{bam, bam::Read};
use std::str::from_utf8;
use bio::io::fasta::IndexedReader;
use chrono::{DateTime, Local};
use std::error;
use std::process;
use std::env;
use i... |
/* Copyright (C) 2018 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARR... |
#![allow(clippy::large_enum_variant)]
use serde::{de::MapAccess, Deserialize, Serialize, Serializer};
use serde_json::Value;
use crate::types::{
CallbackQuery, Chat, ChatJoinRequest, ChatMemberUpdated, ChosenInlineResult, InlineQuery,
Message, Poll, PollAnswer, PreCheckoutQuery, ShippingQuery, User,
};
/// Th... |
use crate::{
error::RuntimeError,
export::{Context, Export, FuncPointer},
import::IsExport,
types::{FuncSig, NativeWasmType, Type, WasmExternType},
vm::{self, Ctx},
};
use std::{
any::Any,
convert::Infallible,
ffi::c_void,
fmt,
marker::PhantomData,
mem, panic,
ptr::{self,... |
use std::collections::HashSet;
use model::{self,Penalty,Model,Instance,PreorderParams};
use precomputed::{self,Precomputed};
use std::result;
use std::fmt;
use std::convert::From;
use std::io::{Read,Write};
use rpc_common::{Subject,ChoiceRow};
use codec::{self,Encode,Decode,Packed};
use std::iter::FromIterator;
use ray... |
#[macro_use]
extern crate glium;
use glium::{Display, Frame, glutin, Program, Surface};
use glium::glutin::dpi::PhysicalPosition;
#[derive(Copy, Clone)]
struct Point {
position: [f32; 2],
}
implement_vertex!(Point, position);
impl Point {
fn new(position: [f32; 2]) -> Point {
Point { position: positio... |
// store in thread_local
use crate::facades::{QuickJsRuntimeFacade, QuickjsRuntimeFacadeInner};
use crate::quickjs_utils::modules::{
add_module_export, compile_module, get_module_def, get_module_name, new_module,
set_module_export,
};
use crate::quickjs_utils::{gc, interrupthandler, modules, promises};
use cra... |
//! Async Groth16 batch verifier service
use std::{
convert::{TryFrom, TryInto},
error::Error,
fmt,
future::Future,
mem,
pin::Pin,
task::{Context, Poll},
};
use bellman::{
gadgets::multipack,
groth16::{batch, VerifyingKey},
VerificationError,
};
use bls12_381::Bls12;
use future... |
#![deny(unsafe_code)]
pub mod surface;
pub mod error;
pub mod debug_renderer;
// Framework wraps all OpenGL calls so it has to be unsafe. Rest of renderer
// code must be safe.
#[macro_use]
#[allow(unsafe_code)]
mod framework;
mod ui_renderer;
mod particle_system_renderer;
mod gbuffer;
mod deferred_light_renderer;
m... |
use std::fmt::{Debug, Display, Formatter, Result as FmtResult};
use std::rc::Rc;
use std::mem;
use std::collections::HashMap;
use std::cell::RefCell;
use ast::*;
use lexer::*;
use super::environment::Environment;
pub struct Interpreter {
current_environment: Environment,
global_environment: Environment,
l... |
use crate::{
bindings::{ptrace::*, signal::siginfo_t},
flags::Flags,
kernel_abi,
kernel_abi::SupportedArch,
kernel_supplement::PTRACE_EVENT_SECCOMP_OBSOLETE,
};
use nix::sys::mman::ProtFlags;
pub fn syscall_name(syscall: i32, arch: SupportedArch) -> String {
let name = rd_kernel_abi_arch_functi... |
#[macro_use] extern crate serde_derive;
extern crate serde;
extern crate serde_json;
extern crate restson;
extern crate base64;
extern crate tempfile;
extern crate rodio;
#[macro_use] extern crate clap;
extern crate hound;
extern crate cpal;
extern crate audrey;
extern crate file;
use clap::{App, Arg, ArgMatches};
use... |
pub mod floor;
pub mod maze;
pub mod passages;
pub mod rooms;
use self::floor::Floor;
pub use self::rooms::{Room, RoomKind};
use super::{Coord, Direction, Dungeon as DungeonTrait, DungeonPath, MoveResult, Positioned, X, Y};
use character::{player::Status as PlayerStatus, EnemyHandler};
use enum_iterator::IntoEnumItera... |
//! This module contains types that represent VM as high level object model.
use std::collections::HashMap;
use std::convert::TryInto;
use std::iter::FromIterator;
use std::mem::size_of;
use serde::{Deserialize, Serialize};
use smallvec::SmallVec;
use Opcode::*;
use crate::code::refs::*;
use crate::opcodes::Opcode ... |
// Copyright 2020 <NAME>. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
//! Node structure to store information for RAFS file system inode.
use std::collections::HashMap;
use std::ffi::{OsStr, OsString};
use std::fmt;
use std::fs::{self, File};
use std::io::prelude::*;
use std::os::linux::fs::Metadat... |
use {SourceSpec, Dotfile, FeatureSet, Error, ResultExt};
use backend::{self, Backend};
use {symlink, util};
use walkdir::WalkDir;
use toml;
use std::io::prelude::*;
use std::path::{self, Path, PathBuf};
use std::fs;
use sym;
/// Files which should not be considered dotfiles.
pub const DOTFILE_FILE_BLACKLIST: &'stati... |
use std::ops;
use std::str::FromStr;
use std::fmt;
use serde::{Deserialize, Serialize};
pub type Time = (u32, u32);
#[derive(Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Debug)]
#[serde(rename_all = "lowercase")]
/// Musical note notation convention
/// Variant naming follows https://en.wikipedia.org/wiki/Mus... |
//! Shell-related types.
use std::{
env,
ffi::OsStr,
fmt,
io::{self, BufRead, BufReader, LineWriter, Read},
iter,
path::{Path, PathBuf},
process::{ChildStdin, Command, Stdio},
sync::mpsc,
thread,
time::Duration,
};
use crate::{
traits::{ChildShell, ConfigureCommand, ShellPr... |
use crate::{
machines::{
complete_workflow_state_machine::complete_workflow, timer_state_machine::new_timer,
workflow_task_state_machine::WorkflowTaskMachine, DrivenWorkflow, NewMachineWithCommand,
ProtoCommand, TemporalStateMachine, WFCommand,
},
protos::{
coresdk::{
... |
use crate::{
compositor::{Component, Compositor, Context, EventResult},
ctrl, key, shift,
ui::{self, EditorView},
};
use crossterm::event::Event;
use tui::{
buffer::Buffer as Surface,
widgets::{Block, BorderType, Borders},
};
use fuzzy_matcher::skim::SkimMatcherV2 as Matcher;
use fuzzy_matcher::Fuz... |
use std::collections::VecDeque;
use std::f64::consts::PI;
use crate::enum_map::*;
use std::f64::NAN;
use strum::IntoEnumIterator;
use strum_macros::EnumIter;
use std::cell::RefCell;
use std::rc::Rc;
//Persistent state of the calculator
pub struct State {
pub entry_field: Box<VecDeque<Token>>,
pub previous_en... |
use af;
use std;
use csv;
use rand;
use rand::Rng;
use conv::{ConvUtil, Saturate};
//use conv::errors::GeneralErrorKind;
use std::path::Path;
use std::ops::{Sub, Div};
use std::{str, cmp};
use std::cmp::Ordering;
use std::io::{Read, Write};
use tar::Archive;
use flate2::read::GzDecoder;
use flate2::GzHeader;
use std::f... |
use socket2::{Socket, Domain, Type};
use std::net::SocketAddr;
use std::sync::Arc;
use futures::{prelude::*,executor::LocalPool,task::LocalSpawnExt};
use async_coap::prelude::*;
use async_coap::datagram::{DatagramLocalEndpoint,AllowStdUdpSocket,DatagramRemoteEndpoint};
use async_coap::uri::{Uri, RelRef};
use async_coa... |
use std::collections::HashSet;
use std::sync::Weak;
use std::{net::SocketAddr, sync::Arc};
use tokio::sync::{
mpsc::{Receiver, Sender},
oneshot, Mutex, Notify, RwLock,
};
use openssl::sha;
use crate::api_protocol::ApiInterface;
use crate::p2p_protocol::onion_tunnel::fsm::{
FiniteStateMachine, FsmEvent, I... |
//! This crate breaks down durations of time into their constituent parts of
//! various units (weeks, days, hours, minutes, seconds, and nanoseconds).
//!
//! This can be used to convert a duration such as 10,000 seconds into the
//! following form: 0 weeks, 0 days, 2 hours, 46 minutes, 40 seconds, and 0 nanoseconds.
... |
//! Print (or serialize) IR to human and machine readable text.
//!
//! This module implements a document based pretty-printer. A couple of 3rd party pretty printing
//! crates were assessed but didn't seem to work as well as this simple version, which is quite
//! effective.
use crate::{
asm::*,
block::Block... |
// lib -- core logic of program
use std::io::Write;
use std::process::Command;
use std::collections::HashMap;
use std::time::Duration;
use std::fs::OpenOptions;
use reqwest::ClientBuilder;
use std::error::Error;
use tokio::task;
const FILENAME: &str = "srb2l-r_list.txt";
pub struct Server {
pub ip: std::string::... |
use std::cmp;
use std::fs::File;
use std::io::{self, Read, Seek, SeekFrom};
use std::path::Path;
use std::process;
use std::sync::Arc;
use std::time::Duration;
use ::sentry::integrations::failure::capture_fail;
use ::sentry::{configure_scope, Hub};
use failure::{Fail, ResultExt};
use futures::{future, Future};
use ser... |
//! Types for modeling the layout of a datatype
use std::{
cell::RefCell,
cmp::{Eq, PartialEq},
collections::HashSet,
fmt::{self, Debug, Display, Formatter},
mem::{self, ManuallyDrop},
};
use core_extensions::{matches, StringExt};
use crate::{
abi_stability::{
extra_checks::{ExtraChec... |
// Copyright 2016 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.
#![allow(non_camel_case_types)]
#[macro_use]
extern crate bitflags;
use std::{cmp, fmt};
pub type zx_handle_t = i32;
pub type zx_status_t = i32;
pub t... |
use crate::transaction::*;
use crate::blockchain::Blockchain;
use crate::block::*;
use crate::crypto::hash::{H256, H160};
use crate::crypto::key_pair;
use crate::config::*;
use crate::miner;
use crate::mempool::MemPool;
use crate::transaction_generator;
use crate::network::{worker, server};
use crate::account... |
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
extern crate glfw;
use self::glfw::Context;
extern crate gl;
use self::gl::types::*;
use std::ptr;
use std::mem;
use std::os::raw::c_void;
use std::ffi::CStr;
use common::{process_events, processInput, loadTexture};
use shader::Shader;
use camera::Camera;... |
pub use crate::unicode::CharacterData;
use crate::unicode::{classify, linebreak_property, read_utf8, wrap_mask, LINEBREAK_HARD, LINEBREAK_NONE};
use crate::Font;
use crate::{
platform::{ceil, floor},
Metrics,
};
use alloc::vec::*;
use core::borrow::Borrow;
use core::hash::{Hash, Hasher};
/// Horizontal alignm... |
use std::collections::{BTreeSet, HashSet};
use std::env;
use std::fs;
use std::io;
use std::process::Command;
use std::thread;
use std::time::Duration;
use anyhow::{bail, Context, Result};
use byte_unit::Byte;
use clap::ArgMatches;
use vml::cli;
use vml::config::Config;
use vml::config::CreateExistsAction;
use vml::f... |
use crate::object::*;
use crate::pyport::Py_ssize_t;
use std::os::raw::{c_char, c_int};
#[repr(C)]
#[derive(Debug)]
pub struct PyBaseExceptionObject {
pub ob_base: PyObject,
pub dict: *mut PyObject,
pub args: *mut PyObject,
pub traceback: *mut PyObject,
pub context: *mut PyObject,
pub cause: *m... |
// Copyright (c) 2017-present PyO3 Project and Contributors
use crate::{
attributes::{
self, get_pyo3_options, take_attributes, take_pyo3_options, CrateAttribute,
FromPyWithAttribute, NameAttribute, TextSignatureAttribute,
},
deprecations::Deprecations,
method::{self, CallingConvention,... |
//! Serial
use core::fmt;
use core::marker::PhantomData;
use core::ptr;
use embedded_hal::serial;
use embedded_hal::prelude::*;
use nb::block;
use crate::hal::serial::Write;
use crate::stm32::{RCC, UART4, UART5, USART1, USART2, USART3, USART6, UART7, UART8};
use crate::gpio::gpioa::{PA0, PA1, PA2, PA3, PA8, PA9, PA... |
mod assignments;
mod colors;
mod directory_stack;
mod flow;
/// The various blocks
pub mod flow_control;
mod job;
mod pipe_exec;
mod shell_expand;
mod signals;
pub(crate) mod sys;
/// Variables for the shell
pub mod variables;
pub(crate) use self::job::{Job, RefinedJob};
use self::{
directory_stack::DirectoryStack... |
use super::{From, TryFrom};
use crate::num::TryFromIntError;
mod private {
/// This trait being unreachable from outside the crate
/// prevents other implementations of the `FloatToInt` trait,
/// which allows potentially adding more trait methods after the trait is `#[stable]`.
#[unstable(feature = "c... |
// 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... |
//! A header contains minimal architecture information, the binary kind, the number of load commands, as well as an endianness hint
use core::fmt;
use scroll::ctx;
use scroll::{Pread, Pwrite, SizeWith};
use scroll::ctx::SizeWith;
use plain::Plain;
use crate::mach::constants::cputype::{CpuType, CpuSubType, CPU_SUBTYPE... |
use std::ops::{Add, Sub};
use crate::error::TlshError;
pub(crate) const BUCKET_SIZE: usize = 256;
/// Size of a sliding window to process a byte string and populate an array of bucket counts.
pub(crate) const WINDOW_SIZE: usize = 5;
pub(crate) const V_TABLE: [u8; 256] = [
1, 87, 49, 12, 176, 178, 102, 166, 121, ... |
//! # Categorical Naive Bayes
//!
//! Categorical Naive Bayes is a variant of [Naive Bayes](../index.html) for the categorically distributed data.
//! It assumes that each feature has its own categorical distribution.
//!
//! Example:
//!
//! ```
//! use smartcore::linalg::naive::dense_matrix::*;
//! use smartcore::nai... |
use crate::error::Error;
use bitcoin::{BitcoinCoreApi, BlockHash, Transaction, TransactionExt as _};
use futures::stream::{iter, StreamExt};
use runtime::{
pallets::vault_registry::{RegisterAddressEvent, RegisterVaultEvent},
BtcAddress, BtcRelayPallet, Error as RuntimeError, H256Le, InterBtcParachain, InterBtcR... |
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use crate::RcLike;
use futures::future::FusedFuture;
use futures::future::Future;
use futures::future::TryFuture;
use futures::task::Context;
use futures::task::Poll;
use pin_project::pin_project;
use std::any::type_name;
use std::error::Error;... |
#![warn(clippy::all)]
#![warn(rust_2018_idioms)]
//! # ❌ cargo-deny
//!
//! [](https://travis-ci.com/EmbarkStudios/cargo-deny)
//! [](https://crates.io/crates/cargo-deny)
//... |
// std
use std::sync::Arc;
// others
// use time::PreciseTime;
use typed_arena::Arena;
// pbrt
use crate::core::geometry::{bnd3_union_bnd3f, bnd3_union_pnt3f};
use crate::core::geometry::{Bounds3f, Point3f, Ray, Vector3f, XYZEnum};
use crate::core::interaction::SurfaceInteraction;
use crate::core::light::Light;
use cra... |
//! Resolution of the entire dependency graph for a project.
//!
//! This module implements the core logic in taking all contracts of a project and creating a
//! resolved graph with applied remappings for all source contracts.
//!
//! Some constraints we're working with when resolving contracts
//!
//! 1. Each file ... |
use dissimilar::*;
use crossterm::style::Stylize;
use dprint_core::types::ErrBox;
// TODO: This file needs improvement as it is kind of buggy, but
// does the job for now.
/// Gets a string showing the difference between two strings.
/// Note: This returns a Result because this funciton has been unstable.
pub fn get... |
//! htmltemplateimplmod
use crate::*;
use crate::htmltemplatemod::HtmlTemplating;
// use qrcode53bytes::*;
use unwrap::unwrap;
use wasm_bindgen::{JsCast};
use dodrio::{
Node, RenderContext, RootRender,
bumpalo::{self},
builder::{ElementBuilder, text},
VdomWeak
};
impl htmltemplatemod::HtmlTemplatin... |
// Copyright (c) 2017 <NAME>
//
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, ... |
use std::collections::HashMap;
use std::str::from_utf8_unchecked;
use std::cmp::min;
use std::net::SocketAddr;
use std::io::{self, Write};
use term_painter::Color::*;
use term_painter::ToStyle;
use state::Container;
use {logger, handler};
use ext::ReadExt;
use config::{self, Config};
use request::{Request, FormItems... |
use crate::DepMode;
use nfc1_sys::size_t;
/// Safe version of nfc_iso14443a_info
/// NFC ISO14443A tag (MIFARE) information
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct Iso14443a {
atqa: [u8; 2],
sak: u8,
uid: [u8; 10],
uid_len: usize,
ats: [u8; 254],
ats_len: usize,
}
/// Safe version of nfc_felica_... |
use crate::auth;
use crate::cancellation::{self, CancelMap};
use crate::config::{ProxyConfig, TlsConfig};
use crate::stream::{MetricsStream, PqStream, Stream};
use anyhow::{bail, Context};
use futures::TryFutureExt;
use lazy_static::lazy_static;
use metrics::{new_common_metric_name, register_int_counter, IntCounter};
u... |
use crate::Output;
use anyhow::{anyhow, Result};
use hashbrown::HashMap;
use lsp::Url;
use ropey::Rope;
use rune::ast::{Span, Spanned};
use rune::compile::{
CompileError, CompileVisitor, ComponentRef, FileSourceLoader, Item, LinkerError, Location,
MetaKind, MetaRef, SourceMeta,
};
use rune::diagnostics::{Diagno... |
use crate::{FromStrRadix, ProcResult};
use std::collections::HashMap;
use std::io::{BufRead, BufReader, Read};
/// Status information about the process, based on the `/proc/<pid>/status` file.
///
/// To construct this structure, see [Process::status()](crate::process::Process::status).
///
/// Not all fields are avai... |
use crate::lib::config::get_config_dfx_dir_path;
use crate::lib::environment::Environment;
use crate::lib::error::{DfxError, DfxResult, IdentityError};
use crate::lib::identity::{
pem_encryption, Identity as DfxIdentity, ANONYMOUS_IDENTITY_NAME, IDENTITY_JSON, IDENTITY_PEM,
IDENTITY_PEM_ENCRYPTED,
};
use anyho... |
// SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
// SPDX-License-Identifier: Apache-2.0 or MIT
//! Fonts, font families and a font cache.
//!
//! Before you can use a font in a PDF document, you have to load the [`FontData`][] for it, either
//! from a file ([`FontData::load`][]) or from bytes ([`FontData::new`][]). ... |
#[cfg(feature = "display")]
use display;
use std::ops::{Add, Mul, Neg, Not, Sub};
pub const small: f64 = 0.0001;
pub enum Tern {
Yes,
No,
Maybe,
}
impl Tern {
pub fn hope(self) -> bool {
match self {
Yes | Maybe => true,
No => false,
}
}
pub fn despair(self) -> bool {
match self {... |
use crate::chain::*;
use crate::contract::generator::{
CellQuery, CellQueryAttribute, QueryProvider, QueryStatement, TransactionProvider,
};
use ckb_chain_spec::consensus::{Consensus, ConsensusBuilder};
use ckb_error::Error as CKBError;
use ckb_jsonrpc_types::TransactionView as JsonTransaction;
use ckb_script::{Tra... |
use fatfs_sys::{
FIL, DIR, FRESULT, FILINFO, FATFS,
FA_CREATE_NEW, FA_OPEN_EXISTING,
STA_NODISK, STA_NOINIT,
CTRL_SYNC, GET_BLOCK_SIZE, GET_SECTOR_COUNT, GET_SECTOR_SIZE, CTRL_TRIM,
f_close, f_closedir, f_open, f_opendir,
f_sync, f_readdir,
f_read, f_write, f_lseek,
f_unlink, f_mkdir... |
pub const TWO_PI: f64 = 2.0 * std::f64::consts::PI;
pub const COLOR_BLACK: Color = Color { r: 0, g: 0, b: 0, a: 255 };
pub const COLOR_WHITE: Color = Color { r: 255, g: 255, b: 255, a: 255 };
pub const COLOR_RED: Color = Color { r: 255, g: 0, b: 0, a: 255 };
pub const COLOR_GREEN: Color = Color { r: 0, g: 255, b: 0, a... |
// Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, Inc.
// Copyright 2019 <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://ww... |
use num_complex::Complex;
use std::collections::HashMap;
use std::f32::consts::E;
use std::f32::consts::PI;
enum Precedence {
Higher,
Lower,
Equal,
}
#[derive(Debug)]
struct OperationStack {
operations: Vec<String>,
}
impl OperationStack {
fn new() -> OperationStack {
OperationStack {
... |
use super::{
NewWork, NewWorkHistory, PatchWork, Work, WorkField, WorkHistory, WorkOrderBy, WorkStatus,
WorkType,
};
use crate::graphql::utils::Direction;
use crate::model::{Crud, DbInsert, Doi, HistoryEntry};
use crate::schema::{work, work_history};
use crate::{crud_methods, db_insert};
use diesel::dsl::any;
u... |
// a:prstGeom
use super::adjust_value_list::AdjustValueList;
use quick_xml::events::{BytesStart, Event};
use quick_xml::Reader;
use quick_xml::Writer;
use reader::driver::*;
use std::io::Cursor;
use writer::driver::*;
#[derive(Clone, Default, Debug)]
pub struct PresetGeometry {
geometry: String,
adjust_value_l... |
pub type InterruptServiceRoutine = unsafe extern "C" fn() -> !;
extern "C" {
pub fn _isr0() -> !;
fn _isr1() -> !;
fn _isr2() -> !;
fn _isr3() -> !;
fn _isr4() -> !;
fn _isr5() -> !;
fn _isr6() -> !;
fn _isr7() -> !;
fn _isr8() -> !;
fn _isr9() -> !;
fn _isr10() -> !;
fn... |
use module::{Module, ModuleData};
use player::{Options, PlayerData, FormatPlayer, State};
use player::scan::SaveRestore;
use format::st::StData;
use mixer::Mixer;
/// D.O.C SoundTracker V2.0 replayer
///
/// An oxdz player based on the D.O.C SoundTracker V2.0 playroutine - Improved
/// and "omptimized" by Unknown of D... |
// Copyright (c) The cargo-guppy Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Facilities for writing out TOML data from a Hakari map.
use crate::hakari::{HakariBuilder, OutputMap};
#[cfg(feature = "summaries")]
use crate::summaries::HakariBuilderSummary;
use camino::Utf8PathBuf;
use cfg_if::cfg_if;
... |
use futures::{Future, Stream};
use futures::future;
use hyper;
use hyper::{Body, Client, HeaderMap, Version, Method, Request, Response, StatusCode, Uri};
use hyper::client::HttpConnector;
use hyper::header::{HeaderValue, CONTENT_TYPE, CONTENT_LENGTH};
use prost::{DecodeError, EncodeError, Message};
use serde_derive::{S... |
//! Semantic analyzer for literal kinds.
//!
//! This performs some basic initial analysis to convert literal kinds from generic `Integer` and
//! `Float` to concrete types `Int8`, `Int16`, etc., including negation.
//! Note that `SemTypes` may perform additional conversions later down the line.
use std::convert::{Try... |
//! Bluetooth HCI for STMicro's BlueNRG-MS Bluetooth controllers.
//!
//! *Note*: This crate does not provide support for the BlueNRG-1 or BlueNRG-2 SoCs.
//!
//! # Design
//!
//! The BlueNRG-MS is an external Bluetooth Radio Controller that communicates with the application
//! processor over SPI and two dedicated pin... |
//! Geometric primitives.
use core::borrow::Borrow;
use core::ops::{Add, Div, Mul, Sub};
/// Represents an angle in degrees or radians.
#[derive(Copy, Clone, PartialEq, Default, Debug)]
pub struct Angle(f32);
impl Angle {
/// Angle of zero degrees.
pub const ZERO: Self = Self(0.);
/// Creates a new angl... |
use std::{
borrow::Cow,
collections::HashMap,
convert::{TryFrom, TryInto},
io::{self, Read},
fs::{self, File},
fmt, env, error,
str::FromStr,
path::{Path, PathBuf},
net::SocketAddr,
os::unix::fs::PermissionsExt,
};
use clap::{App, Arg};
use uri::Uri;
use glob::Pattern;
use jmespa... |
/*
* Copyright 2018-2020 TON DEV SOLUTIONS LTD.
*
* Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
* this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS I... |
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use std::process;
use std::collections::BTreeMap;
use std::time::{SystemTime, Duration};
use anyhow::Context;
use async_std::task;
use fn_error_context::context;
use linked_hash_map::LinkedHashMap;
use serde::{Serialize, Deserialize};
use crate::client;
use cr... |
extern crate encoding_rs;
use crate::as_mut_str_unchecked_no_borrow_check;
use crate::as_str_unchecked_no_borrow_check;
use crate::finding::Finding;
use crate::finding::Precision;
use crate::finding::OUTPUT_BUF_LEN;
use crate::helper::starts_with_multibyte_char;
use crate::helper::SplitStr;
use crate::input::ByteCount... |
use num_derive::FromPrimitive;
use crate::attribute::{Attribute, AttributeName};
use crate::character::character_common_data::CharacterCommonData;
use crate::character::{CharacterConfig, CharacterName, CharacterStaticData};
use crate::character::character_sub_stat::CharacterSubStatFamily;
use crate::character::characte... |
// "stick" Source Code - Licensed under the MIT LICENSE (see /LICENSE)
use std::mem;
use std::ffi::CString;
use std::fs;
#[repr(C)]
struct TimeVal {
tv_sec: isize,
tv_usec: isize,
}
#[repr(C)]
struct Event {
ev_time: TimeVal,
ev_type: i16,
ev_code: i16,
ev_value: i32,
}
extern {
fn open(pathname: *const u8, ... |
//! # 线程不安全的帧轮结构
//!
//!
//!
use std::{mem::MaybeUninit, usize};
use std::{cmp::{Ord, Ordering}, u64};
use std::mem::{replace, swap};
use std::fmt::{Debug, Formatter, Result as FResult};
// use std::collections::Vec;
use heap::heap::Heap;
use dyn_uint::{UintFactory, ClassFactory};
use arrayvec::ArrayVec... |
// Our macros are just complicated enough to blow past default limits.
#![recursion_limit = "128"]
extern crate proc_macro;
extern crate proc_macro2;
extern crate quote;
extern crate syn;
use proc_macro::TokenStream;
// quote is used by syn::parse_quote
#[allow(unused_imports)]
use quote::quote;
use quote::ToTokens;
us... |
use core::{Config, Key, Result, Value};
use hint::Hint;
use keys_iterator::StoreKeys;
use regex::bytes::Regex;
use segment::{Offset, Segment};
use std::borrow::Borrow;
use std::collections::HashMap;
use std::fs::{create_dir_all, read_dir, rename};
use std::hash::Hash;
use std::mem;
use std::path::PathBuf;
use std::sync... |
//! Efficient, tightly-packet AST representation.
//!
//! Nodes in the tsuki AST are represented via indices in a struct of arrays, instead of being
//! scattered across the heap, which helps achieve better cache locality.
//! This also works much better with the borrow checker.
use std::collections::HashMap;
use cra... |
use crate::{
common::LOG_PREFIX,
mutations::common::{decode_registry_value, encode_or_panic},
registry::Registry,
};
use std::net::SocketAddr;
use candid::{CandidType, Deserialize};
#[cfg(target_arch = "wasm32")]
use dfn_core::println;
use ic_base_types::NodeId;
use ic_crypto_node_key_validation::ValidNo... |
use crate::traits;
use crate::traits::error_reporting::InferCtxtExt as _;
use crate::traits::TraitEngineExt as _;
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def_id::DefId;
use rustc_hir::OpaqueTyOrigin;
use rustc_infer::infer::error_reporting::unexpected_hidden_region_diagnostic;
use rustc_infer::infer::{... |
use crate::{
cast,
gc::{Event, GcPtr, GcRuntime, Observer, RawGcPtr, Stats, TypeTrace},
mapping::{self, FieldMapping, MemoryMapper},
TypeDesc, TypeGroup, TypeMemory,
};
use mapping::{Conversion, Mapping};
use parking_lot::RwLock;
use std::{
collections::{HashMap, VecDeque},
hash::Hash,
ops::... |
//! Configuration.
//!
//! Used to parse the config file or read from environment variables.
//! Also supplied are various helper functions for a CLI program.
use crate::{enums::YotsubaBoard, sql::Database};
use anyhow::{Context, Result};
use enum_iterator::IntoEnumIterator;
use serde::{self, Deserialize, Serialize};... |
//! Global machine state as well as implementation of the interpreter engine
//! `Machine` trait.
use std::borrow::Cow;
use std::cell::RefCell;
use std::num::NonZeroU64;
use std::rc::Rc;
use std::time::Instant;
use std::fmt;
use log::trace;
use rand::rngs::StdRng;
use rustc_ast::attr;
use rustc_data_structures::fx::... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.