text stringlengths 9.08k 47.9k |
|---|
/*
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... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - INTCON register"]
pub intcon: crate::Reg<intcon::INTCON_SPEC>,
#[doc = "0x04 - INTCONCLR register"]
pub intconclr: crate::Reg<intconclr::INTCONCLR_SPEC>,
#[doc = "0x08 - INTCONSET register"]
pub intconset: crate::Re... |
//! The operational semantics of the language, implemented using [normalisation-by-evaluation].
//!
//! [normalisation-by-evaluation]: https://en.wikipedia.org/wiki/Normalisation_by_evaluation
use contracts::debug_ensures;
use once_cell::sync::OnceCell;
use std::cell::RefCell;
use std::sync::Arc;
use crate::lang::cor... |
use super::schema::key_blocks::dsl::*;
use super::schema::transactions::dsl::*;
use diesel::pg::PgConnection;
use diesel::query_dsl::QueryDsl;
use diesel::Connection;
use diesel::ExpressionMethods;
use diesel::RunQueryDsl;
use dotenv::dotenv;
use middleware_result::MiddlewareResult;
use middleware_result::*;
use models... |
#![allow(clippy::needless_doctest_main, clippy::must_use_candidate)]
//! `alog` is a simple log file anonymizer.
//!
//! ## About
//!
//! In fact by default `alog` just replaces the first *word* on every line of any input stream
//! with a customizable string.
//!
//! With version 0.6 you can (at a substantial cost of ... |
use bevy::prelude::*;
use rand::{prelude::IteratorRandom, seq::SliceRandom, Rng};
use tracing::info;
const CURRENT_SCREEN: crate::Screen = crate::Screen::Game;
pub mod ui;
struct ScreenTag;
pub struct Screen {
loaded: bool,
first_load: bool,
}
impl Default for Screen {
fn default() -> Self {
Scr... |
use crossbeam_channel::{self, Receiver, Sender};
use std::{
cmp,
convert::TryInto,
fmt::Debug,
io::Write,
iter,
net::Ipv4Addr,
num::NonZeroU32,
sync::atomic::{AtomicBool, Ordering},
thread,
time::Instant,
};
use structopt::StructOpt;
use tokio::runtime::Runtime;
use xsk_rs::{
... |
//! List of the active feature gates.
use super::{Feature, State};
use rustc_span::edition::Edition;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
macro_rules! set {
($field: ident) => {{
fn f(features: &mut Features, _: Span) {
features.$field = true;
}
f as fn... |
use crate::cx::*;
#[derive(Clone)]
pub struct ViewTexture {
sample_count: usize,
has_depth_stencil: bool,
fixed_size: Option<Vec2>
}
pub type ViewRedraw = Result<(), ()>;
#[derive(Clone)]
pub struct View { // draw info per UI element
pub view_id: Option<usize>,
pub is_clipped: bool,
pub is_ov... |
use std::cell::Cell;
use std::env;
use std::error::Error;
use std::ffi::OsStr;
use std::fmt;
use std::fs;
use std::io::prelude::*;
use std::os;
use std::path::{Path, PathBuf};
use std::process::Output;
use std::str;
use std::usize;
use serde_json::{self, Value};
use url::Url;
use hamcrest as ham;
use cargo::util::Proc... |
// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) a... |
// TODO: Revisit the design of `Event` once the `HashMap` raw interface is stabilised.
// Ideally `Value`s would be stored inline in `Event`.
use indexmap::IndexMap;
use std::{
borrow::Cow,
io::{self, Write},
mem,
num::NonZeroUsize,
};
use crate::{
error::{self, Error, ErrorKind, EventKind},
s... |
// Copyright 2018 Developers of the Rand project.
// Copyright 2013-2017 The Rust Project 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. Thi... |
pub mod channel;
pub mod server;
pub mod user;
use crate::audio::{sound_effects::NotificationEvents, AudioInput, AudioOutput};
use crate::error::StateError;
use crate::network::tcp::{DisconnectedReason, TcpEvent, TcpEventData};
use crate::network::{ConnectionInfo, VoiceStreamType};
use crate::notifications;
use crate:... |
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// This file is part of Parity Bridges Common.
// Parity Bridges Common 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, ... |
//! A [Compact Font Format Table](
//! https://docs.microsoft.com/en-us/typography/opentype/spec/cff) implementation.
// Useful links:
// http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/5176.CFF.pdf
// http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/5177.Type2.pdf
// https://github.co... |
use crate::errors;
use std::cmp;
use std::io::Write;
use std::sync::Arc;
use std::sync::RwLock;
const MAX_HEIGHT: usize = 12;
const N_KV: usize = 0;
const N_KEY: usize = 1;
const N_VAL: usize = 2;
const N_HEIGHT: usize = 3;
const N_NEXT: usize = 4;
pub type Key = Vec<u8>;
pub type Value = Vec<u8>;
pub struct MemDb<'... |
use crate::bxdf::{BxDF, Omega};
use itertools::Itertools;
use math::{
float::{Fallback, Float, Inside},
prob::Prob,
};
use radiometry::color::Color;
use std::{
f64::consts::{FRAC_1_PI, PI},
io::Read,
};
/*
File format description:
This is the file format generated by the material designer of the ... |
// Apple's reference decoder rarely checks for integer overflow and is written in C++ where signed
// overflow is undefined. In this implementation we try to return errors for obviously incorrect
// overflow but in tight loops, performance critical code, and where overflow is not necessarily
// incorrect wrapping arith... |
//! The `entry` module is a fundamental building block of Proof of History. It contains a
//! unique ID that is the hash of the Entry before it, plus the hash of the
//! transactions within it. Entries cannot be reordered, and its field `num_hashes`
//! represents an approximate amount of time since the last Entry was ... |
// QuiZX - Rust library for quantum circuit rewriting and optimisation
// using the ZX-calculus
// Copyright (C) 2021 - <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
//
/... |
#![allow(missing_docs)]
#![allow(dead_code)]
#![allow(unused_imports)]
//! Multiplex transport.
use async_std::task;
use futures::channel::mpsc::{channel, Receiver, SendError, Sender};
use futures::lock::Mutex;
use futures::prelude::*;
use futures::sink::SinkExt;
use futures::stream::StreamExt;
use futures::task::Cont... |
use std::cell::Cell;
use std::collections::{HashMap, HashSet};
use std::io;
use std::marker;
use std::mem;
use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::Arc;
use std::time::Duration;
use crossbeam_utils::thread::Scope;
use failure::format_err;
use jobserver::{Acquired, HelperThread};
use log::{debug... |
use serde_derive::*;
use std::fs;
use std::fs::{create_dir, read_to_string, File};
use std::io::{Error, ErrorKind, Write};
use std::path::Path;
use std::process;
use std::process::Command;
use std::str::FromStr;
use std::thread;
use std::time::{Duration, Instant};
use api::service::{
Disk, DiskType, Disks, JiraIn... |
// pathfinder/demo/src/ui.rs
//
// Copyright © 2019 The Pathfinder Project Developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be... |
use crate::error::{IntErr, Interrupt};
use crate::ident::Ident;
use crate::num::{Base, BaseOutOfRangeError, InvalidBasePrefixError, Number};
use std::{borrow, convert, fmt};
#[derive(Clone, Debug)]
pub(crate) enum Token {
Num(Number),
Ident(Ident),
Symbol(Symbol),
Whitespace,
StringLiteral(borrow::... |
use fallible_iterator::FallibleIterator;
use gimli::{EndianReader, LittleEndian};
use crate::arcdata::ArcData;
use crate::arch::Arch;
use crate::cache::{AllocationPolicy, Cache};
use crate::dwarf::{DwarfCfiIndex, DwarfUnwinder, DwarfUnwinding, UnwindSectionType};
use crate::error::{Error, UnwinderError};
use crate::in... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control A"]
pub ctrla: CTRLA,
_reserved1: [u8; 1usize],
#[doc = "0x02 - Synchronization Busy"]
pub syncbusy: SYNCBUSY,
#[doc = "0x03 - USB Quality Of Service"]
pub qosctrl: QOSCTRL,
_reserved3: [u8; 4usize],... |
use itertools::Itertools;
use nalgebra::allocator::Allocator;
use nalgebra::{DefaultAllocator, DimName, OPoint, Point3, RealField, Scalar, Vector3, U3};
use numeric_literals::replace_float_literals;
use serde::{Deserialize, Serialize};
use std::cmp::{max, min};
use std::collections::{BTreeMap, BTreeSet, HashMap};
use s... |
use i73_base::distribution::{Chance, ChanceOrdering, Distribution, Linear, Packed2, Packed3};
use i73_base::matcher::BlockMatcher;
use i73_base::math;
use i73_base::block::Block;
use i73_trig as trig;
use java_rand::Random;
use std::cmp::{max, min};
use vocs::position::{ColumnPosition, GlobalColumnPosition};
use vocs::... |
// This file is copied pretty directly from
// https://github.com/MaikKlein/ash/blob/master/examples/src/bin/triangle.rs
// with the only major differences being
// 1) the minimum vulkan version bumped from v1.0 to v1.1
// 2) the path to the vertex shader is env!("example_shader.spv"), i.e.
// let vertex_shader_file = ... |
//! Keeps track of `Pod`, `Server`, and `ServerAuthorization` resources to
//! provide a dynamic server configuration for all known ports on all pods.
//!
//! The `Index` type exposes a single public method: `Index::pod_server_rx`,
//! which is used to lookup pod/ports (i.e. by the gRPC API). Otherwise, it
//! implemen... |
//! This module handles the parsing of a [template](`super::Template`).
#[cfg(test)]
mod tests;
use color_eyre::eyre::{eyre, Result};
use color_eyre::Report;
use super::block::{Block, BlockHint, If, IfExpr, IfOp, Var, VarEnv, VarEnvSet};
use super::diagnostic::{Diagnostic, DiagnosticBuilder, DiagnosticLevel};
use su... |
#![feature(proc_macro_span, proc_macro_diagnostic, proc_macro_def_site)]
#![doc = include_str!("../README.md")]
extern crate proc_macro;
extern crate itertools;
use itertools::Itertools;
mod syntax;
use proc_macro::{
TokenStream,
TokenTree,
Span,
Group,
Delimiter,
Literal,
Spacing,
};
... |
//! This crate provides to an interface into the linux `procfs` filesystem, usually mounted at
//! `/proc`.
//!
//! This is a pseudo-filesystem which is available on most every linux system and provides an
//! interface to kernel data structures.
//!
//!
//! # Kernel support
//!
//! Not all fields/data are available in... |
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
#![cfg(target_arch = "x86_64")]
//! Reference VMM built with rust-vmm components and minimal glue.
#![deny(missing_docs)]
use std::convert::TryFrom;
use std::ffi::CString;
use std::fs::Fi... |
#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit = "256"]
use frame_election_provider_support::onchain::OnChainSequentialPhragmen;
use frame_support::{
PalletId,
construct_runtime, match_type, parameter_type... |
#![doc(
html_logo_url = "https://raw.githubusercontent.com/urschrei/lonlat_bng/master/points.png",
html_root_url = "https://urschrei.github.io/lonlat_bng/"
)]
//! The `lonlat_bng` crate provides functions that convert decimal (WGS84 / ETRS89) longitude
//! and latitude coordinates into [British National Grid](h... |
//! Dotrix terrain implementation
//!
//! This crate is under active development
#![doc(html_logo_url = "https://raw.githubusercontent.com/lowenware/dotrix/master/logo.png")]
#![warn(missing_docs)]
mod marching_cubes;
mod voxel_map;
pub mod octree;
pub use marching_cubes::*;
pub use voxel_map::*;
use std::{
coll... |
//! ress
//! A crate for parsing raw JS into a token stream
//!
//! The primary interfaces are the function [`tokenize`][tokenize] and
//! the struct [`Scanner`][scanner]. The [`Scanner`][scanner] struct impls [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html)
//! and the [`tokenize`][tokenize] functi... |
// 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.
//! AuthCache manages an in-memory cache of recently used short-lived authentication tokens.
#![deny(missing_docs)]
use chrono::offset::Utc;
use chrono::D... |
//! The `faucet` module provides an object for launching a Solana Faucet,
//! which is the custodian of any remaining lamports in a mint.
//! The Solana Faucet builds and sends airdrop transactions,
//! checking requests against a single-request cap and a per-IP limit
//! for a given time time_slice.
use {
bincode... |
use bulletproofs::ProofError;
use bulletproofs::RangeProof;
use bulletproofs::{BulletproofGens, PedersenGens};
use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint};
use curve25519_dalek::scalar::Scalar;
use merlin::Transcript;
use rayon::prelude::*;
pub mod errors;
use self::errors::L2RangeProofError... |
use serde_derive::{Deserialize, Serialize};
use crate::params::Timestamp;
use crate::resources::{CardBrand, CardType};
/// An enum representing the versions of the Stripe API.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum ApiVersion {
#[serde(ren... |
/*
SPDX-License-Identifier: Apache-2.0 OR MIT
*/
use amcl_wrapper::field_elem::{FieldElement, FieldElementVector};
use amcl_wrapper::group_elem::{GroupElement, GroupElementVector};
use amcl_wrapper::group_elem_g1::{G1Vector, G1};
use crate::transcript::TranscriptProtocol;
use merlin::Transcript;
use crate::error... |
#![deny(missing_docs)]
//! This crate provides a [Egui](https://github.com/emilk/egui) integration for the [Bevy](https://github.com/bevyengine/bevy) game engine.
//!
//! **Trying out:**
//!
//! An example WASM project is live at [mvlabat.github.io/bevy_egui_web_showcase](https://mvlabat.github.io/bevy_egui_web_showca... |
//---------------------------------------------------------------------------//
// Copyright (c) 2017-2020 <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;
use vec3::Vec3;
use vec4::Vec4;
use quat::Quat;
use std::f32::consts::PI;
#[derive(Clone, Copy)]
pub struct Mat4 {
pub rows: [Vec4; 4],
}
impl Mat4 {
pub fn identity() -> Mat4 {
Self::default()
}
pub fn frustum(top: f32, left: f32, right: f32, bottom: f32, near: f32, far: f32) -> Mat... |
use std::mem;
use logos::Logos;
use crate::builtins::String;
use crate::diagnostic::{Diagnostic, Label, Severity};
use crate::lexer::{Lexer, Token, TokenKind, T};
use crate::span::FreeSpan;
use crate::ObjectRef;
pub mod ast;
use ast::*;
// Parsing implementation
//
// This parsing algorithm is **not** resilient,... |
//! # Categorization
//!
//! The job of the categorization module is to analyze an expression to
//! determine what kind of memory is used in evaluating it (for example,
//! where dereferences occur and what kind of pointer is dereferenced;
//! whether the memory is mutable, etc.).
//!
//! Categorization effectively tr... |
use mech_core::{Core, humanize, Register, Transaction, Change, Error, ErrorType};
use mech_core::{Block, BlockState};
use mech_core::{Table, TableId, TableIndex};
use mech_core::hash_string;
use mech_syntax::compiler::Compiler;
use mech_utilities::{maximize_block, RunLoopMessage, MechSocket, MechCode, Machine, MachineR... |
use crate::page_map::{FileDescriptor, FileOffset};
use super::{
MmapPageSerialization, Page, PageAllocatorInner, PageAllocatorSerialization,
PageDeltaSerialization, PageInner, PageValidation, ALLOCATED_PAGES,
};
use cvt::{cvt, cvt_r};
use ic_sys::{page_bytes_from_ptr, PageBytes, PageIndex, PAGE_SIZE};
use libc... |
//! Creates a memory representations of the note by inserting _Tp-Note_'s
//! environment data in some templates. If the note exists on disk already,
//! the memory representation is established be reading the note file with
//! its front matter.
use crate::config::CFG;
use crate::content::Content;
use crate::error::N... |
//! Arrangement of bits in a Data Matrix symbol.
//!
//! The module contains the struct [MatrixMap] which can be used to
//! to iterate over the bit
//! positions of each codeword in the final symbol, i.e., how the black squares are
//! mapped to the encoded data as bytes. This is used to write
//! the encoded data int... |
use crate::parser::{
ast::{ExprKind, If},
parser::SyntaxObject,
tokens::TokenType,
tryfrom_visitor::TryFromExprKindForSteelVal,
};
use crate::rerrs::{ErrorKind, SteelErr};
use crate::rvals::{Result, SteelVal};
use crate::{
compiler::compiler::OptLevel,
parser::{
ast::{Atom, Begin, Define... |
//! Install tools and build the `esp-idf` using native tooling.
use std::convert::TryFrom;
use std::ffi::OsString;
use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::{env, fs};
use anyhow::{anyhow, bail, Context, Error, Result};
use embuild::cargo::IntoWarning;
use embuild::cmake::file_api::codemodel::La... |
use std::{
cmp::{max, min},
collections::HashMap,
fs::{self, File},
net::SocketAddr,
path::{Path, PathBuf},
sync::Arc,
time::Duration,
};
use candid::CandidType;
use garcon::Delay;
use ic_agent::{
agent::http_transport::ReqwestHttpReplicaV2Transport, ic_types::Principal,
identity::B... |
use super::*;
use num_traits::{bounds::Bounded, AsPrimitive, FromPrimitive, Unsigned};
/// Find a element `K` that will split the given `bucket` in half at specified element index of key.
/// For example: if key is ["a", "b", "c"] and ["a", "c", "d"], given index is 1, the returned `K` will be
/// "c". If given idex ... |
// Copyright (C) 2014 The 6502-rs Developers
// All rights reserved.
//
// 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 ... |
//! This module contains util functions for testing scenarios
use super::DbScenario;
use arrow::record_batch::RecordBatch;
use arrow_util::optimize::{optimize_record_batch, optimize_schema};
use async_trait::async_trait;
use backoff::BackoffConfig;
use data_types::{
DeletePredicate, NonEmptyString, PartitionId, Seq... |
#[cfg(test)]
mod tests;
use super::disjunction::Disjunction;
use super::Config;
use crate::annis::db::exec::filter::Filter;
use crate::annis::db::exec::indexjoin::IndexJoin;
use crate::annis::db::exec::nestedloop::NestedLoop;
use crate::annis::db::exec::nodesearch::{NodeSearch, NodeSearchSpec};
use crate::annis::db::e... |
use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use pathfinding::prelude::dijkstra;
use ggez::graphics as ggraphics;
use tiled;
use torifune::numeric;
use sub_screen::SubScreen;
use torifune::core::*;
use torifune::graphics::drawable::*;
use torifune::graphics::object::sub_screen;
use torifun... |
//! This crate provides a user-friendly driver for the Pololu Simple Motor Controller G2, for use on embedded hardware.
//!
//! It uses traits from the [`embedded_hal`] crate in order to be independent from end user hardware.
//! Currently only the I<sup>2</sup>C protocol is implemented.
//!
//! This documentation is h... |
use self::instruction_table::*;
use crate::{
common::*,
continuation::{interrupt::*, interrupt_data::*, resume_data::*, *},
instructions::{control::*, stack_manip::*, *},
state::*,
tracing::Tracer,
*,
};
use ethnum::U256;
use std::{ops::Generator, sync::Arc};
fn check_requirements(
instruct... |
//! # eyros
//!
//! eyros (εύρος) is a multi-dimensional interval database.
//!
//! The database is based on [bkd][] and [interval][] trees.
//!
//! * high batch-write performance (expect 100,000s to 1,000,000s writes per second
//! on modest hardware)
//! * designed for peer-to-peer distribution and query-driven spa... |
/// <https://datatracker.ietf.org/doc/html/rfc6455#section-5.2>
use bytes::{Buf, BufMut, Bytes, BytesMut};
use futures_util::{Sink, SinkExt, StreamExt};
use tokio::io::{AsyncRead, AsyncWrite};
use tokio_util::codec::{Decoder, Encoder, Framed};
use std::{
mem::take,
pin::Pin,
string::FromUtf8Error,
task... |
use crate::view::Palette;
use clap::{ArgGroup, Parser as Clap, Subcommand, ValueHint};
use color_eyre::eyre::WrapErr;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::fs;
use std::ops::Not;
use std::path::PathBuf;
use std::process::Command;
use std::str::FromStr;
use std::time::Duration;
use tonic::transport... |
// Copyright 2022 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.
//! Defines generic data structures used to implement common application socket
//! functionality for multiple protocols.
//!
//! The core of this module i... |
/*
******************************************************************************
Project: OWA EPANET
Version: 2.2
Module: types.h
Description: symbolic constants and data types used throughout EPANET
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 0... |
use actix_web::actix::Actor;
use actix_web::http;
use actix_web::server;
use actix_web::App;
use actix_web::HttpRequest as OriginalHttpRequest;
use actix_web::HttpResponse;
use actix_web::Json;
use chrono::Local;
use futures::future::Future;
use futures::future::IntoFuture;
use libcommon::kafka::HandlerError;
use libco... |
#![allow(non_snake_case, non_upper_case_globals, non_camel_case_types)]
extern crate core_foundation_sys;
extern crate libc;
use core_foundation_sys::string::*;
use core_foundation_sys::base::*;
use core_foundation_sys::data::*;
use core_foundation_sys::array::*;
use core_foundation_sys::dictionary::*;
pub type UInt... |
// pathfinder/geometry/src/basic/transform3d.rs
//
// Copyright © 2019 The Pathfinder Project Developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. T... |
#![allow(dead_code)]
use crate::{cp1252, hash};
use log::{error, info, trace, warn};
use std::{error, fmt, fs, io, path};
trait ReadSeek: io::Read + io::Seek {}
impl<T: io::Read + io::Seek> ReadSeek for T {}
/// Represents an error when reading a BSA file
#[non_exhaustive]
#[derive(Debug)]
pub enum ReadError {
M... |
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
/*
* Copyright (C) 2015 <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 a... |
extern crate arrayvec;
#[macro_use] extern crate clap;
extern crate common;
extern crate event_loop;
extern crate gamenet_teeworlds_0_6 as gamenet;
extern crate hexdump;
extern crate itertools;
#[macro_use] extern crate log;
extern crate logger;
extern crate packer;
extern crate rand;
extern crate snapshot;
extern crat... |
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
//! A lexical analyzer for JavaScript source code.
//!
//! The Lexer splits its input source code into a sequence of input elements called tokens, represented by the [Token](../ast/token/struct.Token.html) structure.
//! It also removes whitespace and comments and attaches them to the next token.
#[cfg(test)]
mod test... |
#![no_main]
#![no_std]
// could try this:
// http://nercury.github.io/rust/embedded/experiments/2019/01/27/rust-embedded-02-measuring-the-clock.html
// or
// http://pramode.in/2018/02/20/programming-a-microcontroller-in-rust-at-four-levels-of-abstraction
// https://github.com/TeXitoi
// https://github.com/adamgreig
pu... |
use crate::asset::storage::AssetsClient;
use crate::asset::{AssetId, StrongAssetId, Weak, WeakAssetId};
use crate::prelude::Texture;
use crate::render::buffer::Vertex;
use crate::render::canvas::RawInstance;
use crate::render::mesh::Mesh;
use crate::render::pipeline::Pipeline;
use crate::render::view::FilterMode;
use c... |
use crate::{
cell::{UnsafeCell, UntrackedUnsafeCell},
sync::{Arc, AtomicUsize, Mutex, Ordering},
thread::JoinHandle,
*,
};
use crossbeam_utils::Backoff;
use std::{
collections::LinkedList,
io::{
self,
Error as IoError,
ErrorKind as IoErrorKind,
Read,
Result as IoResult,
Seek,
SeekFrom,
},
mem::{se... |
//! D-Bus standard interfaces.
//!
//! The D-Bus specification defines the message bus messages and some standard interfaces that may
//! be useful across various D-Bus applications. This module provides their proxy.
use enumflags2::BitFlags;
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Seri... |
use std::collections::HashMap;
use dhall_syntax::Const::Type;
use dhall_syntax::{
BinOp, Builtin, ExprF, InterpolatedText, InterpolatedTextContents, Label,
NaiveDouble,
};
use crate::core::value::Value;
use crate::core::valuef::ValueF;
use crate::core::var::{AlphaLabel, Shift, Subst};
use crate::phase::Normal... |
// 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::PowerManagerError;
use crate::log_if_err;
use crate::message::{Message, MessageReturn};
use crate::node::Node;
use crate::thermal_limiter... |
// 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... |
//! SPI SD Card driver for K210 SPI SD Card Slot
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
use k210_pac::{Peripherals, SPI0};
use k210_hal::prelude::*;
use k210_soc::{
gpio,
gpiohs,
spi::{aitm, tmod, work_mode, frame_format, SPI, SPIExt, SPIImpl},
fpioa::{self, io},
... |
/*!
This crate provides a number of conversion traits with more specific semantics than those provided by `as` or `From`/`Into`.
The goal with the traits provided here is to be more specific about what generic code can rely on, as well as provide reasonably self-describing alternatives to the standard `From`/`Into` tr... |
#![allow(non_snake_case)] // for operations such as 0xAnnn
use std::fs;
use rand;
const FONT_SET: [u8; 80] = [
// 16 sprites, each is 5 bytes long
0xF0, 0x90, 0x90, 0x90, 0xF0, 0x20, 0x60, 0x20, 0x20, 0x70, 0xF0, 0x10, 0xF0, 0x80, 0xF0, 0xF0,
0x10, 0xF0, 0x10, 0xF0, 0x90, 0x90, 0xF0, 0x10, 0x10, 0xF0, 0x... |
//! A general purpose spline with explicit control.
use std::borrow::Cow;
use kurbo::{Affine, BezPath, PathEl, Point, Vec2};
#[cfg(feature = "serde")]
use serde_::{Deserialize, Serialize};
use crate::hyperbezier::{self, HyperBezier, ThetaParams};
use crate::simple_spline;
use crate::util;
/// The specification of a... |
use crate::arch;
use crate::arch::address::VirtAddr;
use crate::arch::paging::{ActiveMapping, EntryFlags, PAGE_SIZE};
use crate::mm::buddy;
use crate::mm::buddy::Tree;
use crate::mm::mapper::MemoryMapper;
use crate::sync::spinlock::Spinlock;
use crate::util::unchecked::UncheckedUnwrap;
use core::alloc::{GlobalAlloc, La... |
//! This module implements the central application object.
extern crate num_cpus;
use std::convert::Into;
use std::sync::RwLock;
use std::fmt;
use std::collections::HashMap;
use std::error::Error;
use std::fs::File;
use std::path::PathBuf;
use std::net::ToSocketAddrs;
use serde_json::{Value};
use serde::Serialize;
us... |
#![allow(dead_code)]
#[cfg(feature = "rayon")]
use rayon::prelude::*;
/// Gets the index (into Int. Crys. Handbook Vol A 2016) for the given symbol. First it is
/// interpreted as a Herman Mauguin symbol, if that is unsuccessful it is interpreted as a
/// Hall symbol.
pub fn get_index_for_symbol(symbol: impl AsRef<str... |
use self::traits::*;
use super::*;
use crossbeam::deque;
const WORKER_MESSAGE_QUEUE_COUNT: usize = 10;
/// The static TIMESLICE_IN_MILLIS is the timeslice that a machine is allowed to use before
/// being returned to the scheduler. While processing the message queue, if the machine
/// has not exhausted its timeslice... |
// Copyright 2012-2016 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... |
use super::TOIEntry;
use crate::data::{BundleSet, ComponentSet, ComponentSetMut, ComponentSetOption};
use crate::dynamics::{IslandManager, RigidBodyColliders, RigidBodyForces};
use crate::dynamics::{
RigidBodyCcd, RigidBodyHandle, RigidBodyMassProps, RigidBodyPosition, RigidBodyVelocity,
};
use crate::geometry::{
... |
// Generated from definition io.k8s.api.core.v1.Volume
/// Volume represents a named volume in a pod that may be accessed by any container in the pod.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Volume {
/// AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machin... |
mod block;
mod panorama;
mod params;
mod tallies;
mod vote;
mod weight;
#[cfg(test)]
pub(crate) mod tests;
pub(crate) use params::Params;
pub(crate) use weight::Weight;
pub(super) use panorama::{Observation, Panorama};
pub(super) use vote::Vote;
use std::{borrow::Borrow, cmp::Ordering, collections::HashMap, convert... |
//! Connecting to WhatsApp Web via the websocket protocol.
//!
//! This is a reimplementation of the original `connection` module,
//! using `futures` and somewhat sane coding practices.
use tokio_tungstenite as ws;
use ws::MaybeTlsStream;
use ws::tungstenite::Message;
use tokio::net::TcpStream;
use std::collections::... |
// Copyright 2020 <NAME>. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
#![deny(warnings)]
#[macro_use(crate_authors, crate_version)]
extern crate clap;
#[macro_use]
extern crate anyhow;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_json;
#[macro_use]
extern crate ... |
//! Core of the crate, where the `compress_files` and `decompress_file` functions are implemented
//!
//! Also, where correctly call functions based on the detected `Command`.
use std::{
io::{self, BufReader, BufWriter, Read, Write},
ops::ControlFlow,
path::{Path, PathBuf},
};
use fs_err as fs;
use utils:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.