text stringlengths 3.35k 22.8k |
|---|
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::Receiver;
use std::sync::Arc;
use std::thread;
use std::time::Duration;
use actix_cors::Cors;
use actix_web::{post, web, App, HttpResponse, HttpServer, Result};
use async_graphql::{EmptySubscription, Schema};
use async_graphql_actix_web::{GraphQLReque... |
use std::{
io::{self, Read, Write, BufRead, BufReader},
net::{SocketAddr, TcpStream},
collections::HashMap,
path::PathBuf,
str
};
use urlencoding::decode;
// use super::os_windows;
/// The URL of a request, represented as a PathBuf after
/// decoding the percent-encoded path in a request header
pub type URL = Pat... |
use im::HashMap;
use std::fmt;
#[derive(Copy, Clone, Debug)]
pub enum Type {
I32,
I64,
F32,
F64,
}
impl Type {
pub fn bits(&self) -> usize {
match self {
Self::I32 | Self::F32 => 32,
Self::I64 | Self::F64 => 64,
}
}
}
#[derive(Copy, Clone, Debug)]
pub e... |
extern crate chrono;
extern crate rand;
extern crate regex;
extern crate reqwest;
extern crate select;
extern crate serde_json;
extern crate curl;
use select::document::Document;
use select::predicate::{Attr, Class, Name, Predicate};
use std::collections::BTreeMap;
use std::fs;
use std::fs::File;
use std::io::prelude... |
/*
Day 19: Beacon Scanner
A bunch of beacons are dropped into the water to map the ocean.
A bunch of scanners pick up the beacons closest to them.
However, the scanners only know the becons position relative to the scanner.
The scanner can be oriented in any one of 24 possible rotations and flips in 3d space.
Use Sca... |
use std::{fmt::Display, ops::Range, sync::MutexGuard, time::Duration};
use probe_rs::{MemoryInterface, Session};
use serde::Serialize;
use serde_hex::{SerHex, StrictPfx};
use crate::{asm_parsing::AsmFile, cpu, DynError};
struct UsedRange {
start: u32,
}
impl UsedRange {
fn new(start: u32) -> Self {
... |
use std::ops::{Add, Mul};
type Mat3x3 = [f32; 9];
type Vec3x3 = [f32; 3];
const PRONATOPIA: Mat3x3 = [
0.17056, 0.82944, -0.0, 0.17056, 0.82944, 0.0, -0.00452, 0.00452, 1.0,
];
const DEUTERANOPIA: Mat3x3 = [
0.33066, 0.66934, -0.0, 0.33066, 0.66934, 0.0, -0.02786, 0.02786, 1.0,
];
const TRINATOPIA: Mat3x3 = [... |
use space::Position;
use std::collections::{HashMap, HashSet};
use block::BlockType;
use cgmath::Point3;
use worldgen::WorldGenerator;
use std::vec::Vec;
use space::Adjacent;
use worldgen;
use rand;
/// Side length of a chunk (in blocks) - all chunks are cubic
pub const CHUNK_SIZE: u8 = 32;
/// Indicates an index int... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
use crate::{
crypto::CryptoError,
frame::ConnectionClose,
varint::{VarInt, VarIntError},
};
use core::fmt;
use s2n_codec::DecoderError;
//= https://www.rfc-editor.org/rfc/r... |
use std::{
cmp::Ordering,
collections::{HashMap, HashSet},
};
use super::{
geometry::{Point, Subspace},
Abstract, Concrete, Element, ElementList,
};
use nalgebra::DMatrix;
use rand::Rng;
use scapegoat::SGSet as BTreeSet;
use std::fmt::Debug;
#[derive(PartialEq, Debug)]
enum Sign {
Positive,
Z... |
use fnv::FnvHashMap as HashMap;
use numpy::{PyArray1, ToPyArray};
use pyo3::prelude::*;
use std::fs;
use std::mem;
use std::path::Path;
use tptp::cnf::{Disjunction, Literal};
use tptp::common::*;
use tptp::fof::*;
use tptp::top::*;
use tptp::visitor::Visitor;
use tptp::TPTPIterator;
#[repr(i64)]
#[derive(Debug, Clone,... |
pub use self::printer_model::PrinterModel;
pub use self::printer_profile::{PrinterConnectionData, PrinterProfile, PrinterProfileBuilder};
mod printer_model;
mod printer_profile;
use crate::{
command::{Command, Font},
Error, EscposImage, Formatter, Instruction, PrintData,
};
extern crate codepage_437;
extern ... |
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
use std::time::Duration;
use anyhow::Context;
use boringtun::noise::{Tunn, TunnResult};
use log::Level;
use smoltcp::wire::{IpProtocol, IpVersion, Ipv4Packet, Ipv6Packet, TcpPacket, Icmpv4Packet};
use tokio::net::UdpSocket;
use tokio::sync::RwLock;
use crate::co... |
use crate::internal::*;
use crate::*;
use bytes::*;
use std::ffi::*;
use std::marker::PhantomData;
/// Defines a texture.
#[derive(Debug, PartialEq, Eq)]
pub struct Texture<'a> {
/// OpenGL texture ID
pub id: u32,
/// Width in pixels
pub width: u32,
/// Height in pixels
pub height: u32,
pub... |
use ipnetwork::IpNetwork;
use netlink_packet_core::{
NetlinkMessage, NetlinkPayload, NLM_F_ACK, NLM_F_CREATE, NLM_F_EXCL, NLM_F_REQUEST,
};
use netlink_packet_route::{
address,
constants::*,
link::{self, nlas::State},
route, AddressHeader, AddressMessage, LinkHeader, LinkMessage, RouteHeader, RouteM... |
// Copyright (c) asiaccs_2021_44_authors and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
use core::cmp;
use math::FieldElement;
use utils::collections::Vec;
// CONSTANTS
// ================================================... |
use std::net::SocketAddr;
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use naia_client_socket::{ClientSocket, ClientSocketTrait, MessageSender};
pub use naia_shared::{
ActorType, ConnectionConfig, Event, EventType, HostTickManager, Instant, LocalActorKey,
ManagerType, Manifest, PacketReader, Pack... |
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#[macro_use]
extern crate lazy_static;
use {
anyhow::{format_err, Result},
async_trait::async_trait,
ffx_core::ffx_plugin,
ffx_driver_lsbl... |
use near_contract_standards::fungible_token::{
core::FungibleTokenCore, metadata::FungibleTokenMetadata, resolver::FungibleTokenResolver,
FungibleToken,
};
use near_contract_standards::storage_manager::{AccountStorageBalance, StorageManager};
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use ne... |
use std::borrow::Cow;
use dash_rs::{
model::{
level::{DemonRating, Featured, Level, LevelLength, LevelRating},
song::MainSong,
GameVersion,
},
Base64Decoded, Thunk,
};
#[macro_use]
mod helper;
// A 1.9 level
const DARK_REALM_DATA: &str =
"1:11774780:2:Dark \
Realm:5:2:6:2... |
/*! Stores values for strings in a Hashmap in a fast and compact way.
Good to count strings and assign ids to them or similar. Address space of string data is limited to u32::MAX (4GB).
string data is size in bytes of all uniquely inserted strings + string length metadata per string.
# Examples
```
use inohashmap::St... |
// Take a look at the license at the top of the repository in the LICENSE file.
//! Module for registering shared types for Rust types.
use crate::translate::*;
use crate::StaticType;
pub unsafe trait RefCounted: Clone + Sized + 'static {
/// The inner type
type InnerType;
/// The function used to incre... |
//! Helper script to manage versions in this repository for various crates.
//!
//! Three subcommands:
//!
//! * `./publish diff wasmparser` - shows a git diff for the wasmparser
//! crate from the last tagged version to now. Useful for figuring out if a
//! major version bump is needed or not.
//!
//! * `./publish... |
//! Project Euler solutions for problems 61 through 70.
//!
//! This crate is designed to be used via crate `euler`.
use std::cmp;
extern crate primal;
extern crate itertools;
use itertools::Itertools;
extern crate num;
use num::BigUint;
use num::bigint::ToBigUint;
extern crate euler_library;
use euler_library::co... |
use std::collections::HashMap;
use std::env;
use std::fmt;
use std::fmt::{Error, Formatter};
//测试文件
//@todo 失败,且 intellJ rust plugin 无效
//#[path("./cmd_test.rs")]
//#[cfg(test)] mod cmd_test;
// 选项集合:
// 解析规则: (-xyz, --xyz, --test, --any) => [x, y, z, xyz, test, any]
// 原始数据
// 解析规则: --key=value, "key=value... |
use crate::{gl_call, renderer::*, Buffer, ScissorsState};
use bevy::render::{
pass::RenderPass,
pipeline::{
BindGroupDescriptorId, BlendFactor, BlendOperation, CullMode, IndexFormat,
PipelineDescriptor,
},
renderer::{BindGroupId, BufferId, BufferUsage, RenderContext},
};
use bevy::{asset... |
use crate::eval::Object;
use crate::compiler::ByteCode;
use crate::code::convert_two_u8s_be_to_usize;
const STACK_SIZE : usize = 2048;
// the compiler can output any index up to the max u16 value
// but keeping an array of that size on the stack of our Rust VM causes trouble
const GLOBAL_SIZE : usize = 2048;
struct... |
use once_cell::sync::Lazy;
use reqwest::get;
use semver::Version;
use serde::{
de::{self, Deserializer},
Deserialize, Serialize,
};
use std::collections::BTreeMap;
use url::Url;
use crate::{error::SolcVmError, platform::Platform};
const SOLC_RELEASES_URL: &str = "https://binaries.soliditylang.org";
const OLD... |
use std::fs::{File, OpenOptions};
use crate::page::{Page, PageType, Pos, PageError};
pub use crate::byte::*;
use anyhow::Result;
use std::fmt::Debug;
use std::rc::Rc;
use std::cell::RefCell;
mod page;
mod byte;
pub struct BTree<K, V>
{
path: &'static str,
fd: Rc<RefCell<File>>,
meta_page: Option<Page<K, V... |
//! This module provides a more high-level view of the underlying SSH agent protocol.
//!
//! It does not implement the protocol, but it implements (de-)serialization of messages. The actual
//! protocol is implemented by `Agent`.
//!
//! Implements https://tools.ietf.org/html/draft-miller-ssh-agent-00
//!
//! I have c... |
// Copyright 2021 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any late... |
use core::{
marker::PhantomData,
ptr::NonNull,
sync::atomic::{self, AtomicBool, Ordering},
};
use arrayref::array_ref;
use block_cipher::{
generic_array::{typenum::consts, GenericArray},
BlockCipher, NewBlockCipher,
};
use pac::HW_DCP;
use crate::{
dcp::{
self, CipherMode, CipherSelect... |
#[macro_use]
extern crate glium;
extern crate image;
use glium::glutin::event::{ElementState, KeyboardInput};
pub mod mesh;
use mesh::*;
pub mod transform;
use transform::*;
pub mod camera;
use camera::*;
use glam;
use std::fs;
fn main() {
// comienza la carga de modelo
// "resources/meshes/abstract.obj"
... |
use std::cell::RefCell;
use std::cmp::Ordering;
use std::collections::{BinaryHeap, HashMap};
use std::fmt::{Debug, Error};
use std::ops::Deref;
use std::rc::Rc;
use std::str::FromStr;
use serde::export::Formatter;
use crate::query_parser::ast::{IndexLink, QualifiedIndex};
#[derive(Eq, PartialEq, Ord, PartialOrd, Has... |
/*
* SPDX-License-Identifier: MIT OR BlueOak-1.0.0
* Copyright (c) 2018-2019 <NAME> <<EMAIL>>
* Copyright (c) <NAME> <<EMAIL>>
* Original code distributed under MIT, additional changes are under BlueOak-1.0.0
*/
#[cfg(not(feature = "noserial"))]
use tock_registers::interfaces::{Readable, Writeable};
use {
sup... |
//! Provides a multi component group wrapper, an abstraction used to propagate FRP events from
//! multiple component groups.
//!
//! The wrapper can work with all types of component groups using [`Group`] enum. Currently we
//! support one-column component groups and wide (multi-column) component groups.
//!
//! See [... |
use crate::{
ChannelKeys, CreateResponderChannelMessage, KeyExchangeCompleted, Role, SecureChannelEncryptor,
SecureChannelError, SecureChannelKeyExchanger, SecureChannelLocalInfo, SecureChannelVault,
};
use ockam_core::compat::{boxed::Box, string::String, vec::Vec};
use ockam_core::{async_trait, route};
use ock... |
// Game container code
use crate::fps;
use crate::universe::Universe;
use yew::prelude::*;
//
use wasm_bindgen::JsCast;
pub struct KeysPressed {
ctrl: bool,
shift: bool,
alt: bool,
meta: bool,
}
impl std::fmt::Display for KeysPressed {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::R... |
use crate::readfilemap::filemap;
use ::libc::{close, exit, free, read, open, strcpy, strrchr, strlen, malloc};
use libc::{c_char, c_int, c_uint, c_void, size_t};
pub const XML_MAP_FILE: c_int = 0o1;
pub const XML_EXTERNAL_ENTITIES: c_int = 0o2;
pub use crate::expat_external_h::{XML_Char, XML_LChar, XML_Size};
pub use... |
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2018, the Perspective Authors.
//
// This file is part of the Perspective library, distributed under the terms
// of the Apache License 2.0. The full license can be found in the LICENSE
// file.
use crate::components:... |
use futures_util::future::{self, BoxFuture, FutureExt};
use gotham::{
handler::HandlerError,
hyper::{
header::{HeaderMap, HeaderName, HeaderValue},
Body, StatusCode
},
mime::{Mime, APPLICATION_JSON, STAR_STAR}
};
#[cfg(feature = "openapi")]
use openapi_type::{OpenapiSchema, OpenapiType};
use serde::Serialize;
u... |
use super::*;
use crate::gui::*;
use physics::*;
#[derive(Default)]
pub struct GUISystem;
impl<'a> System<'a> for GUISystem {
type SystemData = (
(
Entities<'a>,
ReadStorage<'a, CharacterMarker>,
ReadStorage<'a, Lifes>,
ReadStorage<'a, Shield>,
R... |
use crate::gl;
use crate::scene_loader;
use core::mem::{size_of, size_of_val};
pub struct IBL {
vao: gl::uint,
vbo: gl::uint,
prog: gl::uint,
uni_vp: gl::int,
uni_cam_pos: gl::int,
uni_light_pos: gl::int,
uni_metallic: gl::int,
uni_roughness: gl::int,
num_vertices: gl::int,
skybox: gl::uint,
ir... |
use intcode;
use intcode::{Intcode, Result};
use permutohedron::control::Control;
use permutohedron::heap_recursive;
use std::cmp::max;
use std::fs::File;
use std::sync::mpsc;
use std::thread;
fn test_amp(prog: &mut Intcode, sequences: &[i64]) -> Result<i64> {
sequences.iter().copied().try_fold(0, |input, sequence... |
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use serde::{de, Deserialize, Serialize};
use std::fmt;
/// The default memory size of the VM, in MiB.
pub const DEFAULT_MEM_SIZE_MIB: usize = 128;
/// Firecracker aims to support small scale workloads onl... |
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any late... |
//! Utilities to synchronously decode Json.
//!
//! For use in scenarios where it's okay to block waiting for more input while decoding.
use crate::json_stream::decode::{ConsumableBytes, DecodeError, JsonDecoder};
use crate::json_stream::token::{JsonString, JsonToken};
use std::io::{Error as IoError};
use std::str;
us... |
use std::path::PathBuf;
use crc32fast::Hasher;
use std::io::{Read, Write, BufWriter};
pub struct FileToZip {
last_mod_time: u16,
last_mod_date: u16,
crc32: Option<u32>,
size: Option<u64>,
file_name: String,
source: Option<Box<dyn Read>>,
offset_of_fh: u64,
}
use chrono::{Datelike, Timelike... |
// Copyright 2020 <NAME>
// SPDX-License-Identifier: Apache-2.0
//! The IOTA Wallet Library
#![warn(missing_docs, rust_2018_idioms)]
#![allow(unused_variables, dead_code)]
/// The account module.
pub mod account;
/// The account manager module.
pub mod account_manager;
/// The actor interface for the library.
pub mo... |
use crate::models::game::GameContainer;
use crate::models::game::Phases;
use crate::traits::phased::Phased;
use serenity::framework::standard::macros::command;
use serenity::framework::standard::{Args, CommandResult};
use serenity::model::channel::Message;
use serenity::prelude::Context;
#[command]
#[aliases("v", "mv"... |
use std::{u32, u64};
use std::net;
use std::sync::Arc;
use std::time::Duration;
use http;
use ordermap::OrderMap;
use control::pb::common::{HttpMethod, TcpAddress};
use control::pb::proxy::telemetry::{
eos_ctx,
ClientTransport,
EosCtx,
EosScope,
Latency as PbLatency,
ReportRequest,
Request... |
// Copyright 2020 The Grin Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
use std::net::UdpSocket;
use std::env;
use std::process;
use std::str::FromStr;
use std::thread;
use std::collections;
use std::time::Duration;
fn unpackHeader(header : &[u8]) -> (i32, i32, i32){
let mut protocol = [0; 4];
let mut port1 = [0; 4];
let mut port2 = [0; 4];
let mut idx : usize = 0;
for... |
use super::protos::*;
use super::rpc::*;
use super::discovery::*;
use super::atomic::*;
use super::routing::*;
use super::state_machine::*;
use super::server::*;
use super::server_protos::*;
use super::errors::*;
use super::log::*;
use super::simple_log::*;
use core::DirLock;
use std::sync::{Arc, Mutex};
use futures::p... |
use crate::MultiTokenImbalanceWithZeroTrait;
use codec::FullCodec;
use frame_support::traits::{BalanceStatus, ExistenceRequirement, Get, Imbalance, SignedImbalance, WithdrawReasons};
use frame_support::Parameter;
use mangata_primitives::{Balance as BalancePrimitive, TokenId};
use sp_runtime::traits::{AtLeast32BitUnsign... |
// Copyright 2020 <NAME>
// SPDX-License-Identifier: Apache-2.0
// implementation of ERC-20 smart contract for ISCP
// following https://ethereum.org/en/developers/tutorials/understand-the-erc-20-token-smart-contract/
use wasmlib::*;
use crate::*;
// Sets the allowance value for delegated account
// inputs:
// - P... |
// Copyright 2018 <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 writi... |
//! Contains the implementation of a `TabWidget` using the [`hyber`]
//! (`crate`).
//!
//! The Tab View, on the [`hyber`](`crate`), is a widget implemented
//! according to the [`Widget`] trait but with his own properties.
//! This properties need to be assigned by programmers.
use hyber::display::Display;
use hyber... |
use std::fmt;
use std::str;
use std::error::Error;
use std::collections::BTreeMap;
use bytes::Bytes;
pub use crate::server_message::{ErrorSeverity, ErrorResponse};
pub const FIELD_HINT: u16 = 0x_00_01;
pub const FIELD_DETAILS: u16 = 0x_00_02;
pub const FIELD_SERVER_TRACEBACK: u16 = 0x_01_01;
// TODO(tailhook) these... |
// COPYRIGHT (C) 2017 barreiro. All Rights Reserved.
// Rust solvers for Project Euler problems
use std::cmp::Ordering;
use std::cmp::Ordering::{Equal, Greater, Less};
use std::fs::read_to_string;
use std::path::Path;
use std::str::FromStr;
use euler::Solver;
// In the card game poker, a hand consists of five cards ... |
#![allow(clippy::from_str_radix_10)]
use std::cmp::Ordering;
use std::collections::HashMap;
use std::fs::File;
use std::io::Write;
use anyhow::Result;
use string_builder::Builder;
use structopt::StructOpt;
extern crate pest;
#[macro_use]
extern crate pest_derive;
use pest::iterators::Pair;
use pest::Parser;
#[deriv... |
use super::{Color, FontStyle, FrameBuffer, FrameBufferExt, MonospaceFont, VecBuffer};
use alloc::collections::VecDeque;
use alloc::vec;
use alloc::vec::Vec;
#[derive(Debug)]
pub struct MonospaceTextBuffer<'a, T> {
lines: VecDeque<Line>,
buf: T,
render_diff: RenderDiff,
font: MonospaceFont<'a>,
curs... |
use std::convert::TryFrom;
use std::fs;
use std::net::SocketAddr;
use std::str::FromStr;
use std::sync::Arc;
use anyhow::{Context, Result};
use openssl::{
asn1::{Asn1Integer, Asn1Time},
bn::BigNum,
ec::{EcGroup, EcKey},
hash::MessageDigest,
nid::Nid,
pkey::{PKey, Private},
x509::{X509Builde... |
//------------------------------------------------------------------------------
// triangulation.rs
//------------------------------------------------------------------------------
// Provides the structures and the function to do Y-monotone triangulation of
// the contours
//------------------------------------------... |
use bytes::Bytes;
use interledger_service::{Account, AccountStore};
use tokio::runtime::Runtime;
use parking_lot::RwLock;
use std::collections::HashMap;
use std::sync::Arc;
use hyper::StatusCode;
use std::process::Command;
use std::str::FromStr;
use std::thread::sleep;
use std::time::Duration;
use ethereum_tx_sign::... |
// 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 in the LICENSE-APACHE file or at:
// https://www.apache.org/licenses/LICENSE-2.0
//! Data list example (indirect representation)
//!
//! Thi... |
use crate::{Circuit, Coeff, ConstraintSystem, Field, LinearCombination, SynthesisError, Variable};
use std::marker::PhantomData;
/// This is a backend for the `SynthesisDriver` to relay information about
/// the concrete circuit. One backend might just collect basic information
/// about the circuit for verification, ... |
use scanner::{Marker, ScanError, TScalarStyle, TokenType};
use parser::*;
use yaml::Yaml;
use settings::{YamlSettings, YamlStandardSettings};
use builder::{YamlBuilder, YamlStandardBuilder, YamlNodeKind};
use std::mem;
use std::collections::BTreeMap;
use std::f64;
// parse f64 as Core schema
// See: https://github.c... |
use crate::{JsonRpcClient, Middleware, PinBoxFut, Provider, ProviderError};
use ethers_core::types::{Transaction, TxHash, U256};
use futures_core::{stream::Stream, Future};
use futures_util::{stream, stream::FuturesUnordered, FutureExt, StreamExt};
use pin_project::pin_project;
use serde::{de::DeserializeOwned, Seria... |
use core::fmt;
use core::marker::PhantomData;
use crate::paging::{PhysicalAddress, VirtualAddress};
#[derive(Debug, Clone, Copy, PartialEq)]
#[repr(transparent)]
pub struct EntryOptions(u16);
#[derive(Debug, Clone, Copy, PartialEq)]
#[repr(C)]
pub struct Entry<F> {
pointer_low: u16,
gdt_selector: u16,
... |
use crate::{
chronist::{Chronist, UtxoData, INCLUSION_INDEX, TRANSACTION_MESSAGE_KEY},
error::Result,
};
use iota_client::{
bee_message::{Message, MessageId},
bee_rest_api::types::dtos::MessageDto,
};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use tokio::sync::RwLock;
use warp::{path, Filt... |
pub use crate::value::tag::KwKind::*;
use crate::compiler::parser::Parser;
use crate::compiler::transpiler::Transpiler;
use crate::value::attr::{AKind, Attr, PropValue};
use crate::value::tag::KwKind::*;
use crate::value::{HtmlValue, HtmlValueResult, VBehavior, VKind};
use qoeurc::analyzer::interpreter::Interpreter;
... |
use iron::{Listening, status};
use iron::prelude::*;
use std::net::ToSocketAddrs;
use std::ops::Drop;
use mount::Mount;
use router::Router;
use staticfile::Static;
use std::sync::{Weak, RwLock, Arc, Mutex};
use super::state::State as ToyundaState;
use super::command::*;
use super::video_meta::*;
use super::toyunda_hist... |
//! Resource services, which allow backend plugins to handle custom HTTP requests and responses.
use std::pin::Pin;
use futures_util::StreamExt;
use http::{
header::{HeaderName, HeaderValue},
Request, Response, StatusCode,
};
use itertools::Itertools;
use prost::bytes::Bytes;
use crate::{
backend::{Conver... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Device Configuration Status"]
pub dma_device_cfg: crate::Reg<dma_device_cfg::DMA_DEVICE_CFG_SPEC>,
#[doc = "0x04 - Software Channel Trigger Register"]
pub dma_sw_chtrig: crate::Reg<dma_sw_chtrig::DMA_SW_CHTRIG_SPEC>,
_r... |
use std::hash::Hash;
use ast::knormal::*;
use util::{Id, Spanned, ToSpanned};
// for comparison considering commutativity
// ignoring float constant NaN, which do not emerge in constant context
// so this provides `Eq` trait
#[derive(Debug, Clone)]
struct ExprInVal(Box<Expr>);
fn eq_in_val(e: &Expr, other: &Expr) ->... |
//!
//! The query parser can turn a string that follows the Toql query syntax into a [Query](../query/struct.Query.html).
//!
//! ## Example
//!
//! ``` ignore
//! let query = QueryParser::parse("*, +username").unwrap();
//! assert_eq!("*, +username", query.to_string());
//! ```
//! Read the guide for more information... |
use std::collections::HashMap;
use std::path::Path;
use geomatic::{laea, Point3035, Point4326};
use osrmreader::{Entry, OsrmReader};
use serde::{Serialize, Deserialize};
use crate::bounding_box::BoundingBox;
use crate::geojson_writer::GeoJsonWriter;
use crate::polyline::PolylineCollection;
#[derive(Copy, Clone, Deb... |
// LNP/BP Rust Library
// Written in 2020 by
// Dr. <NAME> <<EMAIL>>
//
// To the extent possible under law, the author(s) have dedicated all
// copyright and related and neighboring rights to this software to
// the public domain worldwide. This software is distributed without
// any warranty.
//
// You should hav... |
//! The postgresql database code
use dotenv::dotenv;
use std::env;
use tokio_postgres::{
Connection, NoTls, Error, Socket, Client,
tls::{NoTlsStream}
};
use tokio::{fs::{File},
io::{AsyncReadExt}};
use chrono::{Utc, DateTime};
use log::{error, info};
use crate::pgdb::{models};
pub type DbConnectio... |
use crate::base::{ray::Ray, rtweekend::*, vec3::*};
use crate::bvh::aabb::AABB;
use crate::objects::material::Material;
use std::sync::Arc;
#[derive(Clone)]
pub struct HitRecord {
pub p: Point3,
pub normal: Vec3,
pub mat_ptr: Arc<dyn Material>,
pub t: f32,
pub u: f32,
pub v: f32,
... |
//! Client library for the Language Server part of the Enso Protocol.
//!
//! Please refer to https://github.com/enso-org/enso/blob/develop/docs/language-server/README.md---language-server
//! for the full protocol documentation and discussion on the types and terms used here.
//!
//! Also, the Enso Protocol specificat... |
use std::io::{BufWriter, Stdin, Stdout, Write};
use termion::cursor::DetectCursorPos;
use termion::event::Key;
use termion::input::{Keys, TermRead};
use termion::raw::{IntoRawMode, RawTerminal};
use termion::{clear, color, cursor, style, terminal_size};
use super::theme::Theme;
use crate::data::SnapshotStatus;
use cra... |
use crate::point::Point;
/// A rectangle representation, anchored at the bottom left corner
///
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct Rectangle {
/// anchor of rectangle at bottom left corner
anchor: Point,
width: f32,
height: f32,
}
#[derive(Debug, PartialEq, Eq)]
pub(crate) enum Quadr... |
use std::cmp::Ordering;
use std::collections::BinaryHeap;
use stable_vec::StableVec;
use log::debug;
use crate::graph::{Edge, Graph};
use crate::osm::Coordinates;
use crate::osm::options::{Routing, Transport, ChargingOptions};
use crate::osm::options::Routing::Time;
use crate::osm::options::Transport::Car;
pub stru... |
use serde::{Deserialize, Serialize};
use std::path::{Path, PathBuf};
use crate::{AppVersion, ImageSeed, ImageVersion, InstallerError, Result, Smalltalk};
use feenk_releaser::{GitHub, Version};
use file_matcher::{FolderNamed, OneEntry, OneEntryNamed};
use std::fs::File;
use std::io::Write;
pub const DEFAULT_IMAGE_NAME... |
//! Deserializer for item categories.
use std::fmt;
use itertools::Itertools;
use serde::de::{self, Deserialize, Visitor};
use super::super::{AccessoryType, ArmourType, ItemCategory, JewelType, WeaponType};
const EXPECTING_MSG: &str = "item category as string or 1-element map";
/// Category names as found in the ... |
mod aead;
mod stream;
use async_std::io::{Read, Write};
use async_std::prelude::*;
use std::io::{ErrorKind, Result};
use std::{
io,
pin::Pin,
task::{Context, Poll},
};
use async_std::task::ready;
use bytes::{Bytes, BytesMut};
use tracing::trace;
use crypto::{CipherCategory, CipherType};
use self::{
... |
use std::{fs::File, io::BufReader};
use crate::auth_hexagon::auth_types::SessionToken;
use super::{
auth_service_port::{AuthServiceError, AuthServicePort},
auth_types::AllowedOrigin,
auth_types::TlsConfig,
auth_types::ValidateCsrf,
};
use actix_cors::Cors;
use actix_web::{
dev::Payload, dev::Serve... |
//! # Backgammon: The Oldest Board Game of the World
//! This crate provides a pure, canonical implementation of the game
//! [*Backgammon*](https://en.wikipedia.org/wiki/Backgammon). It allows to
//! implement fast Backgammon games in various clients.
//!
//! ## Supported Doubling Cube Rules
//! This library supports ... |
//! A custom kubelet backend that can run [WASI](https://wasi.dev/) based workloads
//!
//! The crate provides the [`WasiProvider`] type which can be used
//! as a provider with [`kubelet`].
//!
//! # Example
//! ```rust,no_run
//! use kubelet::{Kubelet, config::Config};
//! use kubelet::module_store::FileModuleStore;
... |
use std::ffi::{CString};
use std::os::raw::{
c_char, c_int, c_ulonglong,c_void,
};
use std::ptr::null_mut;
use crate::kits::{CStruct, to_c_char, to_str, CArray};
mod kits;
pub type CBool = u32;
#[allow(non_upper_case_globals)]
pub const CFalse: CBool = 0u32;
#[allow(non_upper_case_globals)]
pub const CTrue: CBo... |
use core::slice;
use memmap;
use memdef;
use core::ptr::{read_volatile, write_volatile};
#[derive(Eq, PartialEq, Copy, Clone, Debug)]
#[repr(C)]
pub struct Color (pub u16);
#[derive(Eq, PartialEq, Copy, Clone, Debug)]
#[repr(C)]
pub struct PaletteIx (pub u8);
impl Color {
/// Creates a color with 16 bits, 5 bits... |
use crate::span::Span;
use nom::{bytes::streaming::take, error::ParseError, number::streaming::le_u32, IResult};
use std::{convert::TryInto, io::Write};
#[derive(Debug, PartialEq)]
pub struct ContentEncryptionData<'a> {
pub secret_data: Span<'a>,
pub protection_type: Span<'a>,
pub key_id: Span<'a>,
pub... |
use crate::{
function_args::{FunctionArgs, FunctionMeta},
prelude::*,
traits::{get_trait_fn, GenFn},
with_tokens::WithTokens,
};
use proc_macro2::{Ident, Span, TokenStream};
use quote::{quote, ToTokens};
use syn::{
parse::Parser, parse2, punctuated::Punctuated, spanned::Spanned, token, Attribute, Ge... |
use rustc_hash::{FxHashMap, FxHashSet};
use std::iter::FromIterator;
pub use serde_json::Value as HandlerArg;
type Attribute = (String, AttributeValue);
fn diff_attributes(a: &mut Vec<Attribute>, b: &[Attribute]) -> Vec<Diff> {
let mut result = vec![];
let mut old_map = FxHashMap::<String, AttributeValue>::... |
use piston_window::*;
use rand::{SeedableRng, rngs::StdRng};
use crate::utils::*;
use crate::agents::*;
/// Holds the contents of a tile
#[derive(Copy, Clone, PartialEq)]
enum Tile {
Occupied(Player, Piece),
Empty,
}
/// The type of piece
#[derive(Copy, Clone, PartialEq)]
enum Piece {
Pawn, // normal pawn
B... |
//! `escape8259` performs RFC8259-compliant string escaping and un-escaping.
//!
//! [RFC8259] is a JSON encoding standard. Many JSON encoders exist, but other
//! RFCs use the same string escaping mechanism, so it's useful to be able to
//! access the string escaping functions by themselves.
//!
//! # Examples
//!
//... |
use std::collections::HashMap;
use std::sync::{
Arc,
Mutex,
};
use std::sync::mpsc::channel;
use nats_client::{
AsyncSubscription,
Config as NatsConfig,
Message,
NatsConn,
};
use protobuf::Message as PMessage;
use protobuf::core::parse_from_bytes;
use rand::{
Rng,
StdRng,
};
use std::ti... |
//! Implement the infrastructure for custom streams.
//!
//! We actually get to do this on top of `Read` and `Seek` directly.
use crate::internal_prelude::*;
use std::borrow::Borrow;
use std::ffi::{c_void, CString};
use std::io::{Read, Seek};
use std::os::raw::{c_char, c_int, c_longlong, c_ulonglong};
use std::slice::f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.