text stringlengths 9.08k 47.9k |
|---|
//! Defines abstract representations of the shell source.
use std::rc::Rc;
use std::sync::Arc;
use std::{fmt, ops};
pub mod builder;
/// Type alias for the default `Parameter` representation.
pub type DefaultParameter = Parameter<String>;
/// Represents reading a parameter (or variable) value, e.g. `$foo`.
///
/// G... |
use std::borrow::Cow;
use std::collections::HashSet;
use std::convert::TryFrom;
use std::fmt;
use std::str::FromStr;
use std::time::Duration;
use derive_builder::Builder;
use stable_vec::StableVec;
use crate::line::{Line, Lines, Tag};
use crate::media_segment::MediaSegment;
use crate::tags::{
ExtM3u, ExtXByteRang... |
//! The shotcaller game. A new MOBA!
#![warn(missing_docs)]
#[macro_use]
extern crate serde;
#[macro_use]
extern crate lazy_static;
use minigene::*;
use std::collections::hash_map::RandomState;
use std::collections::HashMap;
use uuid::*;
use nakama_rs::api_client::{ApiClient, Event};
use nakama_rs::matchmaker::{Mat... |
use std::sync::{Arc, Mutex};
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::time::{SystemTime, UNIX_EPOCH};
use futures::{Sink, Stream, Future, IntoFuture, oneshot, Oneshot, Complete};
use futures::sync::mpsc::{channel, Sender, Receiver};
use rusqlite::{self, Statement, OpenFlags};
use tokio;
u... |
//! Translate from IR to the lowest structures.
//! Should this module have another name? The parallel to rustc trans will be lost on some people,
//! and is unclear even to me.
#![allow(non_snake_case)]
use std::iter;
use std::collections::HashSet;
use std::collections::HashMap;
use std::collections::BTreeMap;
use s... |
//! The virtio_blk module implements a virtio block device.
//!
//! The spec for Virtual I/O Device (VIRTIO) Version 1.1:
//! https://docs.oasis-open.org/virtio/virtio/v1.1/virtio-v1.1.html
//! 5.2 Block Device:
//! https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-2390002
use crate::bus::VI... |
//! A basic terminal emulator library.
//!
//! The terminal has several main responsibilities:
//! * Managing the scrollback buffer, a string of characters that should be printed to the screen.
//! * Determining which parts of that buffer should be displayed and using the window manager to do so.
//! * Handling the co... |
//! A build dependency for Cargo libraries to find system artifacts through the
//! `pkg-config` utility.
//!
//! This library will shell out to `pkg-config` as part of build scripts and
//! probe the system to determine how to link to a specified library. The
//! `Config` structure serves as a method of configuring ho... |
//! Implements a simple mock network for testing purposes.
// Note: There are lots of opportunities here for making the network
// more and more realistic, but please remember that this module only
// exists for writing unit tests. Let's resist the temptation to add
// things we don't need.
use super::io::{stream_pa... |
/* origin: FreeBSD /usr/src/lib/msun/src/e_lgamma_r.c */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is f... |
//! # AMM Pallet
//!
//! ## Overview
//!
//! AMM pallet provides functionality for managing liquidity pool and executing trades.
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::unused_unit)]
#![allow(clippy::upper_case_acronyms)]
use codec::{Decode, Encode};
use scale_info::TypeInfo;
use core::convert::Tr... |
//! Tock's central kernel logic and scheduler trait.
//!
//! Also defines several utility functions to reduce duplicated code between
//! different scheduler implementations.
pub(crate) mod cooperative;
pub(crate) mod mlfq;
pub(crate) mod priority;
pub(crate) mod round_robin;
use core::cell::Cell;
use core::ptr::NonN... |
#![allow(unused_results)]
use std::cell::RefCell;
use std::ops::DerefMut;
use std::rc::Rc;
use std::sync::mpsc::Sender;
use crate::context::Context;
use crate::event::{Action, Key, Modifiers, MouseButton, TouchAction, WindowEvent};
use crate::window::{AbstractCanvas, CanvasSetup};
use image::{GenericImage, Pixel};
us... |
use std::convert::TryInto;
use std::iter;
use halo2_proofs::{
arithmetic::FieldExt,
circuit::{AssignedCell, Cell, Chip, Layouter, Region},
plonk::{
Advice, Any, Column, ConstraintSystem, Constraints, Error, Expression, Fixed, Selector,
},
poly::Rotation,
};
use super::{PaddedWord, Poseidon... |
/*
* Copyright (c) 2020 - 2021. <NAME>.
* Please refer to github.com/shoyo/jindb for more information about this project and its license.
*/
use crate::constants::{LsnT, PageIdT, PAGE_SIZE};
use crate::io::{read_u32, write_u32};
use crate::relation::record::{Record, RecordId};
/// Type alias for a byte array that... |
use std::fmt::{Debug, Display, Formatter};
use crate::bitboard::{BitBoard, EMPTY};
use crate::game::pieces::{get_castling_rook_move, is_pawn_two_step, Color, Pieces};
use crate::game::position::Position;
pub mod fen;
pub mod pieces;
pub mod position;
/// A chess piece move (origin and destination).
#[derive(Clone, C... |
use core::cmp::min;
use micromath::F32Ext;
use crate::device::{rcc, FLASH, RCC};
use crate::time::Hertz;
/// Extension trait that constrains the `RCC` peripheral
pub trait RccExt {
/// Constrains the `RCC` peripheral so it plays nicely with the other abstractions
fn constrain(self) -> Rcc;
}
impl RccExt for... |
//! Arbitrary-precision decimal class for fallback algorithms.
//!
//! This is only used if the fast-path (native floats) and
//! the Eisel-Lemire algorithm are unable to unambiguously
//! determine the float.
//!
//! The technique used is "Simple Decimal Conversion", developed
//! by <NAME> and <NAME>. A detailed desc... |
// scheduler.rs
use std::collections::VecDeque;
use std::fmt;
use anyhow::anyhow as anyhow_macro;
use chrono::{DateTime, SecondsFormat, Utc}; // See also: DateTime, Local, TimeZone
use chrono::NaiveDateTime;
use redis::{self, Commands, RedisError};
use tracing::{trace, debug, info, warn, error, span, Level};
use crat... |
// 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.
//! The Internet Protocol, versions 4 and 6.
mod forwarding;
mod icmp;
mod igmp;
mod types;
// It's ok to `pub use` rather `pub(crate) use` here because ... |
use crate::Result;
use curl::easy::{Auth, Easy2, Handler, InfoType};
use curl_sys::CURL;
use libc::c_double;
#[cfg(feature = "memmap")]
use memmap::MmapMut;
use std::{
fmt::{Debug, Display},
fs::{File, OpenOptions},
io::{self, Write},
marker::PhantomData,
mem,
num::{NonZeroU64, NonZeroUsize},
... |
// 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::error::PowerManagerError;
use crate::message::{Message, MessageReturn};
use crate::node::Node;
use crate::system_shutdown_handler;
use crate::ty... |
// Copyright 2012-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-MI... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control"]
pub ctrla: CTRLA,
_reserved1: [u8; 3usize],
#[doc = "0x04 - Software Event"]
pub swevt: SWEVT,
#[doc = "0x08 - Priority Control"]
pub prictrl: PRICTRL,
_reserved3: [u8; 7usize],
#[doc = "0x10 -... |
use std::{
convert::{TryFrom, TryInto},
ffi::OsStr,
fs,
path::PathBuf,
rc::Rc,
sync::Arc,
};
use bytesrepr::FromBytes;
use grpc::RequestOptions;
use lmdb::DatabaseFlags;
use log::LevelFilter;
use casper_engine_grpc_server::engine_server::{
ipc::{
CommitRequest, CommitResponse, Gene... |
// Copyright 2017 <NAME>. <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
// the MIT license <http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
//! Functions in t... |
// 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.
use crate::{
app::strategies::base::{create_app_strategy, AppStrategyPtr},
drawing::DisplayRotation,
geometry::Size,
input::{DeviceId, User... |
// Copyright (C) 2017 1aim GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wr... |
use linked_hash_map::LinkedHashMap;
use std::collections::{HashMap, HashSet};
use crate::{ErrorKind, Result, ResultExt};
use crate::cipher::common::{normalize_text, Counter};
use crate::cipher::vigenere::{DEFAULT_CHARSET, cipher, decipher};
use std::iter::FromIterator;
// use std::collections::hash_map::Keys;
use crate... |
//
// Copyright © <NAME>
// Some 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 conditions and the ... |
// Copyright 2020 - developers of the `grammers` project.
//
// 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. This file may not be copied, modified, or distr... |
// Copyright (c) 2016 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 ... |
//! Handle compressed and uncompressed pixel byte blocks. Includes compression and decompression,
//! and some functions that completely read an image into blocks.
pub mod lines;
pub mod samples;
pub mod chunk;
use crate::compression::{ByteVec, Compression};
use crate::math::*;
use crate::error::{Result, Error, usize... |
//! The Enso parser. Parsing is a multi-stage process:
//!
//! # Lexing.
//! First, the source code is feed to [`lexer::Lexer`], which consumes it and outputs a stream of
//! [`Token`]. Tokens are chunks of the input with a generic description attached, like "operator",
//! or "identifier".
//!
//! # Building macro reg... |
/*
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 not use this f... |
use git2;
use std::fmt;
// use std::iter::FromIterator;
use crate::models::repo_tag::RepoTag;
use itertools::Itertools;
use std::hash::Hash;
use std::path::Path;
/// A git repository, represented by the full path to its base directory.
#[derive(
Serialize, Deserialize, Debug, PartialOrd, Ord, PartialEq, Eq, Hash, ... |
use std::cmp;
use std::collections::{BTreeMap, VecDeque};
use std::error::Error;
use std::fs;
use std::io;
use std::rc::Rc;
use csv;
use sha1;
use itertools::Itertools;
use vec_map::VecMap;
use bio::io::fasta;
use rust_htslib::bam::record::Cigar;
use rust_htslib::{bam, bcf};
use crate::common::{Interval, Variant};... |
//! Discover which template type parameters are actually used.
//!
//! ### Why do we care?
//!
//! C++ allows ignoring template parameters, while Rust does not. Usually we can
//! blindly stick a `PhantomData<T>` inside a generic Rust struct to make up for
//! this. That doesn't work for templated type aliases, however... |
use std::path::{Path, PathBuf};
use std::error::Error;
use std::fs;
use std::fmt;
use std::str;
use crate::utils::read_string_lossy;
#[derive(Debug)]
enum OctalUnescapeError {
MalformedEscapeCode,
InvalidUtf8
}
impl fmt::Display for OctalUnescapeError {
fn fmt( &self, fmt: &mut fmt::Formatter ) -> fmt::R... |
//! # Evercrypt Crypto Provider
//!
//! Use evercrypt for all crypto operations.
use std::{
convert::TryFrom,
io::{Read, Write},
};
use evercrypt::prelude::*;
use log::error;
use crate::ciphersuite::{errors::CryptoError, AeadType, HashType, SignatureScheme};
impl TryFrom<SignatureScheme> for SignatureMode {... |
use std::collections::{HashMap, HashSet};
#[cfg(test)]
use std::ffi::OsString;
use std::path::PathBuf;
use itertools;
use lazy_static::lazy_static;
use structopt::clap::AppSettings::{ColorAlways, ColoredHelp, DeriveDisplayOrder};
use structopt::{clap, StructOpt};
use syntect::highlighting::Theme as SyntaxTheme;
use sy... |
#[allow(unused_imports)]
use alloc::prelude::v1::*;
use alloc::rc::Rc;
use core::cell::RefCell;
use core::fmt;
use Trap;
#[cfg(not(feature = "std"))]
use hashbrown::HashMap;
#[cfg(feature = "std")]
use std::collections::HashMap;
use core::cell::Ref;
use func::{FuncBody, FuncInstance, FuncRef};
use global::{GlobalInst... |
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use serde_json;
use commands::{Command, CommandExecutor, BoxedCallbackStringStringSend};
use commands::ledger::LedgerCommand;
use domain::crypto::did::{Did, DidValue, DidMetadata, DidWithMeta, MyDidInfo, TemporaryDid, TheirDid, TheirDidInfo, DidM... |
// Copyright 2020, The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclai... |
// Copyright 2020 Arm Limited (or its affiliates). All rights reserved.
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//! ARM PL031 Real Time Clock
//!
//! This module implements a PL031 Real Time Clock (RTC) that provides to provides long time base c... |
// Copyright 2017 <NAME>
//
// This file is part of the PulseAudio Rust language binding.
//
// Licensed under the MIT license or the Apache license (version 2.0), at your option. You may not
// copy, modify, or distribute this file except in compliance with said license. You can find copies
// of these licenses either... |
use std::sync::mpsc::Sender;
use std::thread;
use std::{collections::HashMap, sync::atomic::AtomicBool};
use std::{io::Write, sync::atomic::Ordering};
use std::{
path::{Path, PathBuf},
process::Command,
};
use std::{sync::mpsc::channel, time::Duration};
use uuid::Uuid;
use anyhow::Result;
use glib::Cast;
us... |
use dioxus_core::*;
use std::fmt::Arguments;
macro_rules! no_namespace_trait_methods {
(
$(
$(#[$attr:meta])*
$name:ident;
)*
) => {
$(
$(#[$attr])*
fn $name<'a>(&self, cx: NodeFactory<'a>, val: Arguments) -> Attribute<'a> {
... |
extern crate tesserae;
extern crate sdl2;
use rand::Rng;
use tesserae::{*};
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::gfx::framerate::FPSManager;
use sdl2::render::TextureCreator;
use sdl2::render::RenderTarget;
use sdl2::render::Canvas;
use utils::color::{*};
use sdl2::rect::{Rect};
use utils::m... |
// Copyright 2014 Google Inc.
// Copyright 2020 <NAME>
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This module is a mix of SkDashPath, SkDashPathEffect, SkContourMeasure and SkPathMeasure.
use alloc::vec::Vec;
use arrayref::array_ref;
use crate::{Pat... |
// Copyright (c) 2018, <NAME>
// 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... |
extern crate tabfile;
pub mod error;
use std::borrow::Cow;
use std::convert::TryInto;
use std::path::Path;
use tabfile::Tabfile;
use error::Error;
pub type Float = f32;
type TransitionProbabilities = [Float; 3];
#[derive(Copy, Clone, Debug)]
pub struct IndelTransitionProbabilities {
pub outframe: Float, // fr... |
//! Tokenizing Helios source files.
//!
//! The showrunner of this module is the [`Lexer`] type. It essentially takes
//! a given input, representing a Helios source, and provides an [`Iterator`] of
//! [`Token`]s.
//!
//! The lexer aims to be as error-tolerant and UTF-8 friendly as possible (the
//! latter of which is... |
// This is a mostly drop-in reimplementation of vspipe.
// The main difference is what the errors look like.
#![allow(unused)]
#[macro_use]
extern crate failure;
use failure::{err_msg, Error, ResultExt};
#[cfg(all(
feature = "vsscript-functions",
any(feature = "vapoursynth-functions", feature = "gte-vsscript-... |
//! Migration utilities.
//!
//! # Migration workflow
//!
//! **Migration** refers to the ability to update data in indexes, remove indexes,
//! change index type, create new indexes, and package these changes in a way that they
//! can be atomically committed or rolled back. Accumulating changes in the migration,
//! ... |
#![allow (unused_imports)]
#[allow (unused_macros)]
macro_rules! printlnerr(
($($arg:tt)*) => { {use std::io::Write;
let r = writeln!(&mut ::std::io::stderr(), $($arg)*);
r.expect("failed printing to stderr");
} }
);
use std::fmt::Debug;
use std::ops::Deref;
use std::mem;
use serde::{Serialize... |
use std::io;
use std::io::Read;
use std::env;
use std::fs;
use serde_json::json;
use serde::{Serialize, Deserialize};
use serde_json::Value::Null;
use serde_json::Value::Bool;
use serde_json::Value::Number;
use serde_json::Value::String as JString;
use serde_json::Value::Array;
use serde_json::Value::Object;
use rege... |
//! Functions for handling the in-memory model of WordNet and loading it form
//! disk
//use glosstag::{Gloss,build_glosstags};
use std::collections::HashMap;
use links::{Link,LinkType};
use serde_json;
use rusqlite;
use wordnet_model::{Synset};
pub type WNKey=String;
///// A WordNet Key consisting of 8 digits and a... |
use super::helpers;
use crate::{
accessors::chain,
consensus::{engine_factory, FinalizationChange},
execution::{
analysis_cache::AnalysisCache,
processor::{execute_transaction, ExecutionProcessor},
tracer::{CallKind, MessageKind, NoopTracer, Tracer},
},
kv::{
mdbx::*,... |
//! The types output by the parser.
//!
//! This is a sort of "pre-AST" type, because the [parser](super::super::parser) does
//! parsing on demand, meaning that these types are shallow, or nonrecursive: the
//! unparsed [`LispVal`] data is deconstructed to a top level expression / pattern which
//! contains more `Lisp... |
use crate::config::{
self, BuildConfiguration, CConfiguration, CPPConfiguration, CPPStandard, CStandard,
Distribution, EzConfiguration, GCCConfiguration, GPPConfiguration, Language, OptimizationLevel,
};
use crate::tools::{Ar, GCC, GPP};
use blake3::Hash;
use glob::glob;
use lazy_static::lazy_static;
use memmap... |
/*!
Generate lexicographically-evenly-spaced strings between two strings
from pre-defined alphabets.
This is a rewrite of [mudderjs](https://github.com/fasiha/mudderjs); thanks
for the original work of the author and their contributors!
## Usage
Add a dependency in your Cargo.toml:
```toml
mudders = "0.0.4"
```
Now... |
use std::{
marker::PhantomData,
fmt::Debug,
path::Path,
fs::File
};
use async_trait::async_trait;
use hex_literal::hex;
use rand::{rngs::OsRng, RngCore};
use digest::Digest;
use serde::Deserialize;
use bitcoin::{
secp256k1,
hashes::hex::FromHex, hash_types::Txid,
blockdata::{script::Script, transaction... |
use super::{SelectedFrames, ERROR_COLOR, HOVER_COLOR};
use egui::*;
use puffin::*;
const TEXT_STYLE: TextStyle = TextStyle::Body;
#[derive(Clone, Copy, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub enum SortBy {
Time,
Name,
}
#[derive(Clone, Copy, Debug, ... |
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use std::str::FromStr;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut last_result = 0.0;
let mut result_idx = 0;
let globals = Globals::new();
let config = rustyline::config::Builder::new()
.edit_mode(rusty... |
// Modified version of https://github.com/zonyitoo/rust-ini
// To work with pacman-conf
// The MIT License (MIT)
// Copyright (c) 2014 <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 Soft... |
mod aliases;
mod error_util;
use actix_web::{App, error, HttpRequest, HttpResponse, HttpServer, post, Responder, web, dev, http};
use aliases::*;
use chrono::{Utc, Duration, DateTime, NaiveDateTime};
use deadpool_postgres::{Manager, ManagerConfig, Pool, RecyclingMethod};
use error_util::WebError;
use std::net::{ToSock... |
use flate2::bufread;
use memmap::Mmap;
use std::convert::TryInto;
use std::fs::File;
use std::fs::OpenOptions;
use std::io;
use std::io::prelude::*;
use std::io::Write;
mod utils {
use std::{fmt::Write, num::ParseIntError};
use micro_uecc_safe;
pub fn decode_hex(s: &str) -> Result<Vec<u8>, ParseIntError>... |
pub use self::player::Player;
pub use self::club_enemy::ClubEnemy;
pub use self::diamond_enemy::DiamondEnemy;
pub use self::heart_enemy::HeartEnemy;
pub use self::spade_enemy::SpadeEnemy;
pub mod bullets;
mod player;
mod club_enemy;
mod diamond_enemy;
mod heart_enemy;
mod spade_enemy;
use maat_graphics::math;
use ma... |
// 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... |
//! Web interface of docs.rs
pub(crate) mod page;
use log::{debug, info};
use serde_json::Value;
/// ctry! (cratesfyitry) is extremely similar to try! and itry!
/// except it returns an error page response instead of plain Err.
#[macro_export]
macro_rules! ctry {
($req:expr, $result:expr $(,)?) => {
matc... |
//! `async_utils` contains asynchronous functionality to avoid using the
//! terminal main thread to load data from remote sources or perform
//! calculations that would otherwise slow down the terminal behavior.
//! An async_coordinator is defined that receives requests over a futures mpsc
//! channel that may contain... |
// Copyright 2019 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.
use super::interrupter::Interrupter;
use super::transfer_ring_controller::{TransferRingController, TransferRingControllerError};
use super::usb_hub::{s... |
//! Circuits for the [RIPEMD160](https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf) hash function
//!
use algebra::PrimeField;
use r1cs_core::{ConstraintSystemAbstract, SynthesisError};
use r1cs_std::boolean::Boolean;
use r1cs_std::eq::MultiEq;
use r1cs_std::uint32::UInt32;
use r1cs_std::uint8... |
// 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.
use {
crate::{
cache::{Asset, AssetCache},
collection::{Typeface, TypefaceCollection},
font_info, manifest,
},
failure:... |
/*******************************************************************************
* Copyright (c) 2017 Association Cénotélie (cenotelie.fr)
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundati... |
use crate::message_processor::FUTURE_SLOT_TOLERANCE;
use crate::sync::network_context::SyncNetworkContext;
use beacon_chain::{BeaconChain, BeaconChainTypes, BlockProcessingOutcome};
use eth2_libp2p::rpc::methods::*;
use eth2_libp2p::rpc::RequestId;
use eth2_libp2p::PeerId;
use fnv::FnvHashMap;
use slog::{crit, debug, e... |
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::ClockReturn;
use crate::FlowReturn;
use crate::PadLinkReturn;
use crate::State;
use crate::StateChange;
use crate::StateChangeReturn;
use std::{cmp, ops};
use thiserror::Error;
use glib::translate::*;
use glib::value::FromValue... |
/*!
This library implements
[Unicode Canonical Combining Class](https://unicode.org/reports/tr44/#Canonical_Combining_Class_Values) detection.
```rust
use unicode_ccc::*;
assert_eq!(get_canonical_combining_class('A'), CanonicalCombiningClass::NotReordered);
assert_eq!(get_canonical_combining_class('\u{0A3C}'), Canon... |
/*
* Copyright 2020 <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 agree... |
//! The proof object model for RPN proofs used in Metamath.
use crate::diag::Diagnostic;
use crate::nameck::Nameset;
use crate::parser::as_str;
use crate::parser::{StatementAddress, StatementRef, StatementType, TokenPtr};
use crate::scopeck::{Hyp, ScopeResult};
use crate::segment_set::SegmentSet;
use crate::util::Hash... |
use crate::huffman::{bz2_hb_assign_codes, bz2_hb_make_code_lengths};
// use crate::private_ffi::sendMTFValues;
use crate::private_ffi::{
BZ2_blockSort, BZ_HDR_h, EState, BZ_G_SIZE, BZ_HDR_0, BZ_HDR_B, BZ_HDR_Z, BZ_MAX_SELECTORS,
BZ_N_GROUPS, BZ_N_ITERS, BZ_RUNA, BZ_RUNB,
};
use std::slice::from_raw_parts_mut;
... |
use super::ErrorReason;
use crate::curv::arithmetic::traits::Modulo;
use crate::curv::cryptographic_primitives::hashing::traits::Hash;
use crate::pari_init;
use crate::primitives::is_prime;
use crate::primitives::poe::PoEProof;
use crate::ABDeltaTriple;
use crate::BinaryQF;
use curv::arithmetic::traits::Samplable;
use ... |
//! Support for symbolication using the `gimli` crate on crates.io
//!
//! This is the default symbolication implementation for Rust.
use self::gimli::read::EndianSlice;
use self::gimli::NativeEndian as Endian;
use self::mmap::Mmap;
use self::stash::Stash;
use super::BytesOrWideString;
use super::ResolveWhat;
use supe... |
use core::{convert::TryInto, mem::swap};
use digest::generic_array::typenum::U64;
use digest::generic_array::GenericArray;
pub const DIGEST_BUF_LEN: usize = 8;
pub const HALF_DIGEST_BUF_LEN: usize = DIGEST_BUF_LEN / 2;
pub const WORK_BUF_LEN: usize = 16;
pub const H0: [u32; DIGEST_BUF_LEN] = [
0x6745_2301,
0x... |
use std::fmt::Error;
use std::fmt::Formatter;
use std::iter::Peekable;
use std::result::Result;
use std::slice::Iter;
use std::str::Chars;
use std::str::FromStr;
use rust_decimal::Decimal;
use crate::time::Time;
#[derive(Clone, PartialEq, Eq)]
pub(crate) enum Token {
Time(String),
Number(String),
Plus,
... |
// 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.
//! Provide Google Cloud Storage (GCS) access.
use {
anyhow::{bail, Context, Result},
async_lock::Mutex,
fuchsia_hyper::HttpsClient,
http:... |
use serde::{Deserialize, Serialize};
use serde_big_array::big_array;
const DEFAULT_HEADER: u32 = 0x00_00_04_1B;
const DEFAULT_WIDTH: u32 = 800;
const DEFAULT_HEIGHT: u32 = 600;
const DEFAULT_FIELD0: [u8; 4] = [0x20, 0x00, 0x00, 0x00];
const DEFAULT_FULL_SCREEN: bool = true;
const DEFAULT_FONT_SHADOWS: bool = true;
con... |
#[macro_use]
extern crate clap;
use futures_cpupool::CpuPool;
use hdrhistogram::Histogram;
use rand::Rng;
use std::cell::RefCell;
use std::fs;
use std::sync::{atomic, Arc, Barrier, Mutex};
use std::thread;
use std::time;
thread_local! {
static CLIENT: RefCell<Option<Box<VoteClient>>> = RefCell::new(None);
sta... |
use crate::{
ast_types::{
boxed_val::BoxedValue,
break_ast::{
Break,
BreakBase,
},
convert_tokens_into_arguments,
convert_tokens_into_res_expressions,
expression::{
Expression,
ExpressionBase,
},
fn_call:... |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(clippy::mo... |
use std::collections::HashMap;
use std::cmp;
use futures::Future;
use futures::future;
use futures::future::Loop;
use futures::future::loop_fn;
use futures::stream::Stream;
use futures;
use tokio_core::reactor;
use tokio_io::io::ReadHalf;
use tokio_io::io::WriteHalf;
use tokio_io::AsyncRead;
use tokio_io::AsyncWrite... |
use std::hash::BuildHasherDefault;
use std::num::{NonZeroU32, NonZeroU64};
use std::sync::Arc;
use font_kit::canvas::{Canvas, Format, RasterizationOptions};
use font_kit::family_name::FamilyName;
use font_kit::font::Font;
use font_kit::hinting::HintingOptions;
use font_kit::loader::Loader;
use font_kit::source::System... |
use widgets::*;
use crate::textbuffer::*;
#[derive(Clone)]
pub struct CodeEditor{
pub view:View<ScrollBar>,
pub bg_layout:Layout,
pub bg: Quad,
pub cursor: Quad,
pub marker: Quad,
pub tab:Quad,
pub text: Text,
pub cursors:CursorSet,
pub _hit_state:HitState,
pub _bg_area:Area,
... |
//! Source of wolfSSL and logic to build it.
//!
//! Largely based off the [`openssl-src`](https://github.com/alexcrichton/openssl-src-rs) crate.
use bitflags::bitflags;
use std::{
borrow::Cow,
env,
fs::{self, File},
io::{Read, Write},
path::{Path, PathBuf},
process::Command,
};
bitflags! {
... |
/*! Time filling, the library
## Useful ressources
<https://www.redblobgames.com/grids/hexagons/>
*/
use std::ops::{Add, Sub, Mul};
use std::ops::{Deref, DerefMut};
use std::fmt::{self, Debug};
use rand::prelude::*;
use arrayvec::ArrayVec;
// === Hex2 and HexBlock ===
/** Axial coordinates of a hexagon in a grid
... |
use log::{info, warn};
use lsp_types::*;
use nico::arena::BumpaloArena;
use nico::compiler;
use nico::language_server::{self, server::ServerCapabilitiesBuilder};
use nico::syntax::{
self, MissingTokenKind, Node, NodePath, ParseError, Parser, TextToken, Token, TokenKind, Trivia,
};
use serde::{Deserialize, Serialize... |
use crate::parse::BinOpKind;
use crate::scope::*;
use crate::value::*;
use crate::EvalError;
use gc::{Finalize, Gc, GcCell, Trace};
use rnix::types::Dynamic;
use rnix::{
types::{Pattern, Str, TokenWrapper, TypedNode, Wrapper},
StrPart, SyntaxNode, TextRange,
};
use std::str::FromStr;
use std::{borrow::Borrow, c... |
use crate::builtins::*;
use crate::compiler::NULL_STORAGE;
use crate::context::*;
use crate::globals::Globals;
use crate::leveldata::*;
use crate::value::*;
use errors::compiler_info::CodeArea;
use errors::{create_error, RuntimeError};
///types and functions used by the compiler
use parser::ast;
use shared::BreakType;
... |
// Copyright 2019, 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.