text stringlengths 3.09k 13.9k |
|---|
// Based on `import.rs` in the `gltf` crate, but modified not to load images (we do that separately).
use bytes::Bytes;
use gltf::{buffer, image, Document, Error, Gltf, Result};
use std::{fs, io, path::Path};
use crate::image::ImageSource;
type BufferBytes = Bytes;
/// Return type of `import`.
type Import = (Docume... |
// Copyright 2020 <NAME>
// SPDX-License-Identifier: Apache-2.0
use getset::Getters;
pub use iota::client::builder::Network;
use iota::client::{BrokerOptions, Client, ClientBuilder};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use tokio::sync::RwLock;
use url::Url;
use std::{
collections::Hash... |
//! A color to represent pieces or board squares.
//!
//! Chess deals primarily with two colors: white and black. They're used to
//! categorize players, pieces, and board squares.
//!
//! Because [`Color`] is an `enum`, it can be used to safely index into tables
//! of size 2 or greater. The optimizer knows that a col... |
use native_tls::TlsStream;
use std::env::var;
use std::net::TcpStream;
use std::time::{Duration, Instant};
use tungstenite::stream::Stream;
use tungstenite::{Message, WebSocket};
use rand::{thread_rng, Rng};
use log::*;
use crate::common_structs::socket::setup_socket;
pub mod parse_message;
pub use parse_message::*;
u... |
use num_traits::FromPrimitive;
#[derive(Clone, Copy, Default)]
pub struct ObjTransform {
pub pa: u16,
pub pb: u16,
pub pc: u16,
pub pd: u16,
}
#[derive(Clone, Copy, Primitive)]
enum ObjMode {
Normal = 0,
SemiTransparent = 1,
ObjWindow = 2,
}
impl Default for ObjMode {
fn default() -> ... |
use std::sync::Arc;
use twilight_model::application::interaction::{
application_command::{CommandDataOption, CommandOptionValue},
ApplicationCommand,
};
use crate::{
commands::{MyCommand, MyCommandOption},
core::MatchTrackResult,
util::{
constants::{OSU_API_ISSUE, OSU_BASE},
matche... |
use super::auth::Auth;
use super::defs::*;
use crate::emit;
use crate::model;
use actix_web::{web, HttpResponse};
use itertools::izip;
use serde::Deserialize;
use serde_json::json;
use std::collections::HashSet;
use tokio_postgres::row::Row;
use uuid::Uuid;
pub async fn get_comments(
data: web::Data<MyData>,
a... |
// Copyright 2021 UINB Technologies Pte. Ltd.
// 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 ag... |
// lib.rs
// 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 t... |
/*
* Created on Mon Dec 14 2020
*
* Copyright (c) storycraft. Licensed under the Apache Licence 2.0.
*/
use std::{collections::HashMap, io::{self, Read, Seek, SeekFrom, Write}};
use adler32::RollingAdler32;
use byteorder::{WriteBytesExt, LittleEndian};
use flate2::{Compression, read::ZlibEncoder};
use super::{Vi... |
use std::fmt::Debug;
use std::collections::hash_map::HashMap;
use serde::ser::{Serialize, Serializer, SerializeStruct};
use super::{Resource, Format, Variant};
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
pub enum ClearFlags
{
Color(f32,f32,f32,f32),
Depth(f32),
Stencil(u8)
}
#[derive(Debug, Co... |
use std::any::Any;
use std::error::Error;
use std::fmt;
use std::sync::Arc;
use web_sys::WebglCompressedTexturePvrtc;
use web_sys::WebGlRenderingContext;
use web_sys::WebGlTexture;
use crate::error::GfxError;
use crate::memory::Memory;
use crate::memory as memory;
const TEXTURE_CLAMP : u32 = 1 << 0;
const T... |
// Copyright (C) 2021 Alibaba Cloud Computing. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 or BSD-3-Clause
//! Kernel-based vhost-net backend
use std::fs::{File, OpenOptions};
use std::os::unix::fs::OpenOptionsExt;
use std::os::unix::io::{AsRawFd, RawFd};
use vm_memory::GuestAddressSpace;
use vmm_sys... |
#![allow(dead_code)]
// HELP FROM https://github.com/andyhall/fast-voxel-raycast/blob/master/index.js
use server_common::{math::approx_equals, types::GetVoxel, vec::Vec3};
#[allow(clippy::too_many_arguments)]
fn trace_ray(
get_voxel: GetVoxel,
px: f32,
py: f32,
pz: f32,
dx: f32,
dy: f32,
... |
use crate::prelude::*;
use crate::util::*;
use futures::{future::*, stream::Stream, Future};
use http::request::Parts;
use hyper::{Body, Request, Response};
use unstructured::Document;
/// Current details on the request or response currently associated with this context
#[derive(Debug)]
pub enum HttpRequest {
/// ... |
use crate::render::ExtraShapeID;
use crate::ui::PerMapUI;
use abstutil::Timer;
use ezgui::Color;
use geom::Pt2D;
use map_model::{AreaID, BuildingID, BusStopID, IntersectionID, LaneID, RoadID, TurnID};
use serde_derive::{Deserialize, Serialize};
use sim::{AgentID, CarID, PedestrianID};
use std::collections::{BTreeMap, H... |
//! Crate with various derive macros
#![allow(clippy::restriction)]
use proc_macro::TokenStream;
use quote::quote;
/// Attribute for skipping from attribute
const SKIP_FROM_ATTR: &str = "skip_from";
const SKIP_TRY_FROM_ATTR: &str = "skip_try_from";
/// Deriving `From<Vec<u8>>` and `TryInto<Vec<u8>>` traits for stru... |
use crate::shared::{
auth::{account_can_modify_calendar, protect_account_route, Permission},
usecase::{execute, execute_with_policy, PermissionBoundary, UseCase, UseCaseErrorContainer},
};
use crate::{error::NettuError, shared::auth::protect_route};
use actix_web::{web, HttpResponse};
use nettu_scheduler_api_st... |
use std::error::Error;
use std::fmt;
use std::num::ParseIntError;
use std::str::FromStr;
fn main() {
// let input = include_str!("../../input/day12.test.txt");
let input = include_str!("../../input/day12.txt");
let instrs = input
.lines()
.map(|v| v.parse::<Instr>().unwrap_or_else(|_| pani... |
// Copyright 2019 The Starlark in Rust Authors
//
// 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 la... |
//! MS Container Map Records.
// Adapted from yubico-piv-tool:
// <https://github.com/Yubico/yubico-piv-tool/>
//
// Copyright (c) 2014-2016 Yubico AB
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions a... |
//! Support for mock HTTP servers that verify pacts.
use pact_matching::models::*;
use pact_mock_server::*;
use pact_mock_server::matching::MatchResult;
use std::{
fmt::Write as FmtWrite,
env,
io::{self, prelude::*},
thread
};
use url::Url;
use tokio;
/// This trait is implemented by types which allow us to s... |
//! Stysh Intermediate Representation, aka Control Flow Graph.
//!
//! This is the model describing the execution semantics of the program. It uses
//! a variant of Static Single Assignment.
//!
//! Normally, in SSA form, the function is decomposed in Basic Blocks:
//! - each Basic Block has a single point of entry a... |
use crate::devices::net::e1000;
use crate::devices::NET_DRIVERS;
use crate::phys_to_virt;
use alloc::format;
use kernel_hal::PAGE_SIZE;
use pci::*;
const PCI_COMMAND: u16 = 0x04;
const PCI_CAP_PTR: u16 = 0x34;
const PCI_MSI_CTRL_CAP: u16 = 0x00;
const PCI_MSI_ADDR: u16 = 0x04;
const PCI_MSI_DATA_32: u16 = 0x08;
const... |
use crate::Result;
use ash::vk;
use ash::Device;
use parking_lot::Mutex;
use parking_lot::RwLock;
use smallvec::SmallVec;
use std::{collections::HashMap, iter::repeat, sync::Arc};
pub use vk::DescriptorSetLayout;
use super::DescriptorLayoutInfo;
struct Pool {
pool: vk::DescriptorPool,
set_count: u32,
allo... |
use nalgebra::{Isometry3, Matrix3xX, Vector3};
use rubullet::Mode::Direct;
use rubullet::{BodyId, ControlCommandArray, JointInfo, JointState, PhysicsClient, UrdfOptions};
use std::time::Duration;
use anyhow::Result;
pub fn set_joint_positions(client: &mut PhysicsClient, robot: BodyId, position: &[f64]) {
let num_... |
//! The versioning strategy, see [`Version`] for details
/// The versioning strategy
///
/// # Slot Exhaustion
///
/// Arenas store a version alongside each slot they have. If a slot's version is
/// exhausted, then that slot will *never* be reused. For [`DefaultVersion`]
/// this will only happen after about 2 billio... |
///! Interface for direct access to a workers rpc.
///
/// This should be replaced with the `jsonrpsee::WsClient`. It is async an removes a lot of
/// boilerplate code. Example usage in worker/worker.rs.
///
use codec::Decode;
use log::*;
use openssl::ssl::{SslConnector, SslMethod, SslStream, SslVerifyMode};
use std::{... |
// (c) Copyright 2018 Palantir Technologies Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless req... |
use crate::decode::Decoder;
use crate::rr::{Class, Type, RR};
use crate::{DecodeError, DecodeResult, DomainName};
use std::convert::TryFrom;
pub(super) struct Header {
pub(super) domain_name: DomainName,
pub(super) class: u16,
pub(super) ttl: u32,
}
impl Header {
pub(super) fn get_class(&self) -> Deco... |
use proc_macro2::TokenStream;
use quote::quote;
use syn::{Data, DeriveInput, Fields};
use crate::helpers::{
non_enum_error, occurrence_error, HasStrumVariantProperties, HasTypeProperties,
};
pub fn from_string_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
let name = &ast.ident;
let (impl_generics... |
//! Match strings against a simple wildcard pattern.
//! Tests a wildcard pattern p against an input string s. Returns true only when p matches the entirety of s.
//!
//! A very simplified syntax is used here. See also the example described on [wikipedia](https://en.wikipedia.org/wiki/Matching_wildcards) for matching w... |
use bytes::BytesMut;
use std::io;
use tokio::io::{AsyncWriteExt, BufWriter};
use tokio::net::{TcpStream, ToSocketAddrs};
// TODO(mdlayher): try to avoid usage of *.
use crate::handshake::frame::{Frame as HandshakeFrame, *};
use crate::handshake::RawConnection;
use crate::transmit::Frame as TransmitFrame;
use crate::St... |
use crate::config;
use crate::res;
use crate::ui;
use gdk_pixbuf;
use glib;
use gdk;
use gdk::DisplayExt;
use gdk_pixbuf::PixbufLoaderExt;
use gio;
use gio::ActionMapExt;
use gio::ApplicationExt;
use gio::ApplicationExtManual;
use gio::SimpleActionExt;
use gtk;
use gtk::BoxExt;
use gtk::ContainerExt;
use gtk::CssPro... |
// The message module
//
// Sha2 hash functions operate on messages and message blocks.
// Messages are created by padding the intput data and message
// blocks are created by splitting the message into 512 or 1024
// bit blocks.
use crate::core::{
functions::sha2::SigmaFunctions,
Primitive
};
/// Message s... |
use crate::Result;
use quick_xml;
use rust_fuzzy_search::fuzzy_compare;
use serde::Deserialize;
use std::{collections::HashMap, fmt::Display, fs::File, io::BufReader, path::PathBuf};
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum Difficulty {
Unknown,
Novice,
Advanced,
Exhaust,
Infinite,
... |
mod utils;
use wasm_bindgen::prelude::*;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[wasm_bindgen]
#[derive(Debug, PartialEq)]
pub struct ModifiedBandDepth {
... |
use super::{
cells::{Cell, Instruction},
economy::Item,
};
use crate::{drawutils, Globals};
use crate::{
drawutils::{CARD_HEIGHT, CARD_WIDTH},
modes::playing::Truck,
};
use drawutils::{HEX_HEIGHT, HEX_WIDTH};
use hex2d::{Angle, Coordinate, Direction};
use macroquad::prelude::{draw_texture, ... |
/*
Copyright (c) 2015, 2016 <NAME>
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, merge, publish, distribute, su... |
//! Database for the querier that contains all namespaces.
use crate::{
cache::CatalogCache, chunk::ChunkAdapter, ingester::IngesterConnection,
namespace::QuerierNamespace, query_log::QueryLog,
};
use async_trait::async_trait;
use backoff::{Backoff, BackoffConfig};
use data_types::Namespace;
use iox_query::exe... |
use std::time::Duration;
use wasm_bindgen::prelude::*;
use yew::prelude::*;
use yew::services::{Task, TimeoutService};
use crate::button::*;
use crate::form::*;
use crate::icon::*;
use crate::*;
use yew::web_sys::{Element, HtmlInputElement};
#[derive(Clone, PartialEq, Properties)]
pub struct Props {
#[prop_or_def... |
use std::{iter, mem, slice};
use simd::*;
pub trait SimdValue: Sized + Send {
type SimdBool: SimdValue + From<bool>;
type V128: SimdVector<Element = Self>;
fn splat_128(self) -> Self::V128;
}
pub unsafe trait SimdVector: Sized + Send {
type Element;
type BoolV: SimdVector;
type Elements: Iter... |
use ::bytes::{Buf, BufMut};
use hex::FromHex;
use serde_json::value::RawValue;
use prost::{
encoding::{bool, bytes, skip_field, DecodeContext, WireType},
DecodeError, Message,
};
use serde::de::{Deserialize, Deserializer};
use serde::ser::{Serialize, Serializer};
/// Generated schema and rpc structs.
pub mod... |
// Copyright (C) 2017 <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... |
use crypto;
use log::*;
use std::{
path::PathBuf,
sync::Arc,
};
use structopt::StructOpt;
use tap::*;
/// Algorithm utilized for hashing passwords
pub type PWAlgo = crypto::algo::hash::argon2::d::Algo;
pub type PWKeyFixture = Arc<crypto::StableKeyStore<PWAlgo>>;
/// Algorithm utilized for encrypting tokens.
pu... |
use relm::{Relm, Update, Widget, connect};
use gtk::prelude::*;
use gtk::*;
use gtk::{Window, WidgetExt, Inhibit, WindowType};
use relm_derive::Msg;
use gdk::{EventKey, keyval_to_unicode, enums::key};
use relm_derive::{widget};
use std::time::{Duration, Instant};
use std::convert::TryFrom;
// use super::model::Model;... |
/*
References
[1] <NAME>. (2014).
Determinant sums for undirected hamiltonicity.
SIAM Journal on Computing, 43(1), 280-299.
[2] 指数時間アルゴリズムの最先端
https://www.slideshare.net/wata_orz/ss-12208032
[3] 組合せ最適化に対する代数的厳密アルゴリズム
京都大学数理解析研究所「組合せ最適化セミナー」(第 8 回)
http://www.kurims.kyoto-u.ac.jp/coss/coss2011/ok... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control"]
pub ctrla: CTRLA,
_reserved1: [u8; 11usize],
#[doc = "0x0c - Channel Status"]
pub chstatus: CHSTATUS,
#[doc = "0x10 - Interrupt Enable Clear"]
pub intenclr: INTENCLR,
#[doc = "0x14 - Interrupt Enab... |
use libc::{chroot, mount, MS_BIND, MS_RDONLY, MS_NODEV, MS_NOEXEC, MS_NOSUID};
use libc;
use metadata;
use std::collections::HashSet;
use std::env::set_current_dir;
use std::ffi::CString;
use std::fs::create_dir;
use std::io;
use std::os::unix::process::CommandExt;
use std::path::Path;
use std::process::Command;
use ... |
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use crate::core_isolate::CoreIsolateState;
use crate::ZeroCopyBuf;
use futures::Future;
use std::collections::HashMap;
use std::pin::Pin;
use std::rc::Rc;
pub type OpId = u32;
pub type Buf = Box<[u8]>;
pub type OpAsyncFuture = Pin<Box<dyn Fut... |
#[macro_use]
extern crate json;
fn main() {
let mut parsed = json::parse(r#"[
{
"code": 200,
"success": true,
"payload": {
"features": [
"awesome",
"easyAPI",
"lowLearningCurve"
]... |
use cosmwasm_std::{
from_binary, to_binary, Api, Binary, CanonicalAddr, Decimal, Extern, HumanAddr, Querier,
QueryRequest, StdError, StdResult, Storage, WasmQuery,
};
use cosmwasm_storage::to_length_prefixed;
use crate::state::{read_config, read_fixed_price, Config};
use mirror_protocol::collateral_oracle::{
... |
/*
* Copyright 2019 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... |
use crate::commands::classified::block::run_block;
use crate::context::CommandRegistry;
use crate::evaluate::operator::apply_operator;
use crate::prelude::*;
use async_recursion::async_recursion;
use log::trace;
use nu_errors::{ArgumentError, ShellError};
use nu_protocol::hir::{self, Expression, SpannedExpression};
use... |
use {
super::*,
paychains_entry::entry::Entry,
paychains_ledger::shred::Shredder,
paychains_sdk::{hash::Hash, signature::Keypair},
};
#[derive(Clone)]
pub(super) struct BroadcastFakeShredsRun {
last_blockhash: Hash,
partition: usize,
shred_version: u16,
next_code_index: u32,
}
impl Bro... |
use std::time::{Duration, Instant};
use actix::*;
use actix_files as fs;
use actix_web::{web, App, Error, HttpRequest, HttpResponse, HttpServer};
use actix_web_actors::ws;
use names::{Generator, Name};
mod server;
/// How often heartbeat pings are sent
const HEARTBEAT_INTERVAL: Duration = Duration::from_secs(5);
///... |
// Module for WAST format (.wast files), which extends WebAssembly's text format (WAT).
// .wast is not a part of WebAssembly spec, but it's used by WebAssembly's spec tests to describe
// test cases.
use wain_ast as ast;
use wain_exec::Value;
use wain_syntax_text::source::TextSource;
// (module quote *{string})
// (... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control A"]
pub ctrla: CTRLA,
_reserved1: [u8; 3usize],
#[doc = "0x04 - Event Control"]
pub evctrl: EVCTRL,
_reserved2: [u8; 3usize],
#[doc = "0x08 - Interrupt Enable Clear"]
pub intenclr: INTENCLR,
#[do... |
use super::parser::XMLNode;
/*
Protocol documentation: https://github.com/coq/coq/blob/master/ide/coqide/protocol/interface.ml
*/
#[derive(Debug, Clone)]
pub enum ProtocolValue {
/// `<unit/>` which holds no value
Unit,
/// `<list>...</list>` for a list value
List(Vec<ProtocolValue>),
/// `<strin... |
//! Mocks for the NFT benchmarking.
#![cfg(test)]
use super::*;
use codec::{Decode, Encode};
use frame_support::{
impl_outer_dispatch, impl_outer_origin, parameter_types,
traits::{Filter, InstanceFilter},
weights::Weight,
RuntimeDebug,
};
use primitives::{Amount, BlockNumber, CurrencyId, TokenSymbol... |
//! `signature_checker` module provides a detached thread routine
//! dedicated for checking the signatures of incoming transactions.
//! Main routine of this module operates a multithreaded event loop,
//! which is used to spawn concurrent tasks to efficiently check the
//! transactions signatures.
// External uses
u... |
#![allow(dead_code)]
use futures::prelude::*;
use redis::Client;
use redis_ac::Commands;
use std::process::{Child, Command, Stdio};
pub use tokio::runtime::current_thread::block_on_all;
pub struct Server {
p: Option<Child>,
}
fn sleep() {
std::thread::sleep(std::time::Duration::from_secs(1));
}
impl Server... |
//! Internal Timer
use kernel::common::cells::OptionalCell;
use kernel::common::registers::register_bitfields;
use kernel::hil::time;
use kernel::hil::time::{Alarm, Counter, Ticks, Ticks32, Time};
use kernel::ErrorCode;
use riscv_csr::csr::ReadWriteRiscvCsr;
/// 50MHz `Frequency`
#[derive(Debug)]
pub struct Freq50MHz... |
//! Create a timer using the Machine Timer registers.
use kernel::common::cells::OptionalCell;
use kernel::common::registers::{register_structs, ReadWrite};
use kernel::common::StaticRef;
use kernel::hil::time::{self, Alarm, Freq32KHz, Frequency, Ticks, Ticks64, Time};
use kernel::ReturnCode;
register_structs! {
... |
/*
* BSD 3-Clause License
*
* Copyright (c) 2021, <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this... |
use std::io::Read;
use std::marker::Send;
use symphonia::core::audio::SampleBuffer;
use symphonia::core::codecs::Decoder as SymphoniaDecoderTrait;
use symphonia::core::codecs::DecoderOptions;
use symphonia::core::formats::FormatOptions;
use symphonia::core::formats::FormatReader;
use symphonia::core::io::{MediaSource,... |
pub use async_trait::async_trait;
use std::fmt;
use std::marker;
use std::mem;
use std::ops::Deref;
pub use wit_bindgen_rust_impl::{export, import};
pub mod exports;
mod futures;
pub mod imports;
// Re-export `bitflags` so that we can reference it from macros.
#[doc(hidden)]
pub use bitflags;
/// A type for handles ... |
use std::convert::{TryFrom, TryInto};
use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenInit as RawMsgConnectionOpenInit;
use tendermint_proto::Protobuf;
use tendermint::account::Id as AccountId;
use crate::address::{account_to_string, string_to_account};
use crate::ics03_connection::connection::Counterpart... |
use std::sync::mpsc::{channel, Sender, Receiver};
use std::sync::{Arc, Mutex, Condvar};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread;
trait FnBox {
fn call_box(self: Box<Self>);
}
impl<F: FnOnce()> FnBox for F {
fn call_box(self: Box<F>) {
(*self)()
}
}
type Thunk<'a> = Box<dyn ... |
// 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 anyhow::Error;
use fidl_fuchsia_cobalt::{CobaltEvent, EventPayload};
use fidl_fuchsia_cobalt_test::{self, LoggerQuerierProxy};
use fidl_fuchsia_mockrebo... |
// Copyright © 2018–2022 <NAME>
// This library is free software: you can redistribute it and/or
// modify it under the terms of either
//
// * the Apache License, Version 2.0 or
// * the MIT License
//
// at your option.
//
// You should have recieved copies of the Apache License and the MIT
// License along with... |
#![allow(clippy::from_iter_instead_of_collect)]
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::iter::FromIterator;
use sn_dbc::{bls_dkg_id, Dbc, DbcContent, KeyManager, Mint, ReissueRequest, ReissueTransaction};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
fn genes... |
//! The HTTP client implementation.
use crate::body::Body;
use crate::error::Error;
use crate::internal::agent;
use crate::internal::request;
use crate::middleware::Middleware;
use crate::options::*;
use futures::executor;
use futures::prelude::*;
use http::{Request, Response};
use lazy_static::lazy_static;
use std::s... |
use crate::client::Client;
use crate::delay;
use crate::helpers::*;
use anyhow::{anyhow, Result};
use log::{debug, info, warn};
use realtps_common::{
chain::Chain,
db::{Block, Db},
};
use std::sync::Arc;
pub async fn import(chain: Chain, client: &dyn Client, db: &Arc<dyn Db>) -> Result<()> {
let res = impo... |
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Plugin {
/// Type defines the type of plugin.
///
/// See package plugin for a list of possible values. Non core plugins may
/// define their own values during registration.
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::S... |
//!
use std::convert::TryInto;
use std::ops::Deref;
use git_hash::{oid, ObjectId};
use crate::object::find;
use crate::{Id, Object};
/// An [object id][ObjectId] infused with `Easy`.
impl<'repo> Id<'repo> {
/// Find the [`Object`] associated with this object id, and consider it an error if it doesn't exist.
... |
// MakAir
//
// Copyright: 2020, <NAME>
// License: Public Domain License
#[macro_use]
extern crate log;
#[macro_use]
extern crate nom;
pub mod alarm;
mod parsers;
pub mod structures;
pub use serial;
use serial::prelude::*;
use std::fs::File;
use std::io::BufRead;
use std::io::BufReader;
use std::io::BufWriter;
use ... |
/*
MxSelfBot by 0x1a8510f2
*/
// Include modules
mod log;
mod cmds;
mod context;
mod mxclient;
// Bring some stuff into the scope
use locales::t;
use log::{Logger, LogLevel};
// Keep track of the available languages to avoid panics
static AVAIL_LANG: [&'static str; 1] = [
"en_GB",
];
// Some metadata about th... |
//! Support for sending and receiving data link layer packets using libpcap.
//! Also has support for reading pcap files.
extern crate pcap;
use std::marker::{Send, Sync};
use std::io;
use std::iter::repeat;
use self::pcap::{Active, Activated};
use datalink::{self, NetworkInterface};
use datalink::{EthernetDataLinkCha... |
use std::collections::VecDeque;
use std::os::windows::fs::MetadataExt;
use std::path::{Path, PathBuf};
use std::sync::Mutex;
use std::time::{Duration, Instant};
use filesize::file_real_size;
use globset::GlobSet;
use serde_derive::Serialize;
use walkdir::WalkDir;
use winapi::um::winnt::{
FILE_ATTRIBUTE_COMPRESSED,... |
// This file is part of the uutils coreutils package.
//
// (c) <NAME> <<EMAIL>>
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
use clap::{App, Arg};
use clap_complete::Shell;
use std::cmp;
use std::ffi::OsStr;
use std::ffi::OsString;
u... |
// Copyright 2021 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use serde::{Deserialize, Serialize};
use tauri::{
plugin::{Builder as PluginBuilder, TauriPlugin},
Manager, PhysicalPosition, PhysicalSize, Position, RunEvent, Runtime, Size, Wind... |
//! Structures related to HACK programs.
//!
//! [Prog] can be used to represent the (flat) parse tree of a HACK
//! assembly program. The program can be parsed from HACK assembly
//! source code or disassembled from a compiled HACK binary or bintext
//! file.
use crate::conv;
use crate::hack::dec;
use crate::hack::Ad... |
//! `grapho-color` describes the color primitives that are used for computer graphics.
//! It contains color conversion functionality and will get SIMD acceleration in the future to be the most effective color-library.
//!
//! Currently the following color types are implemented:
//!
//! - Normalized Grayscale (compon... |
//! This is the rust equivalent of the canonical OpenCV example for Pachyderm:
//! https://github.com/pachyderm/pachyderm/tree/master/examples/opencv
//! See also the equivalent example in the python library:
//! https://github.com/pachyderm/python-pachyderm/blob/master/examples/opencv/opencv.py
extern crate futures;
... |
//! Event types.
pub use device::*;
pub use window::*;
pub use winit::dpi::LogicalPosition;
pub use winit::dpi::LogicalSize;
pub use winit::dpi::PhysicalPosition;
pub use winit::dpi::PhysicalSize;
pub use winit::event::AxisId;
pub use winit::event::ButtonId;
pub use winit::event::DeviceId;
pub use winit::event::Force... |
//! Type for parsing the `/etc/os-release` file.
#[macro_use]
extern crate lazy_static;
use std::collections::BTreeMap;
use std::fs::File;
use std::io::{self, BufRead, BufReader};
use std::iter::FromIterator;
use std::path::Path;
lazy_static! {
/// The OS release detected on this host's environment.
///
... |
//
// Copyright 2020 The Project Oak Authors
//
// 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 o... |
#![warn(clippy::all)]
#![warn(clippy::pedantic)]
#![allow(clippy::missing_errors_doc)]
#![warn(intra_doc_link_resolution_failure)]
#![warn(missing_debug_implementations)]
#![warn(rust_2018_idioms)]
//! # artichoke-backend
//!
//! `artichoke-backend` crate provides a Ruby interpreter. It currently is
//! implemented wi... |
use crate::config::{Client, Response};
use crate::ids::{BankAccountId, PaymentSourceId};
use crate::params::{Identifiable, List, Metadata, RangeQuery, Timestamp};
use crate::resources::{
Address, BankAccount, BankAccountVerifyParams, Currency, Deleted, Discount, PaymentSource,
PaymentSourceParams, Source, Subsc... |
extern crate proc_macro;
use proc_macro::TokenStream;
use proc_macro2::{Span, TokenStream as TokenStream2};
use quote::{quote, ToTokens};
use std::path::{Path, PathBuf};
use syn::{
bracketed,
parse::{Parse, ParseStream},
parse_macro_input,
punctuated::Punctuated,
token::{Comma, Eq},
Expr, Ident, LitStr,
};
mod ... |
//! Example generator usage:
//! ```
//! use rand::prelude::*;
//! use mapgen::{Map, MapFilter};
//! use mapgen::filter::MazeBuilder;
//!
//! let mut rng = StdRng::seed_from_u64(100);
//! let gen = MazeBuilder::new();
//! let map = gen.modify_map(&mut rng, &Map::new(80, 50));
//!
//! assert_eq!(map.width, 80);
//! as... |
use crate::encode::{encode, populate_with_task_network, populate_with_template_instances};
use crate::fmt::{format_hddl_plan, format_pddl_plan};
use crate::forward_search::ForwardSearcher;
use crate::solver::Strat::{Activity, Forward};
use crate::Solver;
use anyhow::Result;
use aries_core::state::Domains;
use aries_mod... |
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
use std::{
collections::BTreeSet,
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
time::Duration,
};
use sui_types::{
base_types::{ObjectID, SuiAddress},
crypto::{get_key_pair, AuthoritySignature, S... |
use bevy::prelude::*;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use client_websocket::connect;
use futures::future::ready;
use futures::prelude::*;
use futures::future::{join_all, ok, err};
use lazy_static::lazy_static;
use protocol::{BoxClient, BoxClient2,ClientName,nats,Client};
use std::borrow::Cow;
us... |
use crate::logical_plan::Context;
use crate::physical_plan::state::ExecutionState;
use crate::prelude::*;
use polars_core::frame::groupby::GroupBy;
use polars_core::frame::hash_join::private_left_join_multiple_keys;
use polars_core::prelude::*;
use std::sync::Arc;
pub struct WindowExpr {
/// the root column that t... |
//! Locations within Pokemon games.
use serde::Deserialize;
use serde::Serialize;
use crate::api::Endpoint;
use crate::model::pokedex::Pokedex;
use crate::model::resource::Resource;
use crate::model::species::Pokemon;
use crate::model::species::Species;
use crate::model::text::Localized;
use crate::model::version::Ga... |
use itertools::Itertools;
use std::cmp;
use unicode_width::*;
/// Represents pane. lines are the content of the pane and width is the width with which you want
/// to display the content.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Pane<'a> {
pub lines: &'a [&'a str],
pub width: usize,
}
#[derive(Debug... |
//! `sapp_jsutils` is not feature complete enough for me! Here's a handy extension
//! trait to make working with [`JsObject`]s slightly less horrible.
//!
//! [`JsObject`]: sapp_jsutils::JsObject
use crate::js_convert::{wrappers::LongOption, BadJsTypeError, FromJsObject, ToJsObject};
use anyhow::{anyhow, bail... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Contains the offsets of AB and CD in the RAM."]
pub ctrl0: crate::Reg<ctrl0::CTRL0_SPEC>,
#[doc = "0x04 - Contains the opcode mode, iteration count, and result offset (in RAM) and also launches the accelerator. Note: with CP ve... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.