text stringlengths 7.05k 33.9k |
|---|
//! A cross-platform library for opening OS pipes, like those from
//! [`pipe`](https://man7.org/linux/man-pages/man2/pipe.2.html) on Linux
//! or
//! [`CreatePipe`](https://docs.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-createpipe)
//! on Windows. The Rust standard library provides
//! [`Stdio... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Chip Information Register"]
pub chip_info: CHIP_INFO,
#[doc = "0x04 - Unique Chip ID 0"]
pub chipid0: CHIPID0,
#[doc = "0x08 - Unique Chip ID 1"]
pub chipid1: CHIPID1,
#[doc = "0x0c - Chip Revision"]
pub chi... |
#![feature(asm)]
#![feature(naked_functions)]
#![feature(default_alloc_error_handler)]
#![no_main]
#![no_std]
extern crate alloc;
use panic_halt as _;
use core::{mem, cell::RefCell};
use alloc::string::String;
use lazy_static::lazy_static;
use cortex_m::{asm, interrupt, peripheral::syst::SystClkSource, Peripherals};... |
#[macro_use]
extern crate slog;
#[macro_use]
extern crate serde_derive;
use std::env;
use std::fmt;
use std::path::Path;
use std::time;
use chrono::prelude::*;
use clap::{crate_version, App, Arg};
use egg_mode::tweet::DraftTweet;
const CONSUMER_KEY: &'static str = "XurcamcbIvruiowuIuLLxpkEV";
const ACCESS_TOKEN: &'s... |
// Copyright 2021 The Matrix.org Foundation C.I.C.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... |
use std::collections::{BTreeSet, BTreeMap};
use std::path::{Path, PathBuf};
use std::process::{self, Command};
use std::str;
use std::time::SystemTime;
use anyhow::Context;
use async_std::task;
use serde::Serialize;
use linked_hash_map::LinkedHashMap;
use fn_error_context::context;
use fs_err as fs;
use crate::comman... |
// Copyright 2019 Intel Corporation. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use super::Error as DeviceError;
use super::{
ActivateError, ActivateResult, EpollHelper, EpollHelperError, EpollHelperHandler, Queue,
VirtioCommon, VirtioDevice, VirtioDeviceType, VirtioInterruptType, EPOLL_HELPER... |
use {
super::{exception::*, job::Job, job_policy::*, thread::Thread, *},
crate::{object::*, signal::Futex, vm::*},
alloc::{boxed::Box, sync::Arc, vec::Vec},
core::{any::Any, sync::atomic::AtomicI32},
futures::channel::oneshot::{self, Receiver, Sender},
hashbrown::HashMap,
spin::Mutex,
};
//... |
//! A data structure representing topic, partitions and offsets, compatible with the
//! `RDKafkaTopicPartitionList` exported by `rdkafka-sys`.
use rdsys;
use rdsys::types::*;
use error::{IsError, KafkaError, KafkaResult};
use std::collections::HashMap;
use std::ffi::{CStr, CString};
use std::fmt;
use std::ptr;
use s... |
use crate::app::{App, ShowEverything};
use crate::common::{CityPicker, ColorLegend};
use crate::game::{msg, State, Transition, WizardState};
use crate::helpers::{nice_map_name, ID};
use abstutil::{prettyprint_usize, Timer};
use ezgui::{
hotkey, Btn, Checkbox, Choice, Color, Composite, Drawable, EventCtx, GeomBatch,... |
//! Runtime side of the worker-host protocol.
use std::{
collections::{BTreeMap, HashMap},
io::{BufReader, BufWriter, Read, Write},
sync::{
atomic::{AtomicUsize, Ordering},
Arc, Mutex,
},
};
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use crossbeam::channel;
use io_context:... |
//! Ipfs path handling following https://github.com/ipfs/go-path/. This rests under ipfs-http for
//! now until it's ready to be moved to `rust-ipfs`. There is a competing implementation under
//! `libipld` which might do almost the same things, but with different dependencies. This should
//! be moving over to `ipfs` ... |
// Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0
use crate::{
block_storage::BlockStore,
counters,
error::{error_kind, DbError},
experimental::{
buffer_manager::{OrderedBlocks, ResetRequest},
decoupled_execution_utils::prepare_phases_and_buffer_manager,
ordering_sta... |
//! The OpSet is where most of the interesting work is done in this library.
//! It maintains a mapping from each object ID to a set of concurrent
//! operations which have been seen for that object ID.
//!
//! When the client requests the value of the CRDT (via
//! document::state) the implementation fetches the root ... |
use std::collections::HashMap;
use std::fs::File;
use std::io;
use std::io::{BufRead, BufReader, BufWriter, Error, Read, Write};
use std::path::Path;
use std::path::PathBuf;
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
use crc32fast::Hasher;
use itertools::Itertools;
pub trait CRC32 {
fn hash(self: ... |
// Copyright (C) 2019-2021 Crust Network Technologies Ltd.
// This file is part of Crust.
use super::*;
use crate as market;
use frame_support::{
parameter_types, assert_ok,
weights::constants::RocksDbWeight,
traits::{OnFinalize, OnInitialize, Get}
};
// use sp_core::H256;
pub use sp_core::{crypto::{Accou... |
//#[cfg(feature = "folder-download")]
use super::{
resp,
search::{Search, SearchTrait},
transcode::{guess_format, AudioFilePath, QualityLevel},
types::*,
Counter,
};
use crate::{
config::get_config,
error::{Error, Result},
util::{checked_dec, into_range_bounds, to_satisfiable_range, Resp... |
use std::{collections::HashSet, convert::TryFrom};
use crate::{
common::LOG_PREFIX,
mutations::{
common::{decode_registry_value, encode_or_panic},
dkg::{SetupInitialDKGArgs, SetupInitialDKGResponse},
},
registry::Registry,
};
use candid::{CandidType, Deserialize, Encode};
use dfn_core:... |
// Copyright 2019 Intel Corporation. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use crate::seccomp_filters::Thread;
use crate::thread_helper::spawn_virtio_thread;
use crate::vhost_user::vu_common_ctrl::{VhostUserConfig, VhostUserHandle};
use crate::vhost_user::{Error, Result, VhostUserCommon};
use cra... |
use anyhow::{anyhow, Context};
use svd_parser::svd::{
BitRange, DimElement, EnumeratedValues, Field, FieldInfo, OptIter, Register, RegisterInfo,
Usage, WriteConstraint, WriteConstraintRange,
};
use yaml_rust::{yaml::Hash, Yaml};
use super::iterators::{MatchIter, Matched};
use super::yaml_ext::{AsType, GetVal, ... |
use std::cell::{Cell, RefCell};
use std::task::{Context, Poll};
use std::{convert::TryFrom, future::Future, marker, num, pin::Pin, rc::Rc};
use ntex::service::{fn_factory_with_config, Service, ServiceFactory};
use ntex::util::{
buffer::BufferService, inflight::InFlightService, join, Either, HashSet, Ready,
};
use... |
#![no_std]
#![no_main]
#![allow(deprecated)]
extern crate panic_itm;
#[macro_use]
extern crate cortex_m;
use stm32f1xx_hal::prelude::*;
use core::str::Utf8Error;
use cortex_m::peripheral::itm::Stim;
use cortex_m_rt::entry;
use embedded_hal::spi::FullDuplex;
use embedded_websockets as ws;
use w5500::{IpAddress, MacA... |
// 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 {fuchsia_scenic::DisplayRotation, input::Size, std::f32::consts as f32};
/// Predefined viewing distances with values in millimeters.
#[derive(Copy, C... |
//! **lmake_version_from_date - In Cargo.toml and service_worker.js writes the version as the date**
// region: lmake_readme include "readme.md" //! A
//! # lmake_version_from_date
//!
//! version: 0.3.37 date: 2020-05-21 authors: <NAME>
//! **In Cargo.toml and service_worker.js writes the version as the date.**... |
//! JSON-RPC client implementation.
#![deny(missing_docs)]
use jsonrpc_core::futures::channel::{mpsc, oneshot};
use jsonrpc_core::futures::{
self,
task::{Context, Poll},
Future, Stream, StreamExt,
};
use jsonrpc_core::{Error, Params};
use serde::de::DeserializeOwned;
use serde::Serialize;
use serde_json::Value;
us... |
use async_trait::async_trait;
use chrono::prelude::*;
use serde_json::Value;
use std::collections::BTreeMap;
use ssi::caip10::BlockchainAccountId;
use ssi::did::{
Context, Contexts, DIDMethod, Document, Source, VerificationMethod, VerificationMethodMap,
DEFAULT_CONTEXT, DIDURL,
};
use ssi::did_resolve::{
D... |
//! # quickxml_to_serde
//! Fast and flexible conversion from XML to JSON using [quick-xml](https://github.com/tafia/quick-xml)
//! and [serde](https://github.com/serde-rs/json). Inspired by [node2object](https://github.com/vorot93/node2object).
//!
//! This crate converts XML elements, attributes and text nodes direct... |
#[cfg(test)]
mod transport_layer_cc_test;
use std::fmt;
use std::io::{Cursor, Read, Write};
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use util::Error;
use super::header::*;
use crate::errors::*;
use crate::util::*;
// https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#pag... |
mod mx;
mod smtp;
mod task;
use std::collections::BTreeSet;
use std::sync::mpsc::{self, RecvTimeoutError};
use std::sync::{Arc, RwLock};
use std::time::{Duration, Instant};
use trust_dns_resolver::Resolver;
use trust_dns_resolver::config::{ResolverConfig, NameServerConfig};
use self::task::{Task, TaskType};
use crat... |
use serde::{Deserialize, Serialize};
use std::fmt::Write;
use std::path::{Path, PathBuf};
use std::process::{self};
use std::{env, fs, io};
use walkdir::WalkDir;
fn main() {
let args = libtest_mimic::Arguments::from_args();
std::env::set_current_dir("..").unwrap();
let tests = std::iter::empty()
... |
use kvdb::KeyValueDB;
use libzeropool::{
constants,
fawkes_crypto::ff_uint::PrimeField,
fawkes_crypto::{
core::sizedvec::SizedVec,
ff_uint::Num,
ff_uint::{NumRepr, Uint},
rand::Rng,
},
native::{
account::Account,
boundednum::BoundedNum,
cipher,... |
// 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.
use crate::hframe::... |
//! Large Page
//!
//! A Large Page is a slab of `Configuration::LARGE_PAGE_SIZE` bytes, which fulfills allocations of the Normal category.
//!
//! Each instance of a Large Page can only fulfill allocations of a specific ClassSize.
mod adrift;
mod foreign;
mod local;
#[cfg(test)]
mod test;
use core::{
cmp,
m... |
//! Iterable network cursor for MongoDB queries.
//!
//! ```no_run
//! # #[macro_use] extern crate bson;
//! # extern crate mongodb;
//! #
//! # use mongodb::{Client, ThreadedClient};
//! # use mongodb::db::ThreadedDatabase;
//! # use bson::Bson;
//! #
//! # fn main() {
//! # let client = Client::connect("localhost", 2... |
use crate::{common::*, TryFromCv, TryIntoCv};
use opencv::{core, prelude::*};
use mat_ext::*;
pub use tensor_from_mat::*;
pub use tensor_with_convention::*;
mod tensor_with_convention {
use super::*;
/// A tensor with image shape convention that is used to convert to [Tensor](tch::Tensor).
#[derive(Debug... |
//! Page management and cluster allocation.
//!
//! # Compression
//!
//! Pages are virtual data units of size 512 bytes. They're represented on disk somewhat
//! non-obviously, since clusters can hold more than one page at once (compression). Every cluster
//! will maximize the number of pages held and when it's fille... |
//! The kernel heap allocator
//!
//! reference: https://pdos.csail.mit.edu/6.828/2019/lec/malloc.c
use bit_field::BitField;
use core::alloc::{GlobalAlloc, Layout};
use core::ptr::{self};
use core::mem::{MaybeUninit, size_of};
use core::cmp;
use crate::consts::{PGSIZE, LEAF_SIZE, PHYSTOP};
use crate::spinlock::SpinL... |
//! Fuzzing engine. Connects the [CodeCoverageSensor](crate::code_coverage_sensor::CodeCoverageSensor)
//!to the [Pool] and uses an evolutionary algorithm using [Mutator] to find new interesting
//! test inputs.
use crate::nix_subset as nix;
use crate::pool::{AnalyzedFeature, Pool, PoolIndex};
use crate::signals_handl... |
//! The `UI` struct and widget management facilities
//!
//! # Principles
//!
//! Widgets are kept in a `Vec<dyn Box<Widget>`. To address an
//! individual widget unambiguously the widgets [`ID`](type.Id.html)
//! is used which directly corresponds to the index of the widget in
//! the `Vec`.
//!
//! Moreover widgets a... |
use std::{collections::HashMap, convert::TryInto};
use std::ffi::OsStr;
use std::fs::OpenOptions;
use std::path::PathBuf;
use std::io::Read;
use std::convert::From;
use std::u8;
extern crate compress_tools;
use compress_tools::*;
extern crate tempfile;
use tempfile::TempDir;
#[path = "../file_reader.rs"]
mod file_re... |
use std::{
cmp::Ordering,
collections::{HashMap, HashSet},
fs::File,
hash::{Hash, Hasher},
io::{BufReader, Read},
path::{Path, PathBuf},
str::FromStr,
sync::Arc,
};
use byteorder::{LittleEndian, ReadBytesExt};
use mlua::Lua;
use serde::Deserialize;
use thiserror::Error;
use rustorio_pr... |
use crate::cocoon_config;
use crate::constant;
use crate::message;
use crate::route_table;
use crate::utility;
use anyhow::{anyhow, Result};
use cocoon_config::{KVDatabaseConfig, SqliteConfig};
use constant::MESSAGE_HEADER_SIZE;
use message::*;
use rocksdb::{Options, ReadOptions, WriteOptions, DB};
use route_table::{en... |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#![allow(non_snake_case)]
use syscalls::Errno;
use syscalls::Sysno;
pub use libc::sock_filter;
... |
use crate::allocators::{BiDimAllocator, DimAllocator};
use crate::connectivity::Connectivity;
use crate::nalgebra::MatrixSliceMut;
use crate::SmallDim;
use fenris_optimize::newton::NewtonSettings;
use nalgebra::allocator::Allocator;
use nalgebra::OPoint;
use nalgebra::{DVectorSlice, DVectorSliceMut, DimName, Dynamic};
... |
//! A software MMU with byte level permissions and uninitialized memory access
//! detection
use std::path::Path;
use std::collections::HashMap;
use crate::emulator::VmExit;
use crate::primitive::Primitive;
/// Block size used for resetting and tracking memory which has been modified
/// The larger this is, the fewer... |
use crate::generators::GenItem;
use crate::generators::Input;
use log::LevelFilter;
use std::fs::File;
use std::io;
use std::io::Read;
use std::time::Duration;
use termion::event::Key;
use termion::input::MouseTerminal;
use termion::input::TermRead;
use termion::raw::IntoRawMode;
use termion::screen::AlternateScreen;
u... |
use crate::compression::*;
use crate::crypt::{decrypt, hash_string};
use adler32::RollingAdler32;
use byteorder::{ByteOrder, LittleEndian};
use std::fmt;
use std::fs;
use std::io::prelude::*;
use std::io::SeekFrom;
use std::io::{Error, ErrorKind};
use std::mem;
use std::path::Path;
const HEADER_SIZE_V1: usize = 0x20;
... |
use glium::glutin::dpi::{PhysicalPosition, PhysicalSize};
use glium::glutin::event::*;
use imgui_winit_support::WinitPlatform;
use std::collections::HashSet;
use std::ops::Index;
use std::time::{Duration, Instant};
use ndcell_core::prelude::*;
use crate::commands::*;
use crate::gridview::GridView;
use crate::mouse::{... |
use crate::Evaluator;
use crate::evaluator::NativeEvaluator;
use crate::cards_type::CardsType;
use std::fs::File;
use std::path::Path;
use std::io::prelude::*;
use super::combination::CardsByValueCombination;
const CARD_PRIMES: [u32; 13] = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41 ];
const HASH_ADJUST: [u16;51... |
//! https://github.com/tokio-rs/prost/blob/master/prost-build/src/lib.rs
use std::{
collections::{hash_map, HashMap},
fmt::{Display, Formatter},
fs,
io::{Error, ErrorKind},
iter,
path::{Path, PathBuf},
};
use anyhow::Result;
use heck::{ToLowerCamelCase, ToUpperCamelCase};
use itertools::Itertoo... |
use super::buffer::*;
use super::bindings::*;
use super::matrix_buffer::*;
use super::render_target::*;
use super::pipeline_configuration::*;
use crate::action::*;
use crate::buffer::*;
use flo_canvas;
use metal;
use std::ops::{Range};
use std::collections::{HashMap};
///
/// Renderer that can write to a surface u... |
//
// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
use datasource::DatasourceInput;
use gdal;
use gdal::vector::{Dataset, FieldValue, Geometry, OGRwkbGeometryType};
use gdal::spatial_ref::{CoordTransform, SpatialRef}... |
//when shipping game, make sure you got everything in the folder with the gameeextern crate sdl2;
extern crate gl;
use sdl2::pixels;
use sdl2::image;
use image::{LoadSurface};
use pixels::{Color};
use sdl2::video::{Window};
use sdl2::render::{WindowCanvas};
use sdl2::audio::{AudioCallback, AudioSpecWAV, AudioCVT, Audio... |
use core::ops::Deref;
use parking_lot::Mutex;
use std::{collections::HashSet, path::PathBuf, vec};
use crate::{
wrapper::IORef, FromEnvironment, IORefT, IsProperty, Key, Property, PropertyError,
PropertySource, SalakContext, SubKey, SubKeys, PREFIX,
};
#[cfg(feature = "derive")]
#[cfg_attr(docsrs, doc(cfg(feat... |
extern crate chrono;
#[macro_use]
extern crate failure;
extern crate futures;
extern crate ipfs_api;
extern crate pem;
extern crate ring;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate serde_cbor;
extern crate tokio_core;
extern crate untrusted;
use std::fmt;
use std... |
#![allow(non_snake_case)]
extern crate xmltree;
extern crate csv;
extern crate regex;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate colored;
use colored::*;
use std::fs::File;
use std::io::prelude::*;
use xmltree::Element;
use std::collections::HashMap;
extern crate clap;
// Values... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use backup_service::start_backup_service;
use consensus::{consensus_provider::start_consensus, gen_consensus_reconfig_subscription};
use debug_interface::node_debug_service::NodeDebugService;
use diem_config::{
config::{NetworkConfi... |
//! Functions and types for enumerating CUDA devices and retrieving information about them.
use crate::error::{CudaResult, ToResult};
use cuda_driver_sys::*;
use std::ffi::CStr;
use std::ops::Range;
/// All supported device attributes for [Device::get_attribute](struct.Device.html#method.get_attribute)
#[repr(u32)]
#... |
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
use super::{
gas_tracker::{price_list_by_epoch, GasCharge},
DefaultRuntime, Rand,
};
use actor::{
actorv0::reward::AwardBlockRewardParams, cron, miner, reward, system, BURNT_FUNDS_ACTOR_ADDR,
};
use address::Address;
use cid::C... |
// Copyright 2016 Openmarket
//
// 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 w... |
use super::*;
use DiffKind::*;
// The kind of diff and the size of the piece of diff
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
struct DiffPathItem(DiffKind, usize, usize, usize);
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
enum DiffKind {
Keep,
Added,
Removed,
}
impl DiffPathItem {
fn kind(&self)... |
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
use std::collections::{HashMap, HashSet};
use std::convert::TryInto;
use std::io;
use std::path::{Path, PathBuf};
use std::sync::{mpsc, Arc};
use std::time::{Duration, Instant};
use fut... |
// 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.
//! Asynchronous task management and tracking
//!
//! # Summary
//!
//! The Task module helps manage and track asynchronous tasks by categorizing
//! tasks... |
use std::cell::Cell;
use std::rc::Rc;
use glow::HasContext;
use crate::drawing::Uniforms;
use crate::{Canvas, Color, GeomBatch, ScreenDims, ScreenRectangle};
#[cfg(feature = "native-backend")]
pub use crate::backend_glow_native::setup;
#[cfg(feature = "wasm-backend")]
pub use crate::backend_glow_wasm::setup;
// Re... |
// Copyright (c) 2019 Cloudflare, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
pub mod errors;
pub mod handshake;
mod session;
mod tests;
mod timers;
use crate::crypto::x25519::*;
use crate::noise::errors::WireGuardError;
use crate::noise::handshake::Handshake;
use crate::noise::timers::{TimerNa... |
//! Helper functions for the BGEO file format
use crate::Real;
use anyhow::Context;
use flate2::read::GzDecoder;
use nalgebra::Vector3;
use nom::{Finish, Parser};
use std::collections::HashMap;
use std::fs::File;
use std::io::Read;
use std::path::Path;
use parser::bgeo_parser;
// TODO: Find out why there is a 1.0 fl... |
// Here reside the definitions of opcode fields; rather than have magic numbers everywhere,
// we opt for rich types wherever it is not too ridiculous.
// The parser then becomes the naturally messy code responsible for constructing said rich types.
use crate::conversions::Truncate;
use crate::instructions::ExtensionW... |
//! # DEIP DAO Module
//! A module for manage DAO and perform actions on behalf of it
//!
//! - [`Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//!
//! ## Overview
//! A module for manage DAO and perform actions on behalf of it
//!
//! ## Interface
//!
//! ### Dispatchable Functions
//!
//! * `create` ... |
use crate::characters::{ChoseongCharacter::*, *};
use crate::constants::*;
use crate::syllable::*;
use std::convert::TryFrom;
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub enum Choseong {
Normal(ChoseongCharacter),
Compat(ChoseongCharacter),
}
fn to_code(code: u32) -> u32 {
if code.is_syllable() {
... |
use std::collections::{HashMap, HashSet};
use rustc::hir::def_id::DefId;
use rustc::ty::TypeVariants;
use syntax::abi::Abi;
use syntax::ast::*;
use syntax::attr;
use syntax::codemap::Spanned;
use syntax::fold::{self, Folder};
use syntax::ptr::P;
use syntax::util::small_vector::SmallVector;
use api::*;
use command::{Co... |
// main.rs
use chrono::prelude::*;
use clap::{load_yaml, App};
use dirs;
use libc;
use std::ffi::CString;
use std::mem::{transmute, zeroed};
use std::os::raw::*;
use std::ptr::{null, null_mut};
use std::sync::{Arc, Mutex};
use x11::{xft, xinput2, xlib};
mod configure;
mod socket;
const TITLE: &'static str = "Rusty C... |
//! Source file support for diagnostic reporting.
//!
//! The main trait defined in this module is the [`Files`] trait, which provides
//! provides the minimum amount of functionality required for printing [`Diagnostics`]
//! with the [`term::emit`] function.
//!
//! Simple implementations of this trait are implemented... |
// SPDX-License-Identifier: Apache-2.0
//! The global Allocator
use crate::addr::{ShimPhysAddr, ShimVirtAddr};
use crate::hostcall::HOST_CALL_ALLOC;
use crate::hostmap::HOSTMAP;
use crate::payload::NEXT_MMAP_RWLOCK;
use crate::spin::RwLocked;
use crate::{get_cbit_mask, C_BIT_MASK};
use core::alloc::{GlobalAlloc, Layo... |
// 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... |
use super::pointer_chain_helpers::*;
use super::vk_debug_callback;
use ash::{extensions::*, vk};
use gpu_allocator::{vulkan as vkalloc, MemoryLocation};
use std::borrow::Borrow;
use std::collections::HashSet;
use std::ffi::{CStr, CString};
use std::mem::ManuallyDrop;
use raw_window_handle::RawWindowHandle;
pub struct... |
// Copyright 2021 Databricks, Inc.
// 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 writi... |
// Copyright 2020 The Exonum Team
//
// 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 i... |
use clap::{App, Arg, ArgMatches, ArgGroup};
use core::convert::TryFrom;
use std::collections::HashMap;
use std::net::SocketAddr;
use crate::{
bindle_util::BindleConnectionInfo,
wagi_config::{
HandlerConfigurationSource, HttpConfiguration, TlsConfiguration, WagiConfiguration,
},
};
const ABOUT: &str... |
use actix::prelude::*;
use rand::prelude::*;
use std::collections::{HashMap, HashSet};
use std::time::{Duration, Instant};
use uuid::Uuid;
use crate::db;
use crate::game_room::{self, GameRoom};
use shared::game;
use shared::message::{self, AdminAction};
macro_rules! catch {
($($code:tt)+) => {
(|| Some({ ... |
use std::collections::BTreeMap as Map;
use lazy_static::lazy_static;
use segment_map::Segment;
use crate::{
sym as rsym,
neg as rneg,
alt as ralt,
con as rcon,
rep as rrep,
sgl as rsgl,
rng as rrng,
Expression,
};
use simple_parser_bootstrap::{
tok as ptok,
non as pnon,
alt a... |
use crate::column::Column;
use crate::columns::*;
use crate::config::*;
use crate::process::collect_proc;
use crate::style::{apply_color, apply_style, color_to_column_style};
use crate::term_info::TermInfo;
use crate::util::{classify, find_column_kind, find_exact, find_partial, truncate, KeywordClass};
use crate::Opt;
... |
// Copyright (c) 2020 Huawei Technologies Co.,Ltd. All rights reserved.
//
// StratoVirt is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan
// PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWA... |
use parser::{VmCommand};
use std::fmt::Display;
use untyped_ir::*;
use std::io::Write;
use std::iter;
use std::collections::HashMap;
struct BasicBlock<CmdType> {
index: usize,
neighbors: Vec<usize>,
label: Option<String>,
commands: Vec<CmdType>,
}
impl<CmdType> BasicBlock<CmdType> {
fn is_empty(&... |
use num_derive::FromPrimitive;
use crate::attribute::{Attribute, AttributeName};
use crate::character::character_common_data::CharacterCommonData;
use crate::character::character_sub_stat::CharacterSubStatFamily;
use crate::character::{CharacterConfig, CharacterName, CharacterStaticData};
use crate::character::skill_co... |
use crate::framework::cast_slice;
use crate::gui::Gui;
use bytemuck::{Pod, Zeroable};
use egui::*;
use std::sync::Arc;
use std::num::NonZeroU32;
use wgpu::util::DeviceExt;
use wgpu::*;
#[derive(Clone, Copy, Debug)]
#[repr(C)]
struct UniformBuffer {
screen_size: [f32; 2],
}
unsafe impl Pod for UniformBuffer {}
unsa... |
// Copyright 2017 Google Inc.
//
// 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... |
//! This module handles a subset of ANSI escape codes.
use super::Input;
use core::convert::{TryFrom, TryInto};
use log::trace;
#[derive(Debug)]
pub struct Decoder {
state: State,
}
impl Decoder {
pub fn new() -> Self {
Self { state: State::Init }
}
pub fn add_char(&mut self, ch: char) -> Op... |
// This following unused_imports attribute is needed to build KaNiLS without any warnings
// under the stable and nightly channels at the time.
#[allow(unused_imports)]
#[macro_use]
extern crate structopt;
#[macro_use]
extern crate clap;
#[macro_use]
extern crate trackable;
extern crate cannyls;
extern crate kanils;
e... |
// Copyright 2021, The Tremor Team
//
// 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 t... |
mod audio_generator;
mod delay_buffer;
mod flags;
mod registers;
mod sprite;
mod tests;
use audio_generator::AudioGenerator;
use delay_buffer::DelayBuffer;
use enum_map::{enum_map, Enum, EnumMap};
use sprite::{missile_reset_delay_for_player, set_reg_nusiz, Sprite};
use ya6502::memory::Inspect;
use ya6502::memory::Read... |
//! Tokay compiler interface
use std::collections::HashMap;
use std::io::BufReader;
use super::*;
use crate::builtin;
use crate::error::Error;
use crate::reader::Reader;
use crate::value::{Token, Value};
use crate::vm::*;
/** Compiler symbolic scope.
In Tokay code, this relates to any block.
Parselets introduce new ... |
use measure_time::*;
use nalgebra::*;
use ndarray::{prelude::*, StrideShape};
use ofx::*;
use crate::fisheye::{estimate_new_camera_matrix_for_undistort_rectify, undistort_rectify};
plugin_module!(
"nl.smslv.gyroflowofx.fisheyestab",
ApiVersion(1),
PluginVersion(1, 0),
FisheyeStabilizerPlugin::new
);
... |
//! Hello friends, prospective employers, and people who Googled "6502 emulator rust", you've found
//! a small personal project I've been working on since early September of 2019 to use as a talking
//! point during the interview process for my Winter 2020 co-op placement. The goal of the project
//! is to demonstrate... |
//! ChiselStore server module.
use crate::errors::StoreError;
use async_notify::Notify;
use async_trait::async_trait;
use tokio::time::{sleep, Duration};
use derivative::Derivative;
use sqlite::{Connection, OpenFlags};
use std::collections::HashMap;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::{Arc, Mu... |
use crate::decode::lzbuffer;
use crate::decode::rangecoder;
use crate::decompress::Options;
use crate::decompress::UnpackedSize;
use crate::error;
use crate::io;
use crate::option::GuaranteedOption as Option;
use crate::option::GuaranteedOption::*;
use byteorder::LittleEndian;
use io::ReadBytesExt;
/// Maximum input d... |
use std::{
collections::HashMap,
thread::{self, JoinHandle},
time::Duration,
};
use anomaly::BoxError;
use crossbeam_channel::{Receiver, Sender};
use ibc::{
events::IbcEvent,
ics02_client::events::NewBlock,
ics03_connection::connection::State as ConnectionState,
ics04_channel::{
ch... |
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_mut)]
#![allow(unused_assignments)]
#![allow(unused_variables)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use druid::kurbo::{BezPath, Circle};
use druid::piet::{FontFamily, FontStyle, FontWeight, ImageFormat, InterpolationMode};
use druid:... |
#![feature(let_else)]
use anyhow::{anyhow, Result};
use colored::Colorize;
use getopts::Options;
use glob::glob;
use image::imageops::{resize, FilterType};
use image::{GenericImage, GrayImage, Luma};
use imageproc::contrast::stretch_contrast;
use imageproc::drawing::{draw_line_segment_mut, draw_text_mut};
use imagepro... |
//!
//! # Raw Layout Data Model
//!
//! Defines the primary structures for representation of "raw" geometry-based IC layout,
//! including [Library], [Cell], [Layout], and related types.
//!
// Std-Lib
use std::collections::{HashMap, HashSet};
use std::hash::Hash;
// Crates.io
use serde::{Deserialize, Serialize};
us... |
use std::io::{self, Seek, SeekFrom, BufWriter, Write};
use std::fs::File;
use std::convert::TryInto;
use crate::config::{VcfContig, ConfHash};
use super::write_bbi::BbiWriter;
use super::bbi_utils::*;
use super::*;
const BLOCK_SIZE: usize = 256;
pub struct CtgTree<'a> {
n_nodes: usize,
ctgs: Vec<&'a VcfContig>,
k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.