text stringlengths 7.05k 33.9k |
|---|
use std::collections::HashSet;
use pgx::*;
use serde_json::json;
use crate::access_method::options::ZDBIndexOptions;
use crate::elasticsearch::aggregates::terms::terms_array_agg;
use crate::gucs::{ZDB_ACCELERATOR, ZDB_IGNORE_VISIBILITY};
use crate::utils::lookup_es_field_type;
use crate::zdbquery::mvcc::build_visibil... |
use binread::NullString;
use binread::{io::Cursor, BinReaderExt, BinResult};
use indexmap::{IndexMap, IndexSet};
use serde::Serialize;
use ssbh_lib::Ptr32;
use std::collections::{BTreeMap, HashMap};
use std::fs;
use std::io::{Seek, Write};
use std::num::NonZeroU8;
use std::path::Path;
use xmb::*;
use xmltree::{Element,... |
#[macro_use]
extern crate amethyst;
extern crate amethyst_extra;
#[macro_use]
extern crate serde;
#[macro_use]
extern crate serde_json;
#[macro_use]
extern crate log;
extern crate partial_function;
extern crate winit;
#[macro_use]
extern crate derive_new;
extern crate crossbeam_channel;
extern crate hoppinworld_data;
e... |
//! [`Attribute`] parsing for items.
use std::{borrow::Cow, ops::Deref};
use proc_macro2::Span;
use syn::{
parse::{discouraged::Speculative, Parse, ParseStream},
punctuated::Punctuated,
spanned::Spanned,
Attribute, Data, Ident, Meta, NestedMeta, Path, PredicateType, Result, Token, TraitBound,
TraitBoundModifier,... |
use crate::ast::{Expr, Stmt};
use crate::lexer::TokenKind;
use crate::parser::CalcError;
use crate::parser::DECL_UNIT;
use crate::prelude;
use crate::symbol_table::SymbolTable;
use rug::ops::Pow;
use rug::Float;
pub struct Context<'a> {
symbol_table: &'a mut SymbolTable,
angle_unit: String,
precision: u32,... |
// Copyright (c) 2016-2018 The http-serve developers
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE.txt or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT.txt or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or dist... |
#![feature(async_closure)]
extern crate async_std;
extern crate futures;
#[macro_use]
extern crate log;
use std::io::Write;
use std::net::Shutdown;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::{
collections::hash_map::{Entry, HashMap},
sync::Arc,
};
use async_std::task;
use async_std::{
io::B... |
use std::collections::VecDeque;
use std::hash::Hash;
use super::visit::{
EdgeRef, GraphBase, IntoEdges, IntoNeighbors, IntoNodeIdentifiers, NodeCount, NodeIndexable,
VisitMap, Visitable,
};
/// Computed
/// [*matching*](https://en.wikipedia.org/wiki/Matching_(graph_theory)#Definitions)
/// of the graph.
pub s... |
use std::{borrow::Cow, ops::Add, path::PathBuf};
use crate::Parsed;
use super::shared::{
format_inner, is_posix_path_separator, normalize_string, CHAR_DOT, CHAR_FORWARD_SLASH,
};
/// Provides the platform-specific path segment separator:
/// - `\` on Windows
/// - `/` on POSIX
#[allow(non_upper_case_globals)]
pu... |
extern crate termion;
use termion::raw::RawTerminal;
use termion::raw::IntoRawMode;
use termion::input::TermRead;
use termion::event::Key;
use termion::cursor::Goto;
use std::collections::BTreeMap;
use std::io::{Stdin, Stdout, Write};
pub struct Point {
pub x: u16,
pub y: u16,
}
impl Point {
pub fn new(... |
use mira::prelude::*;
use input::RustInput;
use std::fs::*;
use std::io::*;
use std::path::*;
use csv;
use serde_json;
use prettytable::*;
use mira::settings::conf_learning::*;
use gmtk::prelude::*;
use mira::assembling::learning::gen_train_data::gen_train_data;
use std::collections::HashMap;
use algorithm::data_struct... |
//#![deny(missing_docs)]
//#![deny(warnings)]
//! This library is usefull for developing C/C++ AWS Nitro Enclave applications
//! with custom functionality like enclave-to-enclave
//! secure communication and mutual attestation.
//!
//!
use std::fmt;
use std::string::String;
use aws_cose::error::COSEError;
use aws_n... |
use std::cmp::Ordering;
use std::collections::VecDeque;
use hidapi::{HidDevice, HidResult};
use log::{debug, log_enabled};
/// Bytestring sent from computer to oximeter to establish communication.
pub const INIT_BYTESTRING: &[u8] = &[
0x7d, 0x81, 0xa7, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x7d, 0x81, 0xa2, 0x... |
//! OS-agnostic helpers for mapping files and memory regions
use std::io;
use std::fs::OpenOptions;
use std::path::{Path, PathBuf};
use std::ops::{Deref, DerefMut};
#[cfg(unix)] use std::os::unix::io::AsRawFd;
#[cfg(windows)] use std::os::windows::io::AsRawHandle;
#[cfg(windows)] use std::os::windows::fs::OpenOpti... |
use crate::utils;
use super::mdf3_block::Mdf3Block;
#[derive(Debug, Clone, PartialEq)]
pub struct Txblock {
block_type: [u8; 2],
block_size: u16,
text: Vec<u8>,
}
impl Mdf3Block for Txblock {
fn read(stream: &[u8], position: usize, little_endian: bool) -> (usize, Self) {
let mut pos = positio... |
//! Solver configuration.
#![allow(missing_docs)]
#[cfg(test)]
#[path = "../../../tests/unit/extensions/solve/config_test.rs"]
mod config_test;
extern crate serde_json;
use serde::Deserialize;
use std::collections::HashMap;
use std::io::{BufReader, Read};
use std::sync::Arc;
use vrp_core::models::common::SingleDimL... |
// Copyright (c) 2016-2020 Memgraph Ltd. [https://memgraph.com]
//
// 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 ... |
#[macro_export]
macro_rules! profile_start {
($tag_count: expr) => {
$crate::profiler::internal::begin($tag_count)
};
}
#[macro_export]
macro_rules! profile_finish {
($writer: expr) => {
$crate::profiler::internal::end($writer)
};
}
#[macro_export]
macro_rules! profile_finish_to_file ... |
//! An implementation of a neural network that can be used to learn from target data
//! and to predict results after feeding it some training data.
use std::vec::Vec;
use rand::distributions::Range;
use ndarray_rand::RandomExt;
use ndarray::prelude::*;
use ndarray::{Zip, Ix};
use itertools::Itertools;
use traits::{... |
use super::super::manager;
use super::super::model::contents;
use super::super::model::token;
use super::super::FuncType;
use super::area;
use super::canvas;
use wasm_bindgen::prelude::*;
pub struct PanelBox {
pub is_vertical: bool,
pub width: f64,
pub height: f64,
pub touching: bool,
pub start_x: i32,
pub... |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use maplit::btreemap;
use std::collections::BTreeMap;
use std::fs;
use std::io::{BufWriter, Write};
use std::os::unix::fs::symlink;... |
use csv;
use std::error::Error;
use std::fmt;
use std::io::Write;
use std::process::{Command, Stdio};
#[derive(Debug)]
pub struct SoftEtherError {
msg: String,
}
impl fmt::Display for SoftEtherError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.msg)
}
}
impl Error ... |
// Copyright 2017 <NAME> <<EMAIL>> <<EMAIL>>
use std::cell::RefCell;
use std::collections::HashMap;
use std::marker::PhantomData;
use std::rc::Rc;
use pw_gix::{
gdk, glib,
gtk::{self, prelude::*},
gtkx::{dialog::*, list_store::*, menu::*, tree_view_column::*},
wrapper::*,
};
use colour_math_gtk::colo... |
use crate::constants::*;
use crate::gdt::consts::*;
use crate::gdt::TaskState;
use crate::pmap::VirtAddr;
use crate::{console, env, gdt, sched, x86};
use crate::{lapic, mpconfig, syscall};
use consts::*;
use core::mem;
use core::slice;
static mut IDT: InterruptDescriptorTable = InterruptDescriptorTable([GateDesc::empt... |
// Copyright (c) SimpleStaking and Tezedge Contributors
// SPDX-License-Identifier: MIT
use std::net::{Ipv4Addr, Shutdown, SocketAddr, SocketAddrV4};
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
use std::time::Duration;
use failure::{Error, Fail};
use futures::lock::Mutex;
use riker::... |
// Copyright (C) 2017-2018 Baidu, Inc. All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of condit... |
// Copyright 2016 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, ... |
#![cfg(not(feature = "riscv-ulp-hal"))]
//! LED Control peripheral (which also crates PWM signals for other purposes)
//!
//! Interface to the [LED Control (LEDC)
//! peripheral](https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/peripherals/ledc.html)
//!
//! This is an initial implementation... |
use generator::Scope;
use rand::rngs::StdRng;
use rand::seq::SliceRandom;
use rand::thread_rng;
use rand::Rng;
use std::{cell::RefCell, rc::Rc};
use crate::common::*;
use crate::problem::*;
use super::Solver;
#[derive(Default)]
pub struct TreeSearchSolver {
pub timeout: Option<std::time::Duration>,
}
const ENAB... |
use canister_test::{local_test_with_config_e, Canister, Project, Runtime};
use dfn_candid::{candid_one, CandidOne};
use futures::future::join_all;
use ic_config::subnet_config::SubnetConfig;
use ic_config::Config;
use ic_sns_governance::init::GovernanceCanisterInitPayloadBuilder;
use ic_sns_governance::pb::v1::manage_n... |
use crate::context::Context;
use crate::error::Error;
use crate::instance::{
siginfo_ext::SiginfoExt, FaultDetails, Instance, State, TerminationDetails, CURRENT_INSTANCE,
HOST_CTX,
};
use crate::sysdeps::UContextPtr;
use lazy_static::lazy_static;
use libc::{c_int, c_void, siginfo_t, SIGBUS, SIGSEGV};
use lucet_... |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
mod errors;
use errors::*;
use fnv::{FnvHashMap, FnvHashSet};
use interner::{Intern, StringKey};
use lazy_static::lazy_static;
use... |
use std::cell::RefCell;
use std::collections::BTreeMap;
use std::ffi::OsStr;
use std::fs::{self, File, OpenOptions};
use std::io::{self, BufReader, BufWriter, Read, Seek, SeekFrom, Write};
use std::ops::Range;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::{Arc, Mutex};
us... |
// 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 super::{akm, cipher, pmkid, suite_selector};
use crate::appendable::{Appendable, BufferTooSmall};
use crate::organization::Oui;
use bytes::Bytes;
use ... |
use std::{
borrow::Borrow,
cmp::Ordering,
fmt,
hash::{Hash, Hasher},
};
use itertools::{Either, Itertools};
use rpds;
use codespan_reporting::{Diagnostic, Label};
use crate::base::{
ast::{self, Expr, MutVisitor, SpannedExpr, TypedIdent},
error::AsDiagnostic,
fnv::FnvMap,
metadata::Me... |
use std::convert::TryInto;
use std::sync::Arc;
use pyo3::exceptions;
use pyo3::prelude::*;
use pyo3::types::*;
use crate::encoding::PyEncoding;
use crate::error::ToPyResult;
use serde::{Deserialize, Serialize};
use tk::processors::bert::BertProcessing;
use tk::processors::byte_level::ByteLevel;
use tk::processors::ro... |
#[rustfmt::skip]
#[path = "protobuf/sf.ethereum.r#type.v1.rs"]
mod pbcodec;
use anyhow::format_err;
use graph::{
blockchain::{Block as BlockchainBlock, BlockPtr},
prelude::{
web3,
web3::types::{Bytes, H160, H2048, H256, H64, U256, U64},
BlockNumber, Error, EthereumBlock, EthereumBlockWi... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved0: [u8; 0x04],
#[doc = "0x04 - RTC control register 1"]
pub rtc_ctrl_1: crate::Reg<rtc_ctrl_1::RTC_CTRL_1_SPEC>,
#[doc = "0x08 - RTC control register 2"]
pub rtc_ctrl_2: crate::Reg<rtc_ctrl_2::RTC_CTRL_2_SPEC>,
#[doc = "0x... |
// Copyright 2020-2021 <NAME>
// SPDX-License-Identifier: Apache-2.0
use core::fmt::Debug;
use core::fmt::Formatter;
use core::fmt::Result as FmtResult;
use futures::executor;
use futures::TryStreamExt;
use hashbrown::HashMap;
use identity_core::crypto::KeyType;
use identity_core::crypto::SetSignature;
use identity_di... |
//! MIPMap
use crate::app::OPTIONS;
use crate::geometry::*;
use crate::memory::*;
use crate::pbrt::*;
use crate::texture::*;
use rayon::prelude::*;
use std::hash::Hash;
use std::marker::{Send, Sync};
use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign};
use std::sync::{Arc, Mutex};
mod cache;
mod convert_in... |
use std::collections::VecDeque;
use std::convert::{TryFrom, TryInto};
use std::mem;
use std::sync::Arc;
use hashbrown::HashMap;
use num_bigint::{BigInt, Sign};
use liblumen_alloc::badarg;
use liblumen_alloc::erts::exception::runtime;
use liblumen_alloc::erts::process::Process;
use liblumen_alloc::erts::term::binary::... |
#![feature(try_trait, nll)]
extern crate bit_vec;
extern crate env_logger;
#[macro_use]
extern crate failure;
extern crate fnv;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
extern crate num_complex;
extern crate openqasm;
extern crate order_stat;
extern crate ordered_float;
extern crate permut... |
mod imp {
use core::f32;
use std::cell::{Cell, Ref};
use std::rc::Rc;
use glib::translate::{from_glib_none, ToGlibPtr};
use gtk::{gdk::prelude::*, graphene::Rect, subclass::prelude::*};
use parking_lot::RwLock;
use crate::metrics::Metrics;
use crate::vimview::textbuf::Lines;
use cr... |
// Copyright 2021 Open Information Security Foundation
//
// MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
//... |
// Copyright 2021 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 ... |
// Copyright (c) 2017 The vulkano 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. All files in the project carrying such
// notice may not be co... |
mod crc;
#[macro_use]
mod macros;
mod types;
pub use self::crc::{crc8, crc16};
pub use self::types::{ErrorKind, ByteStream, ReadStream};
use nom::{self, IResult};
use metadata::{Metadata, metadata_parser};
use std::ops::{Add, AddAssign, BitAnd, BitOr, Mul, Sub, Shl, ShlAssign, Shr};
use std::io;
/// An interface fo... |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
async_utils::stream::FutureMap,
fidl::endpoints::{Proxy, ServerEnd},
fidl_fuchsia_bluetooth_bredr as bredr,
fidl_fuchsia_bluetooth_hf... |
use super::{
menu_functions::{parse_selection_char, string_difference},
Menu, MenuEvent, MenuTextStyle,
};
use crate::{
painting::{estimate_single_line_wraps, Painter},
Completer, History, LineBuffer, Span, Suggestion,
};
use nu_ansi_term::{ansi::RESET, Style};
use std::iter::Sum;
struct Page {
siz... |
// Copyright 2019 Zhizhesihai (Beijing) Technology Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by a... |
use std::{collections::HashMap, num::NonZeroUsize};
use bytes::{Bytes, BytesMut};
use futures::{stream::BoxStream, StreamExt};
use once_cell::sync::Lazy;
use regex::Regex;
use snafu::Snafu;
use tokio_util::codec::Encoder as _;
use vector_core::{
buffers::Acker,
event::{self, Event, EventFinalizers, Finalizable... |
#![cfg_attr(all(test, feature = "bench"), feature(test))]
use esparse::lex::{self};
use fnv::FnvHashMap;
use fnv::FnvHashSet;
use lazy_static::lazy_static;
use notify::Watcher;
use regex::Regex;
use serde::Deserialize;
use std::any::Any;
use std::ffi::OsString;
use std::path::{Path, PathBuf};
use std::sync::mpsc;
use... |
use std::io::BufRead;
use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::{fs, io};
use anyhow::anyhow;
use bstr::BString;
use clap::Parser;
use tako::common::resources::{
CpuRequest, GenericResourceAmount, GenericResourceId, GenericResourceRequest, ResourceRequest,
};
use tako::messages::common::{Prog... |
/* Copyright (c) Fortanix, Inc.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
mod avx2;
mod lut_align64;
use alloc::vec::Vec;
use core::cmp;
#[must_use]
st... |
//! WebDAV server as a hyper server handler
//!
//!```no_run
//!extern crate hyper;
//!extern crate hyperdav_server;
//!
//!let server = hyper::server::Server::http("0.0.0.0:8080").unwrap();
//!server
//! .handle(hyperdav_server::Server::new("", std::path::Path::new("/")))
//! .unwrap();
//!```
extern crate chron... |
use ttf_parser::parser::{LazyArray32, Offset32, Offset};
use crate::{Face, GlyphInfo};
use crate::buffer::Buffer;
use crate::plan::ShapePlan;
use crate::aat::{Map, MapBuilder, FeatureType};
use crate::aat::feature_selector;
use crate::tables::aat;
use crate::tables::morx;
use ttf_parser::GlyphId;
pub fn compile_flags... |
//! # Day 8: Seven Segment Search
//!
//! You barely reach the safety of the cave when the whale smashes into the cave mouth, collapsing it. Sensors indicate another exit to this cave at a much greater depth, so you have no choice but to press on.
//!
//! As your submarine slowly makes its way through the cave system, ... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Core Release Register"]
pub mcan_crel: crate::Reg<mcan_crel::MCAN_CREL_SPEC>,
#[doc = "0x04 - Endian Register"]
pub mcan_endn: crate::Reg<mcan_endn::MCAN_ENDN_SPEC>,
#[doc = "0x08 - Customer Register"]
pub mcan_cust... |
use super::{apply_mosaic_cond, LCDLineBuffer, LCDRegisters, Layer, Pixel};
use crate::hardware::{OAM, VRAM};
use crate::util::fixedpoint::{FixedPoint16, FixedPoint32};
use crate::util::memory::{read_u16, read_u16_unchecked};
use crate::util::CBool;
pub struct OBJWindow;
pub struct OBJRender;
impl CBool for OBJWindow ... |
use std::cell::{Cell, RefCell};
use rustc::hir;
use rustc::hir::def::Def;
use rustc::ty::{self, TyCtxt, ParamEnv};
use smallvec::SmallVec;
use syntax::ast::*;
use syntax::fold::{self, Folder};
use syntax::ptr::P;
use syntax::util::move_map::MoveMap;
use api::*;
use driver;
fn types_approx_equal<'tcx>(tcx: TyCtxt<'_,... |
use crate::{
unwrap,
util::unit::{Meter, Meter3},
world::{
generate::{
runoff::pattern::{
RunoffDestination, RunoffDestinationMap, RunoffPattern,
},
TileBuilder,
},
hex::{Cluster, HasHexPosition, TilePoint, TilePointIndexMap},
... |
// gray-codes-rs: src/lib.rs
//
// Copyright 2017 <NAME>, <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 dis... |
use crate::columnar;
use crate::columnar::{
ColumnEncoder, KeyIterator, ObjIterator, OperationIterator, PredIterator, ValueIterator,
};
use crate::encoding::{Decodable, Encodable};
use crate::error::{AutomergeError, InvalidChangeError};
use automerge_protocol as amp;
use core::fmt::Debug;
use sha2::{Digest, Sha256}... |
//! The `AddressBook` manages information about what peers exist, when they were
//! seen, and what services they provide.
use std::{cmp::Reverse, iter::Extend, net::SocketAddr, time::Instant};
use chrono::Utc;
use ordered_map::OrderedMap;
use tokio::sync::watch;
use tracing::Span;
use crate::{
constants, meta_a... |
//! Pag Construction
//! Uses LogRecord representation to create a PAG that contains local and remote edges
use std::collections::HashMap;
use std::{io::Read, time::Duration};
use std::cmp::Ordering;
use std::hash::Hash;
use std::convert::TryInto;
use timely::dataflow::{channels::pact::Exchange, operators::generic::o... |
#![cfg_attr(not(feature = "std"), no_std)]
use codec::alloc::string::ToString;
use core::convert::TryInto;
// use rstd::prelude::*;
use sp_core::crypto::KeyTypeId;
use system::offchain;
use codec::{Encode, Decode};
use frame_support::{
debug, decl_error, decl_event, decl_module, decl_storage, dispatch, ensure,
sp_ru... |
use std::{
collections::HashMap, collections::HashSet, io::BufWriter, net::IpAddr, net::Ipv4Addr,
net::Shutdown, net::SocketAddr, net::TcpStream, sync::Arc,
};
use anyhow::{bail, ensure, Result};
use bitcoin::{
consensus::encode,
hashes::sha256d,
network::message_blockdata::GetHeadersMessage,
n... |
//! The I2P network database.
use chrono::offset::Utc;
use futures::{
future,
sync::{mpsc, oneshot},
Async, Future, Poll, Stream,
};
use rand::{thread_rng, Rng};
use sha2::{Digest, Sha256};
use std::collections::HashMap;
use std::sync::Arc;
use std::time::{Duration, Instant, SystemTime};
use tokio::{
e... |
extern crate cgmath;
#[macro_use]
extern crate glium;
extern crate image;
extern crate libc;
#[macro_use]
extern crate log;
extern crate mint;
pub mod config;
mod mesh;
use config::Config;
use libc::c_char;
use std::error::Error;
use std::ffi::CStr;
use std::fs::File;
use std::{io, panic, slice, thread, time};
//use ... |
pub const PLUMO_SETUP_PERSONALIZATION: &[u8] = b"PLUMOSET";
pub const ADDRESS_LENGTH: usize = 20;
pub const ADDRESS_LENGTH_IN_HEX: usize = 42;
pub const SIGNATURE_LENGTH_IN_HEX: usize = 130;
pub const DEFAULT_MAX_RETRIES: usize = 5;
pub const ONE_MB: usize = 1024 * 1024;
pub const DEFAULT_CHUNK_SIZE: u64 = 1 * (ONE_MB ... |
// Copyright 2020 <NAME> <<EMAIL>>
//
// This file is part of conec.
//
// Licensed under the Apache License, Version 2.0 (see
// LICENSE or https://www.apache.org/licenses/LICENSE-2.0).
// This file may not be copied, modified, or distributed
// except according to those terms.
use super::cchan::{ClientClientChan, Cl... |
//! Tests.
//
// Copyright (c) 2019 Stegos AG
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merg... |
use crate::bitset::{BitSet1D, BitSet3D, BitSetRef1D, BitSetRefMut1D};
use crate::parser;
use crate::words::{Char, CharBitset};
use std::fmt;
// This is only used while constructing the `Expression`,
// the sets are resized before they are evaluated.
const MAX_SET_SIZE: usize = 16 * 1024;
#[derive(Debug, Clone)]
struc... |
// WARNING
//
// Please note the heavy 'inspiration' from the PBR book.
// Not all this code is completely the same, but it's very similar and should be used with care.
// It's the very backbone of the performance that Thruster has, and so it's the piece that needs
// most performance tweaking.
use crate::acceleration... |
//! A generic connection pool, but async/await.
//!
//! Opening a new database connection every time one is needed is both
//! inefficient and can lead to resource exhaustion under high traffic
//! conditions. A connection pool maintains a set of open connections to a
//! database, handing them out for repeated use.
//... |
use std::collections::BTreeMap;
use serde::{Deserialize, Serialize};
use serde_repr::*;
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct BundleList {
pub bundles: Vec<OpenSeaAssetBundle>,
pub estimated_count: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserializ... |
use std::{
fs,
io::{Read, Seek, Write},
ops::Deref,
path::{Path, PathBuf},
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
},
};
use bincode::{deserialize, serialize};
#[cfg(any(windows, target_os = "linux", target_os = "macos"))]
use fs2::FileExt;
use serde::Serialize;
// expl... |
use std::cell::RefCell;
use std::os::raw::{c_int, c_void};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Weak};
use crate::{Interface, Main, Proxy, RawEvent};
use wayland_commons::filter::Filter;
use wayland_commons::user_data::UserData;
use wayland_commons::wire::ArgumentType;
use wayland_common... |
use crate::RngExt;
use cfmt_a::{
fmt::{Error, FormattingFlags, StrWriter, StrWriterMut},
formatcp,
test_utils::{ALL_ASCII, ALL_ASCII_ESCAPED},
utils::saturate_range,
wrapper_types::{AsciiStr, PWrapper},
};
use arrayvec::ArrayString;
use fastrand::Rng;
use core::{fmt::Write, ops::Range};
#[deriv... |
// SPDX-License-Identifier: MIT OR Apache-2.0
//
// Copyright (c) 2018-2021 <NAME> <<EMAIL>>
//! Memory Management Unit Driver.
//!
//! Only 64 KiB granule is supported.
use crate::{
bsp,
memory::{
mmu,
mmu::{
AccessPermissions, Address, AddressType, AttributeFields, MemAttributes,... |
// SPDX-License-Identifier: Apache-2.0
//! This crate provides the `enarx-keepmgr` executable which creates and
//! coordinates enarx-keepldr instances
//!
//! # Build
//!
//! $ git clone https://github.com/enarx/enarx-keepmgr
//! $ cd enarx-keepmgr
//! $ cargo build
//!
//! # Run Tests
//!
//! $ cargo... |
use crate::client::{build_client, WMClient};
use crate::config::action::Action;
use crate::config::application::Application;
use crate::config::key_action::KeyAction;
use crate::config::key_press::{KeyPress, Modifier, ModifierState};
use crate::Config;
use evdev::uinput::VirtualDevice;
use evdev::{EventType, InputEvent... |
//! # Minimal Specialization
//!
//! This module contains the checks for sound specialization used when the
//! `min_specialization` feature is enabled. This requires that the impl is
//! *always applicable*.
//!
//! If `impl1` specializes `impl2` then `impl1` is always applicable if we know
//! that all the bounds of ... |
use slab::Slab;
use na::{self, RealField};
use ncollide;
use ncollide::events::{ContactEvents, ProximityEvents};
use crate::counters::Counters;
use crate::detection::{ActivationManager, ColliderContactManifold};
use crate::force_generator::{ForceGenerator, ForceGeneratorHandle};
use crate::joint::{ConstraintHandle, J... |
use std::collections::HashMap;
use std::env;
use std::fmt;
use std::hash::{Hash, Hasher, SipHasher};
use std::path::{Path, PathBuf};
use std::sync::Arc;
use lazycell::LazyCell;
use log::info;
use super::{BuildContext, CompileKind, Context, FileFlavor, Layout};
use crate::core::compiler::{CompileMode, CompileTarget, U... |
#![cfg(feature = "iterator")]
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use cosmwasm_std::{Order, StdError, StdResult, Storage};
use crate::keys::{EmptyPrefix, PrimaryKey, U64Key};
use crate::map::Map;
use crate::path::Path;
use crate::prefix::Prefix;
use crate::{Bound, Prefixer};
use std... |
use cortex_a::regs::*;
use core::ptr::null_mut;
use super::translation_tables::*;
use crate::alloc::alloc::{alloc_zeroed, Layout};
use crate::memory::memory_controler::{
AddressSpace, AttributeFields, Granule, Translation, PHYSICAL_MEMORY_LAYOUT,
};
struct MMU {}
pub const MEMORY_SIZE_BITS: usize = 36;
pub const... |
use crate::error::MyError;
use std::{cell::RefCell, fmt, rc::Rc};
use bit_vec::BitVec;
use log::{error, info};
use crate::{
btree::{buffer_pool::BufferPool, consts::INDEX_SIZE, tuple::TupleScheme},
field::{get_type_length, IntField},
};
use super::{
BTreeBasePage, BTreeLeafPage, BTreePage, BTreePageID, P... |
use serde_derive::{Serialize, Deserialize};
use std::convert::From;
use failure::{Error, format_err};
pub mod aggregator;
pub mod metadata;
mod json;
mod xml;
pub use crate::schema::{
json::SchemaConfigJson,
json::DimensionConfigJson,
json::HierarchyConfigJson,
json::LevelConfigJson,
json::Measure... |
//! Communication between components.
//!
//! The main purpose of communication is for a unit is to announce updates to
//! its data set and operational state to all other components that are
//! interested. It also takes care of managing these communication lines.
//!
//! There are three main types here: Each unit has... |
// Copyright (C) 2020 Alibaba Cloud. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//! Fuse blob passthrough file system, mirroring an existing FS hierarchy.
//!
//! This file system mirrors the existing file system hierarchy of the system, starting at the
//! root file system. This is implemented by jus... |
#![allow(dead_code, unused_variables, unused_imports, unused_mut)]
mod comp;
mod doc;
mod gfx;
mod layout;
mod util;
use glutin::dpi::LogicalSize;
use glutin::event::{Event, ModifiersState, WindowEvent};
use glutin::event_loop::{ControlFlow, EventLoop};
use glutin::window::WindowBuilder;
use glutin::ContextBuilder;
... |
// Copyright <NAME> 2017-2018.
// Dual-licensed under either the MIT License or the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
use input::keyboard;
use c_void;
use std::ptr::null_mut;
pub struct Window {
// Keyboard (XKB)
keym... |
//! Routines for creating and manipulating 4-level x86_64 page tables
#![no_std]
use core::alloc::Layout;
use core::mem::size_of;
pub const PAGE_PRESENT: u64 = 1 << 0;
pub const PAGE_WRITE: u64 = 1 << 1;
pub const PAGE_USER: u64 = 1 << 2;
pub const PAGE_SIZE: u64 = 1 << 7;
pub const PAGE_NX: u64 = 1... |
//!
//! An implementation of a reference-counted persistent rope data structure.
//! It is intended to allow (relatively) efficient storage of long sequences of
//! values, and (relatively) efficient create/read/concat/slice operations on
//! said sequences. Its features are motivated by the needs of a hypothetical
//... |
use super::client::Client;
use super::score::{PeerAction, Score, ScoreState};
use super::sync_status::SyncStatus;
use crate::Multiaddr;
use crate::{rpc::MetaData, types::Subnet};
use discv5::Enr;
use serde::{
ser::{SerializeStruct, Serializer},
Serialize,
};
use std::collections::HashSet;
use std::net::{IpAddr,... |
use std::{
env::args,
fs::{create_dir, remove_file, File},
io::{stderr, BufRead, BufReader},
ops::Index,
path::Path,
process::Command,
sync::{atomic::Ordering, Arc},
};
use anyhow::{bail, Context, Result};
use futures::StreamExt;
use tokio::{
io,
sync::{oneshot, Semaphore},
};
use t... |
use crate::metadata::MetadataMap;
use bytes::Bytes;
use http::header::{HeaderMap, HeaderValue};
use percent_encoding::{percent_decode, percent_encode, AsciiSet, CONTROLS};
use std::{borrow::Cow, error::Error, fmt};
use tracing::{debug, trace, warn};
pub const ENCODING_SET: &AsciiSet = &CONTROLS
.add(b' ')
.add... |
// Copyright 2019 <NAME>
//
// 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... |
// 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.