text stringlengths 7.05k 33.9k |
|---|
/// Enum of all possible macro icons. This includes only the default macro icons, not icons
/// configured with the `/micon <action>` command. Internally, the macro data preserves the
/// icon chosen via GUI, ignoring the /micon command.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum MacroIcon {
/// Default ... |
#![allow(non_camel_case_types)]
use std::collections::{BTreeMap, HashMap};
use std::convert::Infallible;
use std::fmt::Write;
use std::sync::Arc;
use std::time::SystemTime;
use httpdate::HttpDate;
use tokio::sync::RwLock;
use warp::http::{self, header, response, HeaderValue, Response};
use warp::hyper::body::Bytes;
u... |
use crate::disk::Aligned;
use crate::disk::DiskManager;
use crate::disk::PageId;
use async_rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
use std::sync::atomic::{AtomicU64, Ordering};
use std::{
ops::{Deref, DerefMut},
sync::Arc,
};
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash)]
struct Buffer... |
//! **m**athematical **ex**pression **e**valuator.
//!
//! ## How to Use
//!
//! use mexe::{eval, Result};
//!
//! fn main() -> Result<()> {
//! let forty_six = eval("(5 * 8) + 6")?;
//! let two = eval("1 + 1")?;
//! println!("{} & {}", forty_six, two);
//!
//! assert_eq!(forty_s... |
mod sentence;
mod tags;
use crate::{
extractor::{
Extracted, RawArgument, RawDescription, RawField, RawMethod, RawObject, RawObjectData,
},
parser::sentence::Sentence,
util::{ElementRefExt, StrExt},
BOT_API_DOCS_URL,
};
use chrono::NaiveDate;
use ego_tree::iter::Edge;
use itertools::Itertoo... |
// Copyright 2020 Revcore Technologies Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
use std::collections::BTreeMap;
use std::fmt::{self, Debug, Formatter};
use std::sync::Arc;
use async_stream::try_stream;
use futures_lite::{
pin,
stream::{Stream, StreamExt},
};
use sqlx::{
pool::PoolConnection,
sqlite::{Sqlite, SqlitePool},
Database, Error as SqlxError, Row, TransactionManager,
... |
use std::{
collections::BTreeMap,
hash::{Hash, Hasher},
sync::Arc,
};
use crate::{
mutex::Mutex,
text::{
font::{Font, FontImpl},
Galley, LayoutJob,
},
Texture, TextureAtlas,
};
// TODO: rename
/// One of a few categories of styles of text, e.g. body, button or heading.
#[de... |
use chrono::NaiveDateTime;
use diesel::associations::Identifiable;
use diesel::pg::Pg;
use diesel::prelude::*;
use diesel::sql_types::{Bool, Text};
use url::Url;
use crate::app::App;
use crate::controllers::helpers::pagination::*;
use crate::models::version::TopVersions;
use crate::models::{
Badge, CrateOwner, Cra... |
use std::io::Read;
pub enum OpParseError {
UnexpectedEOF,
InvalidByteCode,
}
#[repr(u8)]
pub enum Op {
AALoad,
AAStore,
AConstNull,
ALoad(u8),
ANewArray(u16),
AReturn,
ArrayLength,
AStore(u8),
AThrow,
BALoad,
BAStore,
BIPush(i8),
CALoad,
CAStore,
Che... |
//! The procedural macro for vulkano's shader system.
//! Manages the compile-time compilation of GLSL into SPIR-V and generation of assosciated rust code.
//!
//! # Basic usage
//!
//! ```
//! mod vs {
//! vulkano_shaders::shader!{
//! ty: "vertex",
//! src: "
//! #version 450
//!
//! layout(locati... |
#![allow(dead_code, clippy::upper_case_acronyms)]
use crate::{
config::*,
eth::*,
grpc::sentry::{sentry_server::SentryServer, InboundMessage},
services::*,
};
use anyhow::{anyhow, Context};
use async_stream::stream;
use async_trait::async_trait;
use clap::Clap;
use devp2p::*;
use educe::Educe;
use futu... |
//
//! Copyright 2020 Alibaba Group Holding Limited.
//!
//! 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 ... |
// Copyright (c) 2017 The vulkano developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be ... |
//! Types for the Global Descriptor Table and segment selectors.
use crate::structures::tss::TaskStateSegment;
use crate::PrivilegeLevel;
use bit_field::BitField;
use bitflags::bitflags;
use core::fmt;
/// Specifies which element to load into a segment from
/// descriptor tables (i.e., is a index to LDT or GDT table
... |
use std::path::PathBuf;
use chrono::{DateTime, Utc};
use clap::Parser;
use config::builder::DefaultState;
use config::ConfigBuilder;
use proctor::elements::PolicySettings;
use serde::{Deserialize, Serialize};
use settings_loader::common::http::HttpServerSettings;
use settings_loader::{Environment, LoadingOptions, Sett... |
/*!
# Timer
## Alternate function remapping
This is a list of the remap settings you can use to assign pins to PWM channels
and the QEI peripherals
### TIM1
Not available on STM32F101.
| Channel | Tim1NoRemap | Tim1FullRemap |
|:---:|:-----------:|:-------------:|
| CH1 | PA8 | PE9 ... |
#[cfg(any(
feature = "parsing",
all(
any(
all(target_family = "unix", unsound_local_offset),
target_family = "windows"
),
feature = "local-offset"
)
))]
use core::convert::TryInto;
#[cfg(feature = "formatting")]
use core::fmt;
#[cfg(feature = "formatting")]
us... |
//---------------------------------------------------------------------------//
// Copyright (c) 2017-2022 <NAME>. All rights reserved.
//
// This file is part of the Rusted PackFile Manager (RPFM) project,
// which can be found here: https://github.com/Frodo45127/rpfm.
//
// This file is licensed under the MIT license... |
use std::borrow::Cow;
use std::fmt;
use std::str::FromStr;
use failure::Fail;
use smallvec::SmallVec;
use crate::processor::{ProcessValue, SelectorPathItem, SelectorSpec};
use crate::types::Annotated;
/// Error for unknown value types.
#[derive(Debug, Fail)]
#[fail(display = "unknown value type")]
pub struct Unknown... |
use frida_gum::{PageProtection, RangeDetails};
use hashbrown::HashMap;
use nix::{
libc::memset,
sys::mman::{mmap, MapFlags, ProtFlags},
};
use backtrace::Backtrace;
#[cfg(any(
target_os = "linux",
target_vendor = "apple",
all(target_arch = "aarch64", target_os = "android")
))]
use libc::{sysconf, _... |
//! Implementation for the Spin HTTP engine.
mod routes;
mod spin;
mod tls;
mod wagi;
pub use tls::TlsConfig;
use crate::{
routes::{RoutePattern, Router},
spin::SpinHttpExecutor,
wagi::WagiHttpExecutor,
};
use anyhow::{anyhow, Context, Error, Result};
use async_trait::async_trait;
use futures_util::stream... |
use super::abloom;
use super::acache;
use super::address::*;
use super::chunk_storage;
use super::compression;
use super::dir_chunk_storage;
use super::external_chunk_storage;
use super::fsutil;
use super::htree;
use super::itemset;
use super::xid::*;
use serde::{Deserialize, Serialize};
use std::convert::TryInto;
use ... |
// بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم
// This file is part of Setheum.
// Copyright (C) 2019-2021 <NAME>.
// 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 publ... |
/*
* Copyright 2019 Bitwise IO, Inc.
* Copyright 2019 Cargill Incorporated
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unl... |
use web_sys::WebGlRenderingContext as GL;
use web_sys::*;
use nalgebra::{Matrix4,Perspective3};
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
use super::config::*;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = console)]
pub fn log(s: &str);
}
pub fn get_grid_normals(n: usize, y_vals: &... |
#![no_main]
#![no_std]
use adafruit_feather_nrf52840_express as _;
use rtic::app;
use nrf52840_hal::{clocks, gpio};
use nrf52840_pac as pac;
use bbqueue::{self, BBBuffer};
use nrf52_cryptocell::CryptoCellBackend;
use psila_data::{
cluster_library::{AttributeDataType, ClusterLibraryStatus},
device_profile:... |
// 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 in the LICENSE-APACHE file or at:
// https://www.apache.org/licenses/LICENSE-2.0
//! KAS Rich-Text library — font selection
//!
//! Many ite... |
//! # Userspace Loader
//!
//! This binary is responsible for all the steps involved in starting an
//! application, creating the kernel process, loading the binary, passing the
//! arguments, and finally starting it.
//!
//! Under HOS/NX, processes are started through `pm:shell`'s LaunchTitle, which
//! will ask `ldr:... |
use super::expect::Expect as _;
use super::*;
use crate::{AsOwned, Parse};
parse! {
bare Raw {
raw,
tags,
prefix,
command,
args,
data
} => |msg: &'t Message<'t>| {
Ok(msg.clone())
}
}
impl<'a: 't, 't> Parse<&'a Message<'t>> for AllCommands<'t> {
... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use codespan_reporting::{diagnostic::Severity, term::termcolor::Buffer};
use itertools::Itertools;
use move_core_types::{identifier::IdentStr, language_storage::ModuleId, value::MoveValue};
use std::collections::{BTreeMap, BTreeSet};
u... |
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use crate::error;
use crate::fs::FdEvents;
use crate::logging::*;
use crate::signals::signal_handling::are_signals_pending;
use crate::task::Task;
use crat... |
// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//! Handles IPC for controlling the main VM process.
//!
//! The VM Control IPC protocol is synchronous, meaning that each `VmRequest` sent over a conn... |
mod init;
mod oracle;
mod wallet;
use anyhow::Context;
use bdk::{
bitcoin::{
consensus::encode,
util::{address::Payload, psbt::PartiallySignedTransaction as Psbt},
Address, Amount, Network, Txid,
},
blockchain::{AnyBlockchain, ConfigurableBlockchain, EsploraBlockchain},
database:... |
// Copyright 2020-2021 Gnosis Ltd.
// SPDX-License-Identifier: Apache-2.0
use crate::common_types::{BlockHeaderAndHash, GetBlockHeaders, NewBlock, NewBlockHash};
use core::{BlockBody, BlockHeader, BlockId, BlockNumber, Transaction, H160, H256, U256};
use keccak_hash::keccak;
use rlp::{DecoderError, Rlp, RlpStream};
... |
//! This is a densely packed error representation which is used on targets with
//! 64-bit pointers.
//!
//! (Note that `bitpacked` vs `unpacked` here has no relationship to
//! `#[repr(packed)]`, it just refers to attempting to use any available bits in
//! a more clever manner than `rustc`'s default layout algorithm ... |
// SPDX-License-Identifier: Apache-2.0
//! Types and abstractions regarding Virtual Machine Save Areas (VMSAs).
#![allow(dead_code)]
use super::*;
use core::mem::size_of;
use serde_big_array::BigArray;
use std::fs;
use std::io;
const ATTR_G_SHIFT: usize = 23;
const ATTR_B_SHIFT: usize = 22;
const ATTR_L_SHIFT: usi... |
use std::collections::BTreeMap;
use std::convert::TryInto;
use std::{cmp, mem, ptr, slice};
use netutils::setcfg;
use syscall::error::{Error, Result, EACCES, EBADF, EINVAL, EWOULDBLOCK};
use syscall::flag::{EventFlags, O_NONBLOCK};
use syscall::io::Dma;
use syscall::scheme::SchemeBlockMut;
const CTRL: u32 = 0x00;
co... |
use crate::types::{IntTypeKind, Type, TypeKind};
macro_rules! all_int_types {
($int_kind:expr, $out:expr, ($a:expr, $b:expr), $op:tt) => {{
match $int_kind {
crate::types::IntTypeKind::Isize => {
let a: isize = *$a.cast();
let b: isize = *$b.cast();
... |
use std::env;
use std::fs::File;
use std::io::{stdout, BufRead, BufReader, BufWriter, ErrorKind, Write};
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
use crate::create_smartlist::{SmartlistBuilder, SmartlistTokenizer, DEFAULT_VOCAB_SIZE};
use crate::generators::get_word_generator;
use crate::helpers::Ra... |
// Diopser: a phase rotation plugin
// Copyright (C) 2021-2022 <NAME>
//
// 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 Free Software Foundation, either version 3 of the License, or
// (at your option) any later vers... |
//! Generic parameter inference
use super::super::term::{cond, const_val, Ty, T};
use super::super::{span_to_string, ZGen};
use crate::ir::term::{bv_lit, leaf_term, term, BoolNaryOp, Op, Sort, Term, Value};
#[cfg(feature = "smt")]
use crate::target::smt::find_unique_model;
use lazy_static::lazy_static;
use log::debug... |
use serde::{Serialize, Deserialize, de::DeserializeOwned};
use serde_json::{Value as JsonValue, Result as JsonResult};
use crate::package::Package;
// region: (util)
// same as `serde_json::from_value`, but takes reference
pub fn to<De: DeserializeOwned>(value: &JsonValue) -> JsonResult<De>
{
De::deserialize(valu... |
/*
* Copyright 2018 Intel Corporation
*
* 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 agre... |
use cpu_time::ProcessTime;
use fmt::Debug;
use crate::{
chunk::{Chunk, Instruction, Table, Value},
compiler::compile,
error::LoxError,
gc::{Gc, GcRef, GcTrace, GcTraceFormatter},
objects::{BoundMethod, Class, Closure, Instance, NativeFunction, Upvalue},
};
use std::fmt;
pub struct Vm {
gc: Gc,... |
use bitcoin;
use crypto::digest::Digest;
use crypto::sha2::Sha256;
use util::hex::{FromHex, ToHex};
use std::fmt;
static GENESIS_RAW_HEX: &'static str = "0100000000000000000000000000000000000000\
000000000000000000000000000000003ba3edfd\
7... |
//
// Copyright 2021 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 super::win;
use crate::message_parser;
use crate::message_parser::{
ClientServerInfo, MessageData, MessageInfo, MessageParser, StreamData,
};
use crate::search_expr;
use crate::search_expr::OperatorNegation;
use crate::tshark_communication::TcpStreamId;
use crate::widgets::comm_target_card::{CommTargetCardData,... |
#![warn(clippy::all)]
#![warn(rust_2018_idioms)]
use std::io::Write;
use std::ops::Range;
use std::sync::Arc;
use std::{fs, io, path, process};
use codespan_reporting::diagnostic::{Diagnostic, Label, Severity};
use codespan_reporting::files::Files as _;
use tempfile::NamedTempFile;
use arret_syntax::span::{FileId, ... |
use crate::{
vp::{DivVanishingPoly, VanishingPoly},
UnivariateSumcheck,
};
use alloc::{vec, vec::Vec};
use ark_bcs::{
bcs::transcript::{LDTInfo, Transcript},
iop::{bookkeeper::NameSpace, message::OracleIndex, oracles::VirtualOracle},
iop_trace,
prelude::{MsgRoundRef, ProverRoundMessageInfo, Simu... |
use byteorder::{ByteOrder, NetworkEndian};
use super::{InformationElementTraits, InformationElementType, LENGTH};
use std::convert::TryFrom;
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum CauseSource {
LocalNode = 0,
RemoteNode = 1,
}
impl TryFrom<u8> for CauseSource
{
type Error = String;
fn tr... |
//! The deserialization implementation for an RBXM
use crate::model::*;
use crate::serde::encoding::{
decode_cumulative, decode_i32, Chomp, ChompInterleaved, ChompInterleavedTransform,
ChompTransform,
};
use crate::serde::internal::RawProperty;
use crate::serde::io::Read;
use crate::serde::{Error, Result};
use... |
/*
* Copyright 2021 <NAME> <<EMAIL>>
*
* 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 ... |
use itertools::Itertools;
use polytype::atype::TypeContext;
use programinduction::trs::{
mcts::{MCTSObj, MCTSParams, Move, TRSMCTS},
parse_lexicon, parse_rulecontexts, parse_rules, parse_trs, Lexicon, ModelParams,
SingleLikelihood, TRS,
};
use rand::Rng;
use serde_derive::{Deserialize, Serialize};
use std::... |
// 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... |
use std::{cmp::Ordering, net::SocketAddr, time::Instant};
use log::debug;
use ConnectError::*;
use ConnectionResult::*;
use RendezvousHsV5::*;
use RendezvousState::*;
use crate::{
connection::{Connection, ConnectionSettings},
packet::*,
protocol::handshake::Handshake,
settings::*,
};
use super::{
... |
/* Inter-Integrated Circuit (I2C) */
/* Manual Page 1127 */
use super::{common, pointer};
pub struct I2c {
cr1: *mut u32, // Control Register 1
cr2: *mut u32, // Control Register 2
oar1: *mut u32, // Own Address Register 1
oar2: *mut u32, // Own Addres... |
// 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 <NAME>
// Licensed under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
use crate::entity::Entity;
use crate::entity;
use crate::extractor::{Extract, Extractor};
use crate::ffi;
type Attributes = Vec<(String, String)>;
const HREF: &'static str = "href";
const CLASS: &'... |
use std::collections::{BTreeMap, HashMap};
use std::ops::Deref;
use rocket::request::{self, FormItems, FromRequest, Request};
use rocket::Outcome;
use alisms::SmsBody;
use std::sync::mpsc::Sender;
use mysql::{self, Pool};
use rand::{self, Rng};
use time;
use crypto::digest::Digest;
use crypto::md5::Md5;
use rustc_seria... |
//! # Diesel
//!
//! Diesel is an ORM and query builder designed to reduce the boilerplate for database interactions.
//! If this is your first time reading this documentation,
//! we recommend you start with the [getting started guide].
//! We also have [many other long form guides].
//!
//! [getting started guide]: h... |
//! Subscribe to events in the compiler pipeline
//!
//! The _reporter_ is the component of the [`Project::compile()`] pipeline which is responsible
//! for reporting on specific steps in the process.
//!
//! By default, the current reporter is a noop that does
//! nothing.
//!
//! To use another report implementation,... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
network::MempoolSyncMsg,
shared_mempool::types::SharedMempoolNotification,
tests::{
common::TestTransaction,
node::{
public_full_node_config, validator_config, vfn_config, Node, NodeI... |
extern crate amqp;
extern crate env_logger;
use lru_cache::LruCache;
use serde_json;
use std::fs;
use std::fs::{File, OpenOptions};
use std::io::Write;
use std::path::{Component, PathBuf};
use amqp::protocol::basic::{BasicProperties, Deliver};
use ofborg::message::buildlogmsg::{BuildLogMsg, BuildLogStart};
use ofborg:... |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use crate::constants::{HAS_WAITERS, IS_LOCKED, SENTINEL};
use crate::list;
use futures::pin_mut;
use list::List;
use parking_lot::Mutex as ParkingLotMutex;... |
//! The `packet` module defines data structures and methods to pull data from the network.
use crate::{
packet::NUM_PACKETS,
result::{Error, Result},
};
use bincode;
use byteorder::{ByteOrder, LittleEndian};
use serde::Serialize;
use solana_ledger::erasure::ErasureConfig;
pub use solana_sdk::packet::{Meta, Pack... |
// 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... |
#![warn(clippy::all)]
//! Filesystem walk.
//!
//! - Performed in parallel using rayon
//! - Entries streamed in sorted order
//! - Custom sort/filter/skip/state
//!
//! # Example
//!
//! Recursively iterate over the "foo" directory sorting by name:
//!
//! ```no_run
//! # use std::io::Error;
//! use jwalk::{WalkDir};... |
use std::collections::BTreeMap;
use std::sync::Arc;
use std::time::Duration;
use async_trait::async_trait;
use bazel_protos::call_option;
use bazel_protos::error_details::PreconditionFailure;
use bazel_protos::remote_execution::{
Action, Command, ExecuteRequest, ExecuteResponse, ExecutedActionMetadata, WaitExecution... |
use postgis::ewkb::AsEwkbPoint;
use postgis::ewkb::EwkbWrite;
use regex::{Regex, RegexSet};
use crate::{hecate, types::name::InputName, Context, Name, Names, Source};
/// A representation of a single Address
#[derive(Debug, PartialEq)]
pub struct Address {
/// An optional identifier for the address
pub id: Op... |
//! Traits and datastructures representing a collection trace.
//!
//! A collection trace is a set of updates of the form `(key, val, time, diff)`,
//! which determine the contents of a collection at given times by accumulating
//! updates whose time field is less or equal to the target field.
//!
//! The `Trace` trait... |
use std::f64::{EPSILON, consts::PI};
use nalgebra_glm as glm;
use glm::{DVec2, DVec3, DVec4, DMat4};
use nurbs::{AbstractSurface, NDBSplineSurface, SampledSurface};
use crate::{Error, mesh::Vertex};
// Represents a surface in 3D space, with a function to project a 3D point
// on the surface down to a 2D space.
#[der... |
use bytes::{Buf, BufMut, Bytes, BytesMut};
use futures_util::future::FutureExt;
use futures_util::select;
use futures_util::stream::Stream;
use std::collections::HashMap;
use std::pin::Pin;
use std::str::{self, FromStr};
use std::sync::Arc;
use std::task::{Context, Poll};
use std::time::Duration;
use subslice::Subslice... |
use std::collections::HashMap;
use once_cell::unsync::OnceCell;
use crate::{
ast::{
AstCtx, BuiltinMacro, BuiltinMacroKind, Expr, ExprKind, FieldInitializer, Item, ItemP, Lit,
},
common::{ice, AluminaError, ArenaAllocatable, CodeErrorKind},
diagnostics::line_and_column,
global_ctx::GlobalC... |
use crate::validation::{Context, Reason};
use std::{
collections::HashMap,
ffi::{OsStr, OsString},
fmt::{self, Debug, Formatter},
io,
path::{Component, Path, PathBuf},
sync::Arc,
};
/// Try to resolve a link relative to the current directory.
///
/// # Note
///
/// The behaviour of this functio... |
//! Contents of this module are subject to change.
use std::cmp::Ordering;
use std::ops::Range;
use rug::{Integer, Rational};
use super::{SignedSqrt, Wigner3jm, Wigner6j, Wigner9j};
#[inline]
pub fn sort2<T: Ord>(a: T, b: T) -> (T, T) {
if b < a {
(b, a)
} else {
(a, b)
}
}
#[inline]
pub ... |
use crate::sbox::Sbox;
use crate::targets::Cipher;
use crate::{bit, bit::Bit, bit::*};
pub struct Skinny128 {
n_rounds: usize,
message_length: usize,
key_length: usize,
sbox: Sbox,
}
impl Skinny128 {
pub fn new(key_length: usize, n_rounds: usize) -> Self {
let message_length = 128;
... |
use {
Backend,
Button,
Canvas,
CharacterCache,
Color,
Dimensions,
FontSize,
GlyphCache,
NodeIndex,
Point,
Rect,
Scalar,
Theme,
Widget,
};
use super::canvas;
use utils;
use widget;
/// A wrapper around a list of canvasses that displays thema s a list of selectabl... |
// Copyright 2020 Revcore Technologies Ltd.
//
// 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... |
// Copyright 2020 <NAME>. All rights reserved.
// Copyright (C) 2020-2022 Alibaba Cloud. All rights reserved.
//
// SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause)
use std::convert::From;
use std::io::Result;
use std::str::FromStr;
use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::Arc;
use std::t... |
/// a utility function for convenient styling of elements
#[macro_export]
macro_rules! style {
($($tokens:tt)+) => {
{
let json = json::object!($($tokens)*);
let mut styles = vec![];
for (prop,p_value) in json.entries(){
let value = match p_value{
... |
use serde::{Deserialize, Serialize};
use wasm_bindgen::prelude::*;
use yew::format::{Json, Nothing};
use yew::services::fetch::{
Credentials, FetchOptions, FetchService, FetchTask, Mode, Request, Response,
};
use yew::services::ConsoleService;
use yew::{html, ChangeData, Component, ComponentLink, Html, InputData, ... |
use actix::prelude::*;
use actix_files as fs;
use actix_web::{http, middleware, web, App, HttpRequest, HttpResponse, HttpServer, Responder};
use anyhow::Context;
use find_cmdlet_index::pascal_splitter;
use serde::{Deserialize, Serialize};
use std::{
collections::HashMap,
fs::File,
io::{BufReader, Read},
... |
use crate::{
auth::Permissions,
chars::Chars,
pack::Z64,
path::Path,
pool::{Pool, Pooled},
protocol::{
glob::{GlobSet, Scope},
resolver::Referral,
},
secstore::SecStoreInner,
utils::{self, Addr},
};
use bytes::Bytes;
use fxhash::{FxBuildHasher, FxHashMap};
use immutab... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
crate::error::*,
crate::types::*,
crate::utils::{Signal, SignalWatcher},
fidl_fuchsia_ledger_cloud as cloud,
std::collections::{h... |
//
// Copyright (C) 2018 Kubos Corporation
//
// 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 image::*;
#[macro_use]
extern crate log;
type HistType = [u32];
fn calc_tile_hist<T>(
img: &ImageBuffer<Luma<T>, Vec<T>>,
left: u32,
top: u32,
width: u32,
height: u32,
hist: &mut HistType,
) where
T: image::Primitive + Into<usize> + Into<u32> + Ord + 'static,
{
hist.fill(0);
le... |
use std::cmp::Ordering;
use std::fmt::{self, Debug, Formatter, Octal};
use std::hash::{Hash, Hasher};
use super::error::ConversionFailed;
use super::unsigned::*;
use super::{Sign, WordCommon};
#[cfg(test)]
mod tests18;
#[cfg(test)]
mod tests36;
#[cfg(test)]
mod tests5;
#[cfg(test)]
mod tests9;
// This macro implemen... |
//! This module provides functionality to find the shortest path between two
//! points on a 2D map represented by a [`BidiView`][crate::BidiView], using Djikstra algorithm
//! on single source ([`pathfind_to_whole`]), multiple destinations and either Djikstra or A* for
//! singe-source, single-destination path finding... |
use std::any::Any;
use style::{property::Property, render_tree::RenderNodeRef, values::prelude::Position};
use crate::{
box_model::{BoxComponent, Dimensions},
formatting_context::{FormattingContext, LayoutContext},
layout_box::{
apply_explicit_sizes, children_are_inline, get_containing_block, Layo... |
#[macro_use]
extern crate clap;
#[macro_use]
extern crate lazy_static;
use std::io::{self, Write};
use std::time::Instant;
use std::path::{Path, PathBuf};
#[macro_use]
mod util;
mod png_convert;
use util::{Error, ReadFile, WriteFile};
use util::color_type::*;
macro_rules! check {
($t: expr ) => {
if $t {
"\x1... |
/*
* Copyright 2015 <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 wr... |
#![warn(clippy::all)]
//
// # Exercise Expectations
//
// The goal here to is to establish a basis for our technical
// interview, and be able to discuss the choices you made and
// why. We're far more interested in the discussion part than
// receiving a perfect implementation of the following exercise. The
// exerci... |
#![deny(
missing_docs,
missing_debug_implementations,
missing_copy_implementations,
trivial_casts,
trivial_numeric_casts,
unsafe_code,
unstable_features,
unused_import_braces,
unused_qualifications
)]
//! Pullover is Pushover API wrapper with attachment support in Rust 2018 edition
... |
//! A simple example of parsing `.debug_info`.
use object::{Object, ObjectSection};
use std::{borrow, env, fs};
use gimli;
use gimli::{CompilationUnitHeader, Section, UnitOffset, UnitSectionOffset, UnwindSection};
//use std::io::{BufWriter, Write};
use std::io;
use std::fmt::Write;
use std::collections::HashMap;
fn ... |
//! Jubjub is a twisted Edwards curve defined over the BLS12-381 scalar
//! field, Fr. It takes the form `-x^2 + y^2 = 1 + dx^2y^2` with
//! `d = -(10240/10241)`. It is birationally equivalent to a Montgomery
//! curve of the form `y^2 = x^3 + Ax^2 + x` with `A = 40962`. This
//! value `A` is the smallest integer choic... |
//! # Rustls - a modern TLS library
//! Rustls is a TLS library that aims to provide a good level of cryptographic security,
//! requires no configuration to achieve that security, and provides no unsafe features or
//! obsolete cryptography.
//!
//! ## Current features
//!
//! * TLS1.2 and TLS1.3.
//! * ECDSA, Ed25519... |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use crate::base::{HasSettingType, SettingInfo, SettingType};
use crate::handler::base::{Context, ControllerGenerateResult, Request};
use crate::handler::dev... |
/// === Sym bindings ===
/// Local symbol.
pub const STB_LOCAL: u8 = 0;
/// Global symbol.
pub const STB_GLOBAL: u8 = 1;
/// Weak symbol.
pub const STB_WEAK: u8 = 2;
/// Number of defined types..
pub const STB_NUM: u8 = 3;
/// Start of OS-specific.
pub const STB_LOOS: u8 = 10;
/// Unique symbol..
pub const STB_GNU_UNIQ... |
// Copyright 2019 <NAME>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.