text
stringlengths
7.05k
33.9k
//! FFI-compatible types that may also be exposed to Rust code. use std::fmt; // This macro enforces that all `bitflags!` types in here are marked // `#[repr(transparent)]` and thus FFI-safe. macro_rules! bitflags { ($($t:tt)*) => { bitflags::bitflags! { #[repr(transparent)] $($t)*...
use lyon::math::*; use lyon::tessellation::geometry_builder::*; use lyon::tessellation::basic_shapes::*; use lyon::tessellation::{FillTessellator, StrokeTessellator, FillOptions}; use lyon::tessellation; use lyon::algorithms::hatching::*; use lyon::algorithms::aabb::bounding_rect; use lyon::path::Path; use commands::{T...
use crate::param::{ParamKind, ParamList, ParamStruct}; use quick_xml::events::attributes::Attributes; use quick_xml::events::{BytesDecl, BytesEnd, BytesStart, BytesText, Event}; use quick_xml::{Reader, Writer}; use std::io::{BufRead, Error as ioError, Read, Write}; use std::str::{from_utf8, FromStr, Utf8Error}; pub u...
use crate::adapter::Adapter; use crate::packet::{Packet, PacketData, PacketType}; use crate::server::ServerOptions; use crate::transport::{ PollingTransport, PollingTransportOptions, RequestReply, Transport, TransportBase, TransportCmd, TransportCreateData, TransportError, TransportEvent, TransportKind, Web...
use std::{fmt, mem, ptr, slice}; use std::cmp::Ordering; use std::collections::BTreeMap; use std::collections::HashSet; use std::ffi::CString; use std::hash::{Hash, Hasher}; use std::os::raw::{c_char, c_void}; use std::path::Path; use uuid::Uuid; use errors::ErrorKind::{ParseIdError, ProcessError}; use errors::Result;...
#![no_std] #![feature(get_mut_unchecked, allocator_api)] #[warn(non_snake_case)] #[warn(dead_code)] #[warn(unused_must_use)] extern crate alloc; pub mod console_msgs; use rust_kernel_rdma_base::*; use KRdmaKit::rust_kernel_rdma_base; // rust_kernel_rdma_base use rust_kernel_rdma_base::linux_kernel_module; // linux_ke...
#![allow(dead_code, non_camel_case_types, non_upper_case_globals, non_snake_case)] use std::os::raw::{c_char, c_double, c_float, c_int, c_short, c_uchar, c_uint, c_ushort, c_void}; pub type al_boolean = c_char; pub type al_char = c_char; pub type al_byte = c_char; pub type al_ubyte = c_uchar; pub type al_short = c_sh...
//! Parses a protocol JSON file, outputting a `Protocol`. use anyhow::{anyhow, bail}; use heck::{CamelCase, SnakeCase}; use indexmap::map::IndexMap; use serde_json::{Map, Value}; use std::collections::HashMap; use std::collections::VecDeque; use thiserror::Error; pub type PacketIdentifier = String; pub type PacketName...
// Copyright 2015-2020 Parity Technologies (UK) Ltd. // This file is part of Parity Ethereum. // Parity Ethereum 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 yo...
#![no_std] #![allow(arithmetic_overflow)] #![allow(clippy::many_single_char_names)] #[cfg(test)] extern crate clickhouse_driver_cth; #[cfg(test)] extern crate std; use core::mem::size_of; use core::ptr::read_unaligned; #[derive(Debug, PartialEq)] pub struct Pair(pub u64, pub u64); /// Compare Hash with first 16 byte...
//! Concrete Syntax Tree for the Turing language #[allow(clippy::match_like_matches_macro)] // Code generation generates them like this #[allow(clippy::upper_case_acronyms)] // Names are pulled from the grammar file exactly pub mod ast; use std::fmt; use std::ops::Range; use num_traits::{FromPrimitive, ToPrimitive}; ...
#![cfg(any(target_arch = "arm", target_arch = "aarch64"))] #[cfg(target_arch = "aarch64")] use std::arch::aarch64::*; #[cfg(target_arch = "arm")] use std::arch::arm::*; #[cfg(all(target_arch = "arm", target_feature = "neon"))] use std::arch::asm; use std::{ptr, str}; use crate::bitap_neon::{movemask, Bitap8x16}; use...
/* Copyright 2018 <NAME> * * Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or * http://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...
use super::AstTransformation; use crate::vm::ast::PartialType::Complete; use crate::vm::ast::{Ast, IsTypesInferred, LinkedNodeBody, TypesChecked}; use crate::vm::ast::{AstBranch, Node}; use crate::vm::ast::{ErrPart, NodeID, NodeType}; use crate::vm::ast::{NBCall, NBProcedureDeclaration}; use crate::vm::{ast, transform}...
use crate::frontend::gui::selection::{SelectionCoordinate, SelectionRange}; use crate::frontend::gui::termwindow::TermWindow; use crate::mux::domain::DomainId; use crate::mux::renderable::*; use crate::mux::tab::{Pattern, SearchResult}; use crate::mux::tab::{Tab, TabId}; use portable_pty::PtySize; use rangeset::RangeSe...
use anyhow::{bail, Result}; use async_trait::async_trait; use bytecheck::CheckBytes; use fnv::FnvHashMap; use futures::{ channel::mpsc, io::{AsyncRead, AsyncWrite}, prelude::*, }; #[cfg(not(target_family = "wasm"))] use libp2p::mdns; use libp2p::{ ping, request_response::{ self, ProtocolName...
use crate::md::Md; use anyhow::{Context, Error, Result}; use log::{debug, error, info}; use reqwest::blocking::{self, Client}; use serde_json::from_slice; use std::path::{Path, PathBuf}; use translation_api_cn::{ baidu::User as Baidu, niutrans::User as Niutrans, tencent::User as Tencent, Limit, }; #[derive(Debug, ...
use std::{collections::BTreeMap, ffi::OsStr, fs, path::Path, str::FromStr}; use fixed::types::I64F64; use serde::{ ser::{SerializeMap, SerializeSeq}, Serialize, }; use serde_json::{Map as JsonMap, Number as JsonNumber, Value as JsonValue}; use serde_yaml::{Number as YamlNumber, Value as YamlValue}; use toml::{...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. use crate::{ fail::Fail, protocols::{ ethernet2::frame::{ Ethernet2Header, MIN_PAYLOAD_SIZE, }, ip, ipv4::datagram::{ Ipv4Header, Ipv4Protocol2, }, ...
extern crate xdg; use libc::size_t; use serde::Deserialize; use std::env; use std::ffi::{CStr, CString}; use std::os::raw::c_char; // Intermediate structures #[derive(Debug, Deserialize)] enum Action { Close, ConfigReload, Execute(String), Expand, FocusDown, FocusUp, FocusOutput(u8), ...
use prim::{self, Color4, Vector2, Vector3}; use ffi; use std::{mem, ptr, slice, str}; use libc::{c_uint, c_int, c_char}; pub type TextureIdx = c_uint; /// Name for default materials (2nd is used if meshes have UV coords) pub const DEFAULT_MATERIAL_NAME: &'static str = "DefaultMaterial"; /// Defines how the Nth textu...
use std::collections::HashMap; use std::error; use std::fmt; use std::fs::File; use std::io::{self, BufReader, BufRead}; use std::str; #[derive(Debug)] enum AsmError { InvalidInstruction, InvalidAddressing, InvalidLabel, DuplicateSymbol, UnresolvedReference, MissingRightBracket, ArgumentTooLarge(u...
use indexmap::{IndexMap, IndexSet}; use instant::{Duration, Instant}; use log::*; use crate::{EGraph, Id, Language, Metadata, RecExpr, Rewrite, SearchMatches}; /** Faciliates running rewrites over an [`EGraph`]. One use for [`EGraph`]s is as the basis of a rewriting system. Since an egraph never "forgets" state when...
use alloc_crate::boxed::Box; use alloc_crate::sync::Arc; use core::cell::UnsafeCell; use core::mem; use core::ops::Deref; use core::ptr; use core::ptr::NonNull; use core::sync::atomic::{AtomicBool, AtomicPtr, AtomicU64, Ordering}; use core::task::Waker; use super::async_task; use super::scheduling; use super::scheduli...
// External. use druid::widget::prelude::*; use druid::widget::{ Button, Container, CrossAxisAlignment, Flex, Label, Padding, SizedBox, TextBox, }; use druid::{Application, Data, Lens, LensExt, WidgetExt}; use sfml::audio::{Sound, SoundBuffer, SoundStatus}; // Std. use std::thread; use std::time::Duration; // Cus...
//! CDC-ACM serial port example using cortex-m-rtfm. #![no_main] #![no_std] #![allow(non_snake_case)] #![allow(dead_code)] #![allow(unused_imports)] use core::{ panic::PanicInfo, sync::atomic::{self, Ordering}, str::from_utf8_unchecked, ptr::{ read_volatile, write_volatile, }, c...
//! The TCP stream between a client and the DAC. mod output; use ether_dream::dac; use ether_dream::protocol::{self, command, Command as CommandTrait, ReadBytes, SizeBytes, WriteBytes}; use std::io::{self, Read, Write}; use std::{net, thread}; pub use self::output::Output; /// A stream of communication between a DA...
use cpu::Interrupt; use {SCREEN_WIDTH,SCREEN_HEIGHT,SCREEN_BUFFER_SIZE}; pub const NUM_SPRITES: usize = 40; const NUM_VISIBLE_SPRITES_PER_LINE: usize = 10; const TILE_LINES_SIZE: usize = 0x1800 / 2; const BG_MAP_SIZE: usize = 0x400; const SPRITE_RAM_SIZE: usize = NUM_SPRITES * 4; const SCREEN_DATA_SIZE: usize = SCREEN...
use anyhow::Context; use clap::{crate_version, App, Arg, ArgGroup, ArgSettings}; use libav::{demux::ThdStreamInfo, truehd::ThdMetadata, MediaDuration}; use log::*; use mpls::{Mpls, PlayItem}; use num_format::{Locale, ToFormattedString}; use simplelog::*; use std::fs::File; use std::{ io::BufWriter, path::{Path,...
//! `ra_hir_expand` deals with macro expansion. //! //! Specifically, it implements a concept of `MacroFile` -- a file whose syntax //! tree originates not from the text of some `FileId`, but from some macro //! expansion. pub mod db; pub mod ast_id_map; pub mod name; pub mod hygiene; pub mod diagnostics; pub mod buil...
// 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...
//! Contains all structures and methods to create and manage particle systems. //! //! Particle system used to create visual effects that consists of many small parts, //! this can be smoke, fire, dust, sparks, etc. Particle system optimized to operate //! on many small parts, so it is much efficient to use particle sy...
use crevice::std140::AsStd140; use crate::{ context::{Has, HasMut}, GameError, GameResult, }; use super::{ gpu::arc::{ArcBindGroup, ArcBindGroupLayout}, internal_canvas::{screen_to_mat, InstanceArrayView, InternalCanvas}, BlendMode, Color, DrawParam, Drawable, GraphicsContext, Image, InstanceArray...
//! See `Semantics`. use std::{cell::RefCell, fmt, iter::successors}; use hir_def::{ resolver::{self, HasResolver, Resolver}, DefWithBodyId, TraitId, }; use ra_db::{FileId, FileRange}; use ra_syntax::{ algo::{find_covering_element, skip_trivia_token}, ast, match_ast, AstNode, Direction, NodeOrToken, S...
use std::collections::HashMap; use lazy_static::lazy_static; use crate::err::ProcessingResult; use crate::gen::codepoints::{ATTR_QUOTE, DIGIT, DOUBLE_QUOTE, NOT_UNQUOTED_ATTR_VAL_CHAR, SINGLE_QUOTE, WHITESPACE}; use crate::proc::checkpoint::WriteCheckpoint; use crate::proc::entity::maybe_normalise_entity; use crate::...
#![warn(clippy::pedantic)] use std::error::Error; use std::io::Write; use std::process::exit; use clap::{crate_authors, crate_version, App, Arg}; use sigils_of_elohim_solver::{solve_one, Position}; struct Puzzle { section: &'static str, color: &'static str, number: u32, row_count: u32, column_co...
use log::{error, info, warn}; use raft::eraftpb::Message; use raft::prelude::{ConfChange, ConfChangeType, EntryType}; use raft::storage::MemStorage; use raft::{Config, Error, ProgressTracker, RawNode, StateRole, StorageError}; use std::sync::Mutex; use crate::base::node_contains_raft_group; use crate::base::LocalConte...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::BCS_EXTENSION; use anyhow::{anyhow, bail, Result}; use disassembler::disassembler::Disassembler; use move_binary_format::{ access::ModuleAccess, binary_views::BinaryIndexedView, file_format::{CompiledModule, Compi...
use crate::socket::SocketHandle; use crate::socket::{Context, SocketMeta}; use crate::time::{Duration, Instant}; use crate::wire::dhcpv4::field as dhcpv4_field; use crate::wire::{ DhcpMessageType, DhcpPacket, DhcpRepr, IpAddress, IpProtocol, Ipv4Address, Ipv4Cidr, Ipv4Repr, UdpRepr, DHCP_CLIENT_PORT, DHCP_MAX_D...
// Copyright 2012-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-MI...
//! Support for IDE Undo-Redo functionality. use crate::prelude::*; use crate::controller; // ============== // === Errors === // ============== #[allow(missing_docs)] #[derive(Debug, Clone, Eq, Fail, PartialEq)] #[fail(display = "Cannot undo because there is an ongoing transaction '{}'.", transaction_name)] pub ...
//! Computes an index of all top-level items in a module, //! storing type information. The module index is sufficient to determine the type //! of any expression. use std::{ collections::{btree_map::Entry, BTreeMap, BTreeSet}, fmt::Display, }; use quill_common::{ diagnostic::{Diagnostic, Diagno...
// Copyright (c) 2018-2021 The MobileCoin Foundation //! A Federated, Byzantine Fault-Tolerant Ledger. //! //! Orchestrates running single-slot consensus, or performing ledger sync with //! peers. mod ledger_sync_state; mod pending_values; mod task_message; mod worker; use crate::{ byzantine_ledger::{task_messag...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 //! Tasks that are executed by coordinators (short-lived compared to coordinators) use crate::{ core_mempool::{CoreMempool, TimelineState, TxnPointer}, counters, network::{MempoolNetworkSender, MempoolSyncMsg}, shared_...
use super::plan::Plan; use crate::{ bundler::{ export::Exports, load::{Imports, Source, Specifier}, }, id::{Id, ModuleId}, load::Load, resolve::Resolve, util::IntoParallelIterator, Bundler, }; use anyhow::{Context, Error}; #[cfg(feature = "concurrent")] use rayon::iter::Paral...
extern crate byteorder; extern crate encoding_rs; #[macro_use] extern crate failure; extern crate goblin; extern crate image; extern crate regex; extern crate rustc_demangle; #[macro_use] extern crate serde_derive; extern crate serde; extern crate standalone_syn as syn; extern crate toml; extern crate zip; extern crate...
pub(crate) mod communication_interface; pub use communication_interface::CommunicationInterface; use crate::error; use crate::{ architecture::{ arm::{core::CortexState, memory::ADIMemoryInterface, ArmCommunicationInterface}, riscv::communication_interface::RiscvCommunicationInterface, }, E...
extern crate rand; extern crate curve25519_dalek; extern crate merlin; extern crate bulletproofs; use std::collections::HashMap; use rand::SeedableRng; use rand::rngs::OsRng; use curve25519_dalek::scalar::Scalar; use bulletproofs::r1cs::{ConstraintSystem, R1CSError, R1CSProof, Variable, Prover, Verifier}; use bulletpr...
use std::{collections::HashSet, sync::Arc, thread}; use futures_util::stream::StreamExt; use tokio::{ net::TcpStream, runtime::Builder, sync::{ mpsc::{self, Receiver, Sender, UnboundedReceiver}, Mutex, }, }; use tokio_util::codec::Framed; use tracing::Level; use tracing_appender::non_bl...
use alloc::sync::Arc; use core::fmt; use core::mem; use core::ptr; use embedded_ffi::{CStr, CString, OsStr, OsString}; use ndless_sys::fileno; use libc::{c_int, c_long, mode_t}; use libc::{lseek as lseek64, nuc_stat, readdir as readdir64}; use crate::file_io::os::unix::prelude::*; use crate::file_io::sys::fd::FileD...
use std::ops::{ Index, Mul }; use ::vectors::{ AffineVector, Vector }; pub enum Cell { I1, J1, K1, W1, I2, J2, K2, W2, I3, J3, K3, W3, I4, J4, K4, W4, Row(u8), Column(u8), } impl Cell { pub fn to_column(&self) -> Cell { match self { &Cell::I1 => Cell::Column(0), &Cell::...
// Copyright Materialize, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by ...
use anyhow::{Context, Result}; use cgmath::{Deg, Euler, One, Quaternion, Vector3}; use clap::Clap; use colored::Colorize; use joycon::{ hidapi::HidApi, joycon_sys::{ accessory::AccessoryCommand, input::{BatteryLevel, InputReportEnum, Stick, UseSPIColors, WhichController}, light::{self, P...
use std::collections::hash_map::Entry as HashMapEntry; use std::collections::HashMap; use xcbgen::defs as xcbdefs; #[derive(Copy, Clone)] pub(crate) struct EnumInfo { // The size needed to hold all defined values for the enum pub(super) max_value_size: Option<u8>, // The range of wire sizes used for the e...
use crate::module::AddrSpace; //use crate::name::Name; use either::Either; use std::sync::{Arc, RwLock, Weak}; /// See [LLVM 9 docs on Type System](https://releases.llvm.org/9.0.0/docs/LangRef.html#type-system) #[derive(Clone, Debug)] #[allow(non_camel_case_types)] pub enum Type { /// See [LLVM 9 docs on Void Type...
pub struct OpCode(u8); pub const STOP: u8 = 0x00; pub const ADD: u8 = 0x01; pub const MUL: u8 = 0x02; pub const SUB: u8 = 0x03; pub const DIV: u8 = 0x04; pub const SDIV: u8 = 0x05; pub const MOD: u8 = 0x06; pub const SMOD: u8 = 0x07; pub const ADDMOD: u8 = 0x08; pub const MULMOD: u8 = 0x09; pub const EXP: u8 = 0x0a; p...
use log::{debug, error}; use nix::errno::{self, Errno}; use nix::fcntl::{self, OFlag}; use nix::sys::stat::{self, FileStat, Mode}; use regex::Regex; use std::ffi::CString; use std::fs; use std::os::raw::c_void; use std::os::unix::io::RawFd; use std::path::Path; use param::*; pub struct MountOption { pub name: Str...
use crate::{ backend::renderer::{utils::draw_surface_tree, Frame, ImportAll, Renderer, Texture}, desktop::{utils::*, PopupManager, Space}, utils::{user_data::UserDataMap, Logical, Point, Rectangle}, wayland::{ compositor::{with_states, with_surface_tree_downward, TraversalAction}, output...
use indexmap::{map::Entry, IndexMap}; use std::cmp::Ordering; use std::hash::{Hash, Hasher}; use std::ops::{Deref, DerefMut}; use bigdecimal::FromPrimitive; use chrono::{DateTime, FixedOffset, NaiveDateTime}; use nu_errors::ShellError; use nu_source::{Span, Tag}; use num_bigint::BigInt; use polars::prelude::{AnyValue,...
// Copyright (C) 2016-2017 <NAME> <<EMAIL>> // // 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...
use crate::private::clone::CloneCell; use crate::{BuildingBlock, Concurrent, Get, GetMut, Ordered, Prefetch}; use std::fs::File; use std::io::Write; use std::ops::{Deref, DerefMut}; use std::sync::atomic::{AtomicU64, Ordering}; use std::time::Instant; /// Accumulator of call count and elapsed time. struct MethodStats ...
#![warn(unsafe_code)] #![warn(missing_copy_implementations)] #![warn(missing_debug_implementations)] #![feature(trait_alias)] pub mod clipboard; pub mod closure; pub mod event; pub mod resize_observer; pub mod platform; pub mod stream; /// Common types that should be visible across the whole crate. pub mod prelude { ...
mod config; mod error; mod helpers; mod logging; mod rttui; use structopt; use anyhow::{anyhow, Context, Result}; use colored::*; use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; use std::{ env, fs::File, io::Write, iter, panic, path::{Path, PathBuf}, process::{self, Command, Stdio}...
// Copyright 2019-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 agr...
#[cfg(feature = "racer-completion")] use crate::complete::code::{CodeCache, CodeCompleter}; use crate::complete::{cmdr::TreeCompleter, modules::ModulesCompleter}; use crate::prelude::*; use crossterm as xterm; use crossterm::event::Event; use kserd::{fmt::FormattingConfig, Kserd}; use repl::{EvalResult, Evaluate, Print...
pub mod mpmc; pub mod mpsc; pub(super) mod owned; pub(super) mod refcount; mod slot; use alloc::alloc::Layout; use core::{ fmt, mem::ManuallyDrop, ptr, sync::atomic::{AtomicPtr, AtomicU32, AtomicU8, Ordering}, }; use slot::Slot; macro_rules! rel_rlx { () => { (Ordering::Release, Orderin...
use std::{result,str}; use std::default::Default; use std::io::{Error,ErrorKind,Result}; use std::collections::{HashSet,HashMap,VecDeque}; use amq_protocol::types::*; use nom::{IResult,Offset}; use sasl; use sasl::client::Mechanism; use sasl::client::mechanisms::Plain; use cookie_factory::GenError; use format::frame::...
// // Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved. // // 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 // use glib::sub...
use super::ffi::*; use crate::CrashEventResult; use crate::Error; use std::mem; #[repr(i32)] enum MessageIds { /// Message ID telling the handler thread to signal a crash w/optional exception information SignalCrash = 0, /// Message ID telling the handler thread to quit. Shutdown = 2, /// Taken fro...
use std::fs; use std::io::Write; use systemd::{self, SystemdUnit}; use systemd::systemctl::Systemctl; use systemd::dbus::{self, Dbus}; mod analyze; mod button_layout; mod units; use self::button_layout::ButtonLayout; use gtk::{self, Image}; use gtk::prelude::*; use gdk::enums::key; /// Updates the status icon for t...
use std::{cell::RefCell, rc::Rc}; use log::{debug, info, trace}; use rustc_borrowck::consumers::BodyWithBorrowckFacts; use rustc_data_structures::{ fx::{FxHashMap as HashMap, FxHashSet as HashSet}, graph::{scc::Sccs, vec_graph::VecGraph}, }; use rustc_hir::def_id::DefId; use rustc_index::{bit_set::BitSet, vec::Ind...
#![allow(dead_code)] use core::convert::TryInto; use core::ops::Range; use bitflags::bitflags; // --- Register bitflags --- bitflags! { /// Possible values of charger's regulation voltage in volts. pub struct ChargingVoltage: u8 { /// 4.1 Volts const V4_1 = 0b00; /// 4.15 Volts ...
use std::fs::{File, OpenOptions, copy}; use std::path::{PathBuf, Path}; use serde::{Serialize, Deserialize}; use std::time::SystemTime; use std::io::{Read, Write, Seek, SeekFrom}; use std::collections::{HashMap}; use lzma_rs::{lzma_compress, lzma_decompress}; use diffy::{Patch, apply_bytes, DiffOptions}; use std::str...
use smallvec::SmallVec; use bw_dat::{self, order, Game, TechId, Unit, UnitId, UpgradeId}; use crate::ai::{self, has_resources, Cost, PlayerAi}; use crate::aiscript::{AiMode, Town}; use crate::bw; use crate::datreq::{check_dat_requirements, DatReq, ReadDatReqs}; use crate::list::ListIter; use crate::unit::{self, UnitE...
// 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::assigned_number; use super::AssignedNumber; pub(super) const SERVICE_UUIDS: [AssignedNumber; 40] = [ assigned_number!("1800", "GAP", "Gener...
//! Scope identifiers and a location-to-scope map. use std::fmt; use std::ops; use std::slice; use std::cmp::Ordering; use std::hash::{Hash, Hasher}; use std::borrow::Borrow; use std::collections::HashMap; use loc::{Pos, Span, Spanned}; use spanmap::SpanMap; /// A scope identifier, unique in the originating `ScopeMap...
use std::cmp; use std::convert::From; use std::fs::File; use std::io::{BufReader, Read}; use std::io::prelude::*; use std::iter::Iterator; use std::str; use byteorder::{LittleEndian, WriteBytesExt}; use openssl::rand::rand_bytes; use openssl::symm::{Cipher, Crypter, Mode, decrypt, encrypt}; use errors::*; pub fn ran...
use std::collections::VecDeque; use std::marker::PhantomData; use std::sync::atomic::{AtomicU64, Ordering::SeqCst}; use std::time::{Duration, Instant}; use locutus_runtime::{ContractStore, RuntimeResult}; use locutus_stdlib::prelude::{Parameters, State, StateDelta, StateSummary}; use serde::{Deserialize, Serialize}; u...
// Copyright © 2021 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT //! The rump runtime support module. //! //! # Organization //! //! File organization is as follows: //! * The implementation to run a rumpkernel are contained in the files in the [rumprt] base. //! * The necessary symb...
#![ allow( unused_imports ) ] pub(crate) mod e_handler ; pub(crate) mod color ; pub(crate) mod user_list ; mod import { pub(crate) use { chat_format :: { ServerMsg, ClientMsg } , async_runtime :: { * ...
#[cfg(feature = "wasm")] use crate::ast::wasm::{LangValueArrayMap, LangValueMap, SourceElement}; use crate::{ ast::{ compiled::{Instruction, Program}, Jump, LangValue, Node, Operator, RegisterRef, SpanNode, StackRef, ValueSource, }, consts::MAX_CYCLE_COUNT, debug, error::{Run...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - LLWU Pin Enable 1 register"] pub pe1: PE1, #[doc = "0x01 - LLWU Pin Enable 2 register"] pub pe2: PE2, #[doc = "0x02 - LLWU Pin Enable 3 register"] pub pe3: PE3, #[doc = "0x03 - LLWU Pin Enable 4 register"] p...
// Copyright Materialize, Inc. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License...
#![cfg(feature = "rustls")] use tokio::time::Instant; use anyhow::anyhow; use bytes::{BufMut, Bytes, BytesMut}; use futures_util::StreamExt; use protobuf::Message; pub use quinn; use quinn::{ClientConfig, Endpoint, Incoming, IncomingUniStreams, NewConnection, ServerConfig}; use rustls; use std::{ fs::File, io:...
use std::default::Default; use anyhow::{bail, ensure, Result}; use crate::encode::*; #[derive(Clone,Copy,Debug,PartialEq,Eq,PartialOrd,Ord)] enum Origin { // Origin positive QueryStart(usize), // Origin negative RefStart(usize), } impl std::default::Default for Origin { fn default() -> Self { Or...
//! The entry point of the NLL borrow checker. use rustc_data_structures::fx::FxHashMap; use rustc_errors::Diagnostic; use rustc_hir::def_id::DefId; use rustc_index::vec::IndexVec; use rustc_infer::infer::InferCtxt; use rustc_middle::mir::{ BasicBlock, Body, BodyAndCache, ClosureOutlivesSubject, ClosureRegionRequi...
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
use std::convert::TryFrom; use std::os::raw::c_void; use crate::{Tag, Mask, Buffer, GlyphInfo}; use crate::buffer::BufferFlags; use crate::map::{Map, MapBuilder, FeatureFlags}; use crate::ffi; use crate::unicode::{CharExt, GeneralCategoryExt}; use super::indic::{Category, Position}; const KHMER_FEATURES: &[(Tag, Feat...
use gen::Gen; use gfx_voxel::cube; use std::collections::HashMap; use std::cell::RefCell; gfx_vertex_struct!( Vertex { a_pos: [f32; 3] = "a_pos", a_tex_coord: [f32; 2] = "a_tex_coord", a_color: [f32; 4] = "a_color", a_light: f32 = "a_light", }); impl Vertex { fn new(pos: [f32; 3], tc: [f32; 2], c...
use crate::linux::common::Display; use crate::linux::keyboard::Keyboard; use crate::rdev::{Button, Event, EventType, GrabError, Key, KeyboardState}; use epoll::ControlOptions::{EPOLL_CTL_ADD, EPOLL_CTL_DEL}; use evdev_rs::{ enums::{EventCode, EV_KEY, EV_REL}, Device, InputEvent, UInputDevice, }; use inotify::{I...
use crate::mbe::macro_parser; use crate::mbe::{Delimited, KleeneOp, KleeneToken, MetaVarExpr, SequenceRepetition, TokenTree}; use rustc_ast::token::{self, Token}; use rustc_ast::tokenstream; use rustc_ast::{NodeId, DUMMY_NODE_ID}; use rustc_ast_pretty::pprust; use rustc_feature::Features; use rustc_session::parse::{fe...
use aead::{generic_array::GenericArray, Error}; use cipher::consts::U16; use core::convert::TryInto; use core::marker::PhantomData; use subtle::ConstantTimeEq; #[cfg(feature = "zeroize")] use zeroize::Zeroize; /// Ascon keys pub type Key = GenericArray<u8, U16>; /// Ascon nonces pub type Nonce = GenericArray<u8, U16...
// -*- mode: rust; -*- // // This file is part of x25519-dalek. // Copyright (c) 2017-2019 <NAME> // Copyright (c) 2019 DebugSteven // See LICENSE for licensing information. // // Authors: // - <NAME> <<EMAIL>> // - DebugSteven <<EMAIL>> //! x25519 Diffie-Hellman key exchange //! //! This implements x25519 key exchang...
//! Contains the main plugin struct. use crate::check_log::CheckLog; use crate::error::MakeError; use crate::policy::MakeStudentFilePolicy; use crate::valgrind_log::ValgrindLog; use once_cell::sync::Lazy; use regex::Regex; use std::collections::HashMap; use std::io::{self, BufRead, BufReader, Read, Seek}; use std::pat...
use std::convert::{TryFrom, TryInto}; use std::time::Duration; use crate::error::*; use crate::{auth, http, rest, Result}; /// [Ably client options] for initialising a REST or Realtime client. /// /// [Ably client options]: https://ably.com/documentation/rest/types#client-options #[derive(Clone, Debug)] pub struct Cl...
mod test_file; use std::{sync::Arc, time::Duration}; use bson::Bson; use futures::stream::TryStreamExt; use semver::VersionReq; use tokio::sync::{RwLockReadGuard, RwLockWriteGuard}; use test_file::{TestFile, TestResult}; use crate::{ bson::{doc, Document}, error::{ErrorKind, Result, RETRYABLE_WRITE_ERROR}, ...
//! Contains the compression attribute definition //! and methods to compress and decompress data. // private modules make non-breaking changes easier mod zip; mod rle; mod piz; mod pxr24; use crate::meta::attribute::{IntegerBounds, SampleType, ChannelList}; use crate::error::{Result, Error, usize_to_i32}; use cr...
use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; use std::convert::TryInto; use std::io::{Cursor, ErrorKind, SeekFrom}; use std::path::Path; use std::str::FromStr; use prost::Message; use pancake_db_idl::dml::{FieldValue, partition_filter, PartitionFieldComparison, PartitionFieldValue, PartitionFilter...
//! Output advertising capabilities //! //! This module provides a type helping you to abstract over various //! properties, that make up an [`Output`] of your compositor. //! //! Additionally the [`Output`] may handle advertising of your compositor's //! output and their capabilities to your client, as well as mapping...
use std::collections::VecDeque; use std::fmt::Arguments; use std::io::{self, BufReader, Read, Write}; use std::mem; use std::net::ToSocketAddrs; #[cfg(feature = "with-unix-sockets")] use tokio_uds::UnixStream; use tokio_codec::{Decoder, Framed}; use tokio_executor; use tokio_io::{self, AsyncWrite}; use tokio_tcp::Tcp...