text stringlengths 3.09k 13.9k |
|---|
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! # Coverage Task
//!
//! Computes a streaming coverage metric using Sancov-instrumented libFuzzers.
//! Reports the latest coverage rate via telemetry events and updates a remote
//! total coverage map in blob storage.
//!
//! ## Instrumenta... |
// 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::{InStream, OutStream};
use c... |
// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
// #[PerformanceCriticalPath]
use crate::storage::kv::{Iterator, Result, Snapshot, TTL_TOMBSTONE};
use crate::storage::Statistics;
use engine_traits::raw_value::{ttl_current_ts, RawValue};
use engine_traits::CfName;
use engine_traits::{IterOptions, Re... |
use std::any::{Any, TypeId};
use std::mem;
use std::sync::Mutex;
use crate::storages::actions::{ActionDependencies, ActionIdx, ActionStorage};
use crate::storages::archetypes::{ArchetypeIdx, ArchetypeStorage, EntityLocation};
use crate::storages::components::{ComponentStorage, ComponentTypeIdx};
use crate::storages::e... |
// TODO: Insert correct position to handle error properly.
use std::collections::{HashMap, HashSet};
use super::env::TEnv;
use crate::impl_prelude::*;
use MayBeResolved::*;
pub struct AliasResolver<'a> {
env: &'a TEnv,
work_list: Vec<Symbol>,
resolves: HashMap<Symbol, MayBeResolved>,
}
impl<'a> AliasRe... |
//! A module for reading temperatue and co2 concentration from a Dostmann CO2-Sensor
extern crate hidapi;
#[derive(PartialEq, Debug)]
pub enum Reading {
/// a temperature reading in degrees of celcius
Temperature(f32),
/// a co2 concentration in parts-per-million (PPM)
CO2(u16),
}
/// Readings are en... |
use actix_files::NamedFile;
use actix_web::{get, web, App, HttpResponse};
use serde::Serialize;
use std::io::Write;
use std::sync::{Arc, Mutex};
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "sharkmon", about = "Shark 100S power meter web gateway")]
struct Opt {
#[structopt(short, long)]... |
// Copyright 2021 PolyCrypt GmbH
//
// 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... |
// Copyright 2021 <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 i... |
// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of substrate-subxt.
//
// subxt 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 optio... |
use mruby::convert::{FromMrb, RustBackedValue};
use mruby::def::{rust_data_free, ClassLike, Define, EnclosingRubyScope};
use mruby::eval::MrbEval;
use mruby::extn::core::error::{RubyException, RuntimeError};
use mruby::file::MrbFile;
use mruby::load::MrbLoadSources;
use mruby::sys::{self, DescribeState};
use mruby::val... |
use crate::priv_prelude::*;
use crate::util;
struct InTransit<T> {
packet: Option<T>,
timeout: Delay,
}
impl<T> Future for InTransit<T> {
type Item = T;
type Error = Void;
fn poll(&mut self) -> Result<Async<T>, Void> {
match self.timeout.poll().void_unwrap() {
Async::Ready(())... |
use sp_runtime::{
RuntimeDebug,
// traits::{
// AtLeast32BitUnsigned, Zero, StaticLookup, Saturating, CheckedSub, CheckedAdd,
// }
};
use sp_std::prelude::*;
use codec::{Encode, Decode};
// Asset 的组合特性
#[derive(Encode, Decode, Clone, Eq, PartialEq, RuntimeDebug)]
pub enum FeatureHue {
Green,
Yellow,
White,
Bl... |
use std::collections::{btree_map::BTreeMap, HashMap};
use std::fmt::Debug;
use std::hash::Hash;
pub fn convert_graph<T: Hash + Clone + Eq + Debug>(
adjacency_list: &HashMap<T, Vec<T>>,
) -> (HashMap<usize, T>, BTreeMap<usize, Vec<usize>>) {
let mut node_to_index = HashMap::new();
let mut new_adj_list = BTr... |
use std::future::{Future};
use std::pin::{Pin};
use std::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};
use log;
use windows::core::{
HSTRING,
PCWSTR,
};
/* required feature "Win32_Foundation" */
use windows::Win32::Foundation::{
HWND,
WPARAM, LPARAM, LRESULT,
GetLastError... |
//
// Copyright 2018-2019 <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 w... |
use std::ffi::OsStr;
#[cfg(not(any(target_os = "windows", target_arch = "wasm32")))]
use std::os::unix::ffi::OsStrExt;
#[cfg(any(target_os = "windows", target_arch = "wasm32"))]
use INVALID_UTF8;
#[cfg(any(target_os = "windows", target_arch = "wasm32"))]
pub trait OsStrExt3 {
fn from_bytes(b: &[u8]) -> &Self;
... |
use {VRDisplay, VRDisplayData, VRFramebuffer, VRFramebufferAttributes, VRFrameData, VRStageParameters, VRLayer, VRViewport};
use rust_webvr_api::utils;
use std::sync::Arc;
use std::cell::RefCell;
pub type MockVRDisplayPtr = Arc<RefCell<MockVRDisplay>>;
use std::time::Duration;
use std::thread;
pub struct MockVRDisplay... |
use crate::{error::PerpError, processor::MAX_OPEN_POSITONS_PER_USER, state::PositionType};
use borsh::{BorshDeserialize, BorshSerialize};
use solana_program::{
entrypoint::ProgramResult,
msg,
program_error::ProgramError,
program_pack::{Pack, Sealed},
};
use super::StateObject;
// Pubkeys are stored as... |
use crate::FractalCoreError;
use ::fractal_protocol::{model::{FractalModel}};
use midir::{MidiInput, MidiOutput, Ignore, MidiInputConnection, MidiOutputConnection};
use log::{error, trace};
use super::{TransportMessage, Transport, TransportConnection};
use crossbeam_channel::Receiver;
pub struct Midi {
client_nam... |
// Copyright (c) 2019 <NAME>, RWTH Aachen University
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed exc... |
//! ## Demo
//!
//! `Demo` shows how to use tui-realm in a real case
/**
* MIT License
*
* tui-realm - Copyright (C) 2021 <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 with... |
use lorri::cli::{Arguments, Command, Internal_};
use lorri::constants;
use lorri::locate_file;
use lorri::logging;
use lorri::ops::error::{ExitError, OpResult};
use lorri::ops::{
daemon, direnv, info, init, ping, shell, start_user_shell, stream_events, upgrade, watch,
};
use lorri::project::Project;
use lorri::NixF... |
/*
* Metal API
*
* This is the API for Equinix Metal Product. Interact with your devices, user account, and projects.
*
* The version of the OpenAPI document: 1.0.0
* Contact: <EMAIL>
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Devi... |
use casperlabs_engine_test_support::{Code, Hash, SessionBuilder, TestContext, TestContextBuilder};
use casperlabs_types::{
account::AccountHash, bytesrepr::FromBytes, runtime_args, CLTyped, RuntimeArgs, U512,
};
const VESTING_WASM: &str = "contract.wasm";
pub mod account {
use super::AccountHash;
pub cons... |
//! Memory usage tracking for Bevy's [`Mesh`] type.
//!
//! The behavior can be customized using the [`MemoryConfig`].
use bevy::{
app::Plugin,
render::mesh::{Mesh, VertexAttributeValues},
utils::HashSet,
};
use crate::{
app_ext::RegisterTypesWithEstimator,
estimator::{FromConfig, ZeroEstimator},
... |
extern crate cpp_synmap;
extern crate cpp_syn;
#[macro_use]
extern crate quote;
extern crate serde;
#[macro_use]
extern crate serde_derive;
use cpp_synmap::SourceMap;
use cpp_syn::{TokenTree, Delimited, DelimToken, Token, Span, BinOpToken};
use std::iter::Peekable;
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Or... |
use format::Format;
use reqwest::{self, Client, StatusCode};
use std::collections::HashMap;
use std::error::Error;
use serde::{Serialize, Deserialize};
use url::percent_encoding::percent_decode;
use url::{form_urlencoded, Url};
use simple_error::SimpleError;
const YOUTUBE_VIDEO_INFO_URL: &str = "https://www.youtube.c... |
//
// Copyright 2021 <NAME>. 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 required by applicable... |
mod leo;
// Note: this requires the `derive` feature
use aleo_maci_libs::{
aleo_account::account_utils, fr_helpers::converter::*, merkle_tree::MerkleTree, rcp,
transactions,
};
use clap::{Parser, Subcommand};
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
use snarkvm::{
dpc::testnet2::... |
use jack;
use clap;
use termion;
use ringbuf;
use termion::raw::IntoRawMode;
use termion::event::Key;
use termion::input::TermRead;
use std::io::{Write, stdin, stdout};
#[derive(Debug)]
enum Message {
Merge(usize, usize),
Split(usize, usize)
}
struct Split {
selected: usize,
in_port: jack::Port<jack::MidiIn>,
ou... |
use std::time::Duration;
mod connection;
mod db_connection;
#[cfg(feature = "mock")]
mod mock;
mod statement;
mod stream;
mod transaction;
pub use connection::*;
pub use db_connection::*;
#[cfg(feature = "mock")]
pub use mock::*;
pub use statement::*;
pub use stream::*;
use tracing::instrument;
pub use transaction::*... |
#![allow(non_snake_case)]
use marine_rs_sdk::marine;
pub(crate) type Sqlite3DbHandle = u32;
pub(crate) type Sqlite3StmtHandle = u32;
#[marine]
#[derive(Clone, Debug)]
pub struct DBOpenDescriptor {
pub ret_code: i32,
pub db_handle: u32,
}
#[marine]
#[derive(Clone, Debug)]
pub struct DBPrepareDescriptor {
... |
use crossbeam_channel::Sender;
use std::fmt::Display;
use pueue_lib::network::message::*;
use pueue_lib::state::SharedState;
use crate::network::response_helper::*;
mod add;
mod clean;
mod edit;
mod enqueue;
mod group;
mod kill;
mod log;
mod parallel;
mod pause;
mod remove;
mod restart;
mod send;
mod start;
mod stas... |
use crate::physics::RapierConfiguration;
use crate::rapier::geometry::ColliderShape;
use crate::render::ColliderDebugRender;
use bevy::prelude::*;
use bevy::render::mesh::{Indices, VertexAttributeValues};
use rapier::geometry::ShapeType;
/// System responsible for attaching a PbrBundle to each entity having a collider... |
/*
API module to make http requests to the ElectrumX Server.
A custom server can be specified or a default one will be used. (blockstream)
Public electrum servers sourced from https://1209k.com/bitcoin-eye/ele.php?chain=btc
Todo:
- TOR configuration
> Figure out how to install and ... |
use super::*;
use bitcoin::network::message_network::VersionMessage;
use bitcoin::network::Address;
use std::collections::HashMap;
use nonempty::NonEmpty;
use nakamoto_chain::block::cache::BlockCache;
use nakamoto_chain::block::store;
use nakamoto_common::block::filter::{FilterHash, FilterHeader};
use nakamoto_comm... |
use rlp;
#[cfg(not(feature = "std"))]
use alloc::{vec::Vec, string::{String, ToString}};
use core::char;
const EVEN_EXTENSION_PREFIX: char = b'0' as char;
const ODD_EXTENSION_PREFIX: char = b'1' as char;
const EVEN_LEAF_PREFIX: char = b'2' as char;
const ODD_LEAF_PREFIX: char = b'3' as char;
// TODO: Do we need to c... |
use maud::{html, PreEscaped, Render};
use orgize::{
export::{DefaultHtmlHandler, HtmlEscape, HtmlHandler},
Element, Event, Org,
};
use std::cmp::min;
use std::fmt::Write;
use std::ops::Range;
use crate::utils::get_id;
use crate::Context;
pub enum Mode {
Html,
Rss,
Amp,
}
pub struct Article<'a> {
... |
use config::*;
use config::Project;
use futures::{Future, Stream};
use gitlab;
use gitlab::*;
use gitlab::Gitlab;
use hyper::{Chunk, Client, Post, Request};
use hyper_tls::HttpsConnector;
use open;
use serde_json;
use serde_json::Value;
use std::error::Error;
use std::fmt;
use std::io;
use std::result::Result;
use std:... |
//! # sso_cli
//!
//! ## Configuration
//!
//! See [Config](../sso/struct.Config.html).
//!
#[macro_use]
extern crate clap;
use clap::{App, Arg, SubCommand};
const CMD_GENERATE: &str = "generate";
const CMD_SECRET: &str = "secret";
const CMD_PASSWORD: &str = "password";
const CMD_CLIENT: &str = "client";
const CMD_US... |
/*!
* Implementation of "GenericJson" module.
*
* This module is able to download data in JSON format and save as JSON file.
* Downloaded data can be accumulated and saved as array of JSON values.
*/
use std::any::Any;
use std::collections::HashMap;
use actix::prelude::*;
use async_trait::async_trait;
use anyh... |
// https://www.instagram.com/p/B-u7RBwnQN-/
extern crate chrono;
extern crate nannou;
use nannou::color::*;
use nannou::noise::{NoiseFn, Perlin};
use nannou::prelude::*;
mod util;
use util::args::ArgParser;
use util::blob::Blob;
use util::captured_frame_path;
use util::interp::{lerp, Interp, Interpolate};
fn main() ... |
//! Protobuf files in the gravity repo, copying the result to the gravity_proto crate for import
//! and use. While this builder generates about a dozen files only one contains all the gravity
//! proto info and the rest are discarded in favor of upstream cosmos-sdk-proto
// Building new Gravity rust proto definitions... |
use std::collections::HashSet;
use std::rc::Rc;
use crate::components::{IPFSConnectionError, Loading, Navbar, Thumbnail};
use crate::utils::{IpfsService, LocalStorage};
use wasm_bindgen_futures::spawn_local;
use yew::prelude::{classes, html, Component, ComponentLink, Html, Properties, ShouldRender};
use yew::service... |
use colored::*;
use std::cmp::{max, min};
use crate::vm::ast::{Ast, IsInvalid, NodeID};
use crate::vm::token::Token;
use std::collections::HashSet;
use std::fmt::Debug;
#[derive(Debug, Clone)]
pub struct ErrPart {
details: String,
nodes: Vec<NodeID>,
}
impl ErrPart {
pub fn new(details: String, nodes: Ve... |
use super::IServiceRepo;
use crate::{
repos::shared::{
mongo_repo::{self},
query_structs::MetadataFindQuery,
},
KVMetadata,
};
use mongo_repo::MongoDocument;
use mongodb::{
bson::{doc, oid::ObjectId, Document},
Collection, Database,
};
use nettu_scheduler_domain::{Service, ServiceRes... |
//! Implementation of Parallel Prefix Sum
use timely::dataflow::Scope;
use ::{Collection, Data};
use ::lattice::Lattice;
use ::operators::*;
/// Extension trait for the prefix_sum method.
pub trait PrefixSum<G: Scope, K, D> {
/// Computes the prefix sum for each element in the collection.
///
/// The pre... |
// Copyright 2020, The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclai... |
use hacspec_lib::*;
use hacspec_p256::*;
use hacspec_sha256::*;
#[derive(Debug)]
pub enum Error {
InvalidScalar,
InvalidSignature,
}
pub type P256PublicKey = Affine;
pub type P256SecretKey = P256Scalar;
pub type P256Signature = (P256Scalar, P256Scalar); // (r, s)
pub type P256SignatureResult = Result<P256Sign... |
//! `types` module contains types necessary for Fluent runtime
//! value handling.
//! The core struct is [`FluentValue`] which is a type that can be passed
//! to the [`FluentBundle::format_pattern`](crate::bundle::FluentBundle) as an argument, it can be passed
//! to any Fluent Function, and any function may return i... |
use super::{gray_to_binary, gray_to_rgb, rgb_to_gray};
use image::{GrayImage, Luma, Rgb, RgbImage};
/// RGB threshold to convert from RGB image to binary image by high and low threshold
/// high_threshold : [r, g, b]
/// low_threshold : [r, g, b]
pub struct RGBThreshold {
pub high_threshold: Rgb<u8>,
pub lo... |
use std::{collections::BTreeMap, sync::Arc};
use bytes::Bytes;
use chrono::{TimeZone, Utc};
use futures::{channel::mpsc::Receiver, stream, StreamExt};
use hyper::StatusCode;
use indoc::indoc;
use ordered_float::NotNan;
use prost::Message;
use vector_core::event::{BatchNotifier, BatchStatus, Event};
use crate::{
c... |
use std::time::Duration;
use super::Metric;
use crate::{ensure, format_err, StatusCode};
/// Parse multiple entries from a single header.
///
/// Each entry is comma-delimited.
pub(super) fn parse_header(s: &str, entries: &mut Vec<Metric>) -> crate::Result<()> {
for part in s.trim().split(',') {
let entry... |
use serde::de;
use serde::ser;
use std::str::FromStr;
use std::{fmt, vec};
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CS<T>(pub Vec<T>);
impl<T> Default for CS<T> {
#[inline]
fn default() -> Self {
Self(Default::default())
}
}
impl<T> AsRef<[T]> for CS<T> {
#[inline]
fn as_ref(&se... |
use std::ffi::{CString, CStr};
use std::marker::PhantomData;
use std::ops::Deref;
use std::ptr;
use wayland_sys::cursor::*;
use std::os::raw::c_int;
use Proxy;
use wayland::shm::{WlShm, WlBuffer};
/// Checks if the wayland-cursor lib is available and can be used
///
/// Trying to call any function of this module if ... |
#[cfg(not(target_os = "linux"))]
compile_error!("This program only works on Linux.");
mod cli;
mod print;
mod theme;
use futures::{pin_mut, StreamExt};
use termcolor::ColorChoice;
use tokio::sync::mpsc;
use tracing::{error, info, warn, Level};
use tracing_subscriber::EnvFilter;
use watchdir::{Event, Watcher, WatcherO... |
//! Write VCD files based on pin states.
//!
//!
use crate::pins::*;
use embedded_time::duration::*;
use std::convert::TryInto;
use std::io::Result as IOResult;
use std::sync::atomic::Ordering;
use std::sync::Arc;
/// A builder for a [VcdWriter].
pub struct VcdWriterBuilder<W>
where
W: std::io::Write,
{
write... |
#![no_std]
#![no_main]
use panic_halt as _;
use core::fmt::Write;
use embedded_graphics::pixelcolor::Rgb565;
use embedded_graphics::prelude::*;
use embedded_graphics::primitive_style;
use embedded_graphics::primitives::Rectangle;
use gd32vf103xx_hal::delay::McycleDelay;
use gd32vf103xx_hal::pac;
use gd32vf103xx_hal:... |
extern crate prisma_maths;
use prisma_maths::*;
use crate::VoxelTexture;
pub struct Ray {
pub origin: Vec3,
pub direction: Vec3,
pub energy: Vec3,
}
pub struct RayHit {
pub position: Vec3,
pub distance: f32,
pub normal: Vec3,
}
impl RayHit {
pub fn new(position: Vec3, distance: f32, nor... |
//! SMT-LIB Command representation adapted from [smt2parser](https://github.com/facebookincubator/smt2utils/blob/a3f631f9ab4599e8e800ef445a1bd9d24631582e/smt2parser/src/concrete.rs).
//! If [`smt2parser::concrete::Command`] could be made generic, this file wouldn't have to exist;
//! this change is requested in [smt2ut... |
//! Returns a list of scheduled messages.
use crate::error::Error;
use crate::http_client::{get_slack_url, ResponseMetadata, SlackWebAPIClient};
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;
#[skip_serializing_none]
#[derive(Deserialize, Serialize, Debug, Default, PartialEq)]
pub struc... |
use std::fmt;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use crate::errors::Result;
use crate::indicators::{AverageTrueRange, Maximum, Minimum};
use crate::{Close, High, Low, Next, Period, Reset};
/// Chandelier Exit (CE).
///
/// Developed by <NAME> and featured in <NAME>'s books, the Chandelier... |
use web_sys::KeyboardEvent;
use yew::{
format::Nothing,
services::{
fetch::{FetchTask, Request, Response},
keyboard::{KeyListenerHandle, KeyboardService},
ConsoleService, FetchService,
},
};
use yew::{html, Component, ComponentLink, Html, Properties, ShouldRender};
use yew_router::{a... |
use clap::*;
use log::{info, warn};
use simplelog::*;
use std::fs::File;
use std::io;
// Create clap subcommand arguments
pub fn make_subcommand<'a>() -> Command<'a> {
Command::new("download")
.about("Download the latest release of `taxdump`")
.after_help(
r###"
You can download the fil... |
extern crate websocket;
use self::websocket::stream::async::Stream as WsStream;
use self::websocket::OwnedMessage;
use futures;
use futures::sink::Sink;
use futures::stream::Stream;
use std;
use std::io::Result as IoResult;
use std::io::{Read, Write};
use tokio_io::{self, AsyncRead, AsyncWrite};
use std::cell::RefCel... |
use super::*;
/// Launchpad's implement this trait to signify how they can be used as a [`Canvas`]. Based on this
/// specification, [`DeviceCanvas`] provides a generic [`Canvas`] implemention that can be used for
/// all devices.
///
/// You as a user of this library will not need to use this trait directly.
pub trai... |
use crate::{AcpiError, AcpiHandler};
use core::{fmt, mem, mem::MaybeUninit, str};
pub const ACPI_VERSION_2_0: u8 = 20;
/// Represents a field which may or may not be present within an ACPI structure, depending on the version of ACPI
/// that a system supports. If the field is not present, it is not safe to treat the ... |
use hardware::Hardware;
use mem::{Addr, Direction};
use moxie_dom::{
elements::{button, div, span, table, tbody, td, th, thead, tr},
prelude::*,
};
use std::cell::RefCell;
use std::rc::Rc;
use web_utils::log;
const ROWS: u16 = 16;
const COLS: u16 = 16;
#[derive(Debug, PartialEq, PartialOrd)]
pub struct Cursor... |
use std::convert::From;
use std::error::Error;
use std::fs::{self, File};
use std::io::{self, BufRead, BufReader};
use std::mem;
use std::path::Path;
use byteorder::{NativeEndian as NE, ReadBytesExt, WriteBytesExt};
use encoding_rs::*;
use crate::dictionary::build::*;
use crate::Utf16Char;
pub trait InputUtil: io::R... |
//! The certification public interface.
use crate::{
consensus_pool::ConsensusPoolCache,
validation::{ValidationError, ValidationResult},
};
use ic_types::artifact::{CertificationMessageAttribute, CertificationMessageId};
use ic_types::{
artifact::{CertificationMessageFilter, PriorityFn},
consensus::cer... |
use crate::{
anon::Anon,
embed_error::EmbedError,
name::Name,
package::{
import_alias,
Entry,
Import,
},
position::Pos,
term::Term,
};
use sp_cid::Cid;
use sp_std::{
fmt,
vec::Vec,
rc::Rc,
collections::btree_map::BTreeMap,
};
use alloc::{
string::{String, ToString},
};
#[derive(C... |
use aorist_primitives::Dialect;
use crate::flow::etl_flow::ETLFlow;
use crate::flow::flow_builder::FlowBuilderBase;
use crate::flow::python_based_flow::PythonBasedFlow;
use crate::flow::python_based_flow_builder::PythonBasedFlowBuilder;
use crate::python::{
BashPythonTask, ConstantPythonTask, NativePythonTask, Pres... |
use crate::context::*;
use crate::markup::*;
use crate::position::*;
use crate::types::*;
use crate::util::*;
use indoc::formatdoc;
use itertools::Itertools;
use lsp_types::request::*;
use lsp_types::*;
use regex::Regex;
use serde::Deserialize;
use url::Url;
pub fn text_document_completion(meta: EditorMeta, params: Ed... |
use std::{collections::BTreeSet, sync::Arc};
use super::{intersection::Intersection, IntersectionState, PointLight, Ray, Shape, Sphere};
use crate::{
lang::math::sqrt,
lang::ApproximateFloat64Ops,
math::{Matrix, Tuple},
properties::{Color, FlatPattern, Material, COLOR_BLACK, COLOR_WHITE},
};
pub struc... |
use darling::{FromDeriveInput, FromField, FromVariant};
use proc_macro2::{Span, TokenStream};
use quote::quote;
use syn::{parse_quote, Data, DataEnum, DataStruct, DeriveInput, Error, Fields, Type};
use crate::bound;
use crate::common::*;
use crate::DeriveResult;
pub fn derive(input: DeriveInput) -> DeriveResult<Token... |
use downcast_rs::{impl_downcast, Downcast};
use std::{
collections::{hash_map::Entry, HashMap},
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
};
use crate::{JobHandlerRw, JobHandlerTrait, JobId, System, SystemId, SystemRunner};
pub trait Phase: Downcast + Send + Sync {
fn get_name(&... |
//! Builder describing multiple interacting state machines
//!
//! You must define a [`StateMachines`] and use [`StateMachines::build`] to get a
//! runnable [`crate::StateMachines`].
//!
//! In order for [`crate::Transition`] impls to be able to return
//! [`crate::Target`], that cannot be constructed due to the argum... |
use crate::error::ParseError;
use crate::ident::{Ident, IdentPath};
use crate::span::{CodeFragmentId, Span};
use crate::token::{Token, TokenWithSpan};
use std::iter::Cloned;
use std::slice::Iter;
pub(crate) trait DeTokParser {
fn end(&self) -> usize;
fn token_end(&self) -> usize;
fn peek_span(&self) -> Spa... |
use crate::client::Client;
use anyhow::{anyhow, bail, Result};
use async_trait::async_trait;
use hex::FromHex;
use jsonrpc_core::types::{Params, Value};
use jsonrpc_core_client::transports::http;
use jsonrpc_core_client::RawClient;
use log::trace;
use realtps_common::{chain::Chain, db::Block};
use sp_storage::StorageKe... |
use super::GameboyType;
use std::fmt;
use std::fmt::Debug;
use std::default::Default;
#[derive(Copy, Clone)]
pub enum Reg8 {
A,
F,
B,
C,
D,
E,
H,
L,
}
#[derive(Copy, Clone)]
pub enum Reg16 {
AF,
BC,
DE,
HL,
SP,
}
pub struct Registers {
pub a: u8,
pub b: u8,... |
//! the solve mod of sudoku
//! have solve and unique function
//!
//! solve
//! ```
//! use sudoku_rs::{board, solver};
//!
//! let mut b = board::Board::new();
//! let s = solver::DfsSolver::new();
//! s.solve(&mut b);
//! println!("{}", b);
//! ```
//!
//! unique check
//! ```
//! use sudoku_rs::{board::Board, solve... |
use futures::{Future, IntoFuture};
use futures::future;
use serde_json;
use std::collections::HashMap;
use std::fs;
use std::fs::{File, OpenOptions};
use std::io;
use std::io::Write;
use std::path::Path;
use std::path::PathBuf;
use u2f_core::{AppId, ApplicationKey, Counter, KeyHandle, SecretStore};
macro_rules! tryf ... |
use crate::*;
use serde::{Deserialize, Serialize};
pub type AccountId = String;
pub type NearSocialAccountId = u64;
/*
"id":107916959145894674,
"username":"nate",
"domain":null,
"created_at":"2022-03-07T19:41:55.929584",
"note":"",
"display_name":"nategeier",
"avatar_file_name":"d1cd99c5c40bc501.jpeg",
"avatar_conten... |
//! TODO: Remove this rebar3 support
mod manifest;
mod source_tree;
#[cfg(test)]
mod tests;
use crate::{
ast::{self, SrcSpan, Statement, TypedModule},
build::{Origin, Target},
parse::extra::{Comment, ModuleExtra},
type_,
uid::UniqueIdGenerator,
Error, Result, Warning,
};
use source_tree::Sourc... |
//! Implementation of circle shape.
use std::f64::consts::{FRAC_PI_2, PI};
use std::ops::{Add, Sub};
use crate::{PathEl, Point, Rect, Shape, Vec2};
/// A circle.
#[derive(Clone, Copy, Default, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Circle {
/// ... |
use std::fmt;
use failure::Backtrace;
use failure::Context;
use failure::Fail;
use replicante_models_core::agent::AgentStatus;
use replicante_util_failure::format_fail;
/// Dumb wrapper to carry `anyhow::Error`s as `failure::Fail`s.
pub struct AnyWrap(anyhow::Error);
impl From<anyhow::Error> for AnyWrap {
fn fr... |
use handlebars::Handlebars;
use serde::Serializer;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use std::{
cmp,
cmp::{Eq, PartialEq},
collections::{hash_map::RandomState, HashMap},
error::Error,
fmt::Debug,
fs,
fs::{DirBuilder, File},
hash::{BuildHasher, Hash},
io::Write,
path::{Path, PathBuf, M... |
use crate::{crypto::{keys::NamedRevision,
SECRET_SYM_KEY_VERSION},
error::{Error,
Result},
fs::Permissions};
/// Private module to re-export the various sodiumoxide concepts we
/// use, to keep them all consolidated and abstracted.
mod primitives {
p... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
extern crate wasm_bindgen;
extern crate web_sys;
mod utils;
mod universe;
use utils::*;
use universe::*;
use std::rc::Rc;
use std::cell::RefCell;
use wasm_bindgen::JsCast;
use wasm_bindgen::prelude::*;
struct Fps {
frames: Vec<f64>,
last_frame_time_stamp: f64,
}
impl Fps {
pub fn new() -> Fps {
... |
#[macro_use]
extern crate gfx;
extern crate gfx_support;
extern crate image;
use std::io::Cursor;
use std::time::Instant;
use gfx::format::Rgba8;
use gfx_support::{BackbufferView, ColorFormat};
use gfx::{Bundle, GraphicsPoolExt};
gfx_defines!{
vertex Vertex {
pos: [f32; 2] = "a_Pos",
uv: [f32; 2] ... |
use std::{
fmt,
sync::{
atomic::{AtomicU64, AtomicUsize, Ordering},
Arc,
},
};
use bytes::BytesMut;
use leveldb::database::{
batch::{Batch, Writebatch},
options::WriteOptions,
Database,
};
use tokio::sync::Notify;
use super::Key;
use crate::{buffer_usage_data::BufferUsageHandle... |
use legion::{Resources, World, systems::Runnable};
use crate::{
BuildContext, FeatureFlags, codegen, compile,
hooks::{Continuation, Ctx, Hooks},
lowering, parse, type_check,
};
/// Execute the `rune build` process.
pub fn build(ctx: BuildContext) -> (World, Resources) {
struct NopHooks;
impl Hooks ... |
//! Crate to open Vdfs Files and access the different entries.
//!
//! The given example loads a wave audio file out of an archive.
//! ```rust
//! use std::{fs::File, io::Write};
//! use zen_archive::Vdfs;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let vdf_file = File::open("/home/tom/Steam/co... |
use crate::mem::Box;
use crate::LvResult;
use core::mem::MaybeUninit;
use embedded_graphics::geometry::Point;
#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
pub enum InputData {
Touch(Point),
Key(u32),
}
impl InputData {
pub fn released(self) -> InputState {
InputState::Released(sel... |
use super::header_view::HeaderView;
use ckb_core::block::Block;
use ckb_core::header::Header;
use ckb_network::PeerIndex;
use ckb_shared::shared::TipHeader;
use ckb_time::now_ms;
use ckb_util::RwLock;
use fnv::{FnvHashMap, FnvHashSet};
use log::debug;
use numext_fixed_hash::H256;
// const BANSCORE: u32 = 100;
#[deriv... |
// Copyright 2021 PolyCrypt GmbH
//
// 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::internal_prelude::*;
use core::fmt;
/// A target for [`ioprio_get()`] and [`ioprio_set()`] to operate on.
#[cfg_attr(docsrs, doc(cfg(any(target_os = "linux", target_os = "android"))))]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
pub enum IoprioWho {
/// Operate on the process/thread with the spe... |
use std::cell::Cell;
use std::fmt;
use std::io;
use std::mem;
use std::ptr;
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use futures::stream::Stream;
use futures::Poll;
use sys::{self, Awakener};
use sync::err::{SendError, TrySendError};
#[cfg_attr(nightly, repr(align(64)))]
#[derive(Debug)]
s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.