text stringlengths 3.35k 22.8k |
|---|
#[macro_use] extern crate failure;
#[macro_use] extern crate failure_derive;
#[macro_use] extern crate log;
#[macro_use] extern crate human_panic;
#[macro_use] extern crate serde_derive;
#[cfg(feature = "tantivy_bindings")]
extern crate tantivy;
pub mod bindings;
pub mod logger;
pub mod conf;
pub mod error;
use actix... |
use super::*;
use std::ops::Range;
impl<'a> IntoIterator for &'a RsDict {
type Item = u64;
type IntoIter = RsDictIterator<'a>;
fn into_iter(self) -> Self::IntoIter {
RsDictIterator::new(self)
}
}
impl<'a> RsDict {
/// Return an iterator over all the indices of the bits set to one
/// ... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use fidl_fuchsia_input;
use fidl_fuchsia_ui_input2::Key;
/// Standard [USB HID] usages.
///
/// [USB HID]: https://www.usb.org/sites/default/files/documen... |
//! Structs for handling YubiKeys.
use age_core::{
format::{FileKey, FILE_KEY_BYTES},
primitives::{aead_decrypt, hkdf},
};
use age_plugin::{identity, Callbacks};
use bech32::{ToBase32, Variant};
use dialoguer::Password;
use log::warn;
use secrecy::ExposeSecret;
use std::convert::TryInto;
use std::fmt;
use std:... |
/// A type-safe representation of possible errors
#[derive(Debug)]
pub enum NativeError {
NoError = 0,
InvalidThread = 10,
InvalidThreadGroup = 11,
InvalidPriority = 12,
ThreadNotSuspended = 13,
ThreadSuspended = 14,
ThreadNotAlive = 15,
InvalidObject = 20,
InvalidClass = 21,
Cla... |
use gtk::glib;
use gtk::prelude::*;
use gtk::subclass::prelude::*;
pub enum SearchOp {
Update,
Exec,
}
glib::wrapper! {
pub struct Titlebar(ObjectSubclass<imp::Titlebar>)
@extends gtk::Widget, gtk::HeaderBar,
@implements gtk::Accessible;
}
impl Titlebar {
pub fn new() -> Self {
... |
pub struct GlfwContext {
pub title_fin: String,
pub title_dyn: String,
pub glfw: glfw::Glfw,
pub window: glfw::Window,
pub events: std::sync::mpsc::Receiver<(f64, glfw::WindowEvent)>,
pub gl: gl::Gl,
pub gl_info: GlInfo,
}
impl GlfwContext {
pub fn new() -> Self {
let mut glfw = glfw::init(glfw::FA... |
use super::*;
#[derive(Debug, Serialize, Deserialize, Clone, Hash, PartialEq, Eq, Copy)]
pub struct Id(usize);
impl Id {
pub fn raw(&self) -> usize {
self.0
}
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct IdGen {
next_id: usize,
}
impl IdGen {
pub fn new() -> Self {
Se... |
use std::cell::{Cell, RefCell};
use std::rc::Rc;
use std::collections::BTreeMap;
use dces::{Entity, World};
use application::{Application, Tree};
use backend::{target_backend, BackendRunner};
use event::EventHandler;
use layout_object::{RootLayoutObject, LayoutObject};
use render_object::RenderObject;
use properties... |
// Copyright 2020 Shift Cryptosecurity AG
//
// 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 ... |
//! Store data in a task-centric store to share with the C layers
//!
//! The workspace is a memory allocator with a simple API that allows Varnish to store data that
//! needs only to live for the lifetime of a task (handling a client or backend request for example).
//! At the end of the task, the workspace is wiped,... |
#[cfg(feature = "std")]
extern crate std;
use std::{
io::Read,
iter::Peekable,
num::NonZeroU8,
str::FromStr,
vec::Vec
};
use crate::qmap;
use qmap::repr::{
Alignment, BaseAlignment, Brush, Edict, Entity, Point, QuakeMap,
Surface,
};
use qmap::lexer::{Token, TokenIterator};
type TokenPeeka... |
use std::{
convert::{Infallible, TryFrom, TryInto},
fmt::Display,
ptr::null_mut,
};
use utfx::U16CString;
use winapi::shared::minwindef::HKEY;
use winapi::um::winreg::{RegDeleteValueW, RegQueryValueExW, RegSetValueExW};
use crate::util::U16AlignedU8Vec;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive... |
use bio::io::fasta;
use extract_fragments::*;
use realignment::*;
use rust_htslib::bam;
use rust_htslib::bam::record::CigarStringView;
use rust_htslib::bam::record::Record;
use rust_htslib::bam::Read;
use util::*;
use variants_and_fragments::*;
static IGNORE_INDEL_ONLY_CLUSTERS: bool = false;
//**********************... |
use crate::{ast::Constant, tables::{PPL_TRUE, PPL_FALSE}};
#[derive(Debug, PartialEq, Clone)]
pub enum Token {
Eol,
Const(Constant),
Identifier(String),
LPar,
RPar,
Comma,
Colon,
PoW,
Mul,
Div,
Mod,
Add,
Sub,
Eq,
NotEq,
Lower,
LowerEq,
Greater,
... |
use crate::connection;
use crate::metrics::time_to_first_position;
use anyhow::Context;
use anyhow::Result;
use async_trait::async_trait;
use daemon::command;
use daemon::db;
use daemon::process_manager;
use daemon::setup_contract;
use daemon::wallet;
use daemon::wire;
use futures::channel::mpsc;
use futures::channel::... |
// 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 memflow::cglue;
use memflow::os::process::*;
use memflow::prelude::v1::*;
use memflow::types::util::GapRemover;
use super::{conv_err, ProcessVirtualMemory};
use windows::Win32::Foundation::{HINSTANCE, PSTR};
use windows::Win32::System::ProcessStatus::{
K32EnumProcessModulesEx, K32GetModuleFileNameExA, K32GetM... |
use std::cmp::max;
use std::collections::HashMap;
use std::net::SocketAddr;
use std::path::PathBuf;
use std::sync::mpsc::Receiver;
use std::sync::{Arc, RwLock};
use std::thread;
use protobuf::repeated::RepeatedField;
use rand::random;
use cerberus_proto::filesystem as pb;
use distributed_filesystem::{FileChunk, FileS... |
use crate::*;
use core::cell::Cell;
use std::collections::hash_map::HashMap;
// Bruh wtf do i do
//
// Block stack-ly resets register numbers after every statement
#[derive(Debug, Clone, Copy)]
pub struct Value {
pub op: Operand,
pub ty: Type,
}
impl Value {
pub fn new(op: Operand, ty: Type) -> Value {
... |
//! High-level layer for making http(s) requests the Tor network as a client.
//!
//! This can be used by applications which embed Arti,
//! and could also be used as an example of how to build on top of [`arti_client`].
//!
//! There is an example program [`hyper.rs`] which uses `arti-hyper`
//! to connect to Tor and ... |
//! Write payload abstractions derived from [`MutableBatch`]
use crate::column::ColumnData;
use crate::{MutableBatch, Result};
use data_types::database_rules::PartitionTemplate;
use data_types::partition_metadata::{StatValues, Statistics};
use data_types::sequence::Sequence;
use hashbrown::HashMap;
use schema::TIME_CO... |
use crate::context::{Data, ResolveId};
use crate::error::ParseRequestError;
use crate::mutation_resolver::do_mutation_resolve;
use crate::registry::CacheControl;
use crate::validation::{check_rules, CheckResult};
use crate::{do_resolve, ContextBase, Error, Result, Schema};
use crate::{ObjectType, QueryError, Variables}... |
use libc::{c_int, size_t};
use std::ffi::CString;
use std::marker;
use std::path::Path;
use std::str;
use std::sync::Arc;
use util::{self, Binding};
use {raw, CheckResult, Error, KnownHostFileKind, SessionInner};
/// A set of known hosts which can be used to verify the identity of a remote
/// server.
///
/// # Examp... |
//! Macro to generate completion-based async functions and blocks. This crate shouldn't be used
//! directly, instead use `completion`.
use proc_macro::TokenStream as TokenStream1;
use proc_macro2::{Group, Literal, Punct, Span, TokenStream, TokenTree};
use quote::{quote, quote_spanned, ToTokens, TokenStreamExt};
use s... |
// Copyright (c) 2021 Alibaba Cloud
//
// SPDX-License-Identifier: Apache-2.0
//
use std::env;
use std::fs;
use std::path::Path;
use std::process::{Command, ExitStatus};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use anyhow::{anyhow, ensure, Result};
use async_trait::async_trait;
use protocols... |
extern crate glam;
extern crate noise;
extern crate pyo3;
extern crate rand;
extern crate rand_xoshiro;
#[macro_use]
mod utility;
mod generation;
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::{fs, io};
use glam::{IVec2, IVec3, Vec3Swizzles};
use pyo3::... |
use crate::{
error::ObsError,
hook_info::{
HookInfo, SharedTextureData, EVENT_CAPTURE_RESTART, EVENT_CAPTURE_STOP, EVENT_HOOK_EXIT, EVENT_HOOK_INIT,
EVENT_HOOK_READY, PIPE_NAME, SHMEM_HOOK_INFO, SHMEM_TEXTURE, WINDOW_HOOK_KEEPALIVE,
},
utils::{color::BGRA8, d3d11, event::Event, file_mapp... |
extern crate reqwest;
use serde::{Serialize, Deserialize};
use serde_json::json;
use anyhow::Result;
use crate::output::Rezzy;
static GETH_GIT: &str = "https://api.github.com/repos/ethereum/go-ethereum/releases/latest";
static BESU_GIT: &str = "https://api.github.com/repos/hyperledger/besu/releases/latest";
static NET... |
use anyhow::{anyhow, Result};
use std::collections::HashMap;
use std::convert::TryInto;
use std::fs::read_to_string;
use std::path::Path;
#[derive(Debug)]
pub enum Mode {
Pos,
Immediate,
Relative,
}
#[derive(Debug, PartialEq, Eq)]
pub enum State {
Input(PausedInterpreterInput),
Output(PausedInterp... |
use config::Config;
use crates::{Crate, GitHubRepo};
use errors::*;
use ex;
use file;
use handlebars::Handlebars;
use mime::{self, Mime};
use results::{CrateResultWriter, ExperimentResultDB, FileDB, TestResult};
use serde_json;
use std::{fs, io};
use std::borrow::Cow;
use std::collections::HashMap;
use std::convert::As... |
//! Low level operations on vectors and matrices.
/// Result of a partial ordering.
#[deriving(Eq, PartialEq, Encodable, Decodable, Clone, Show)]
pub enum PartialOrdering {
/// Result of a strict comparison.
PartialLess,
/// Equality relationship.
PartialEqual,
/// Result of a strict comparison.
... |
// TODO: understand this, but it's a fucking genious idea.
// the vertex shader becomes more complicated though, it needs some
// benchmarking
// https://ourmachinery.com/post/ui-rendering-using-primitive-buffers/
// TODO: finish
// * we need LCD filtering, either font-kit merges a patch quickly or I'll fork it
// * ... |
// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.Status
/// Status is a return value for calls that don't return other objects.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Status {
/// Suggested HTTP return code for this status, 0 if not set.
pub code: Option<i32>,
/// Extended... |
use std::cell::Cell;
use std::convert::TryInto;
use std::ptr::NonNull;
use std::{
io,
ptr,
};
use winapi::shared::minwindef::{
HIWORD,
LOWORD,
LPARAM,
LRESULT,
UINT,
WPARAM,
};
use winapi::shared::windef::HWND;
use winapi::um::shellapi::{
NIN_KEYSELECT,
NIN_SELECT,
};
use winapi... |
use rand::{seq::IteratorRandom, thread_rng};
use rspotify::model::Id;
use std::fmt;
use std::sync::{Arc, RwLock};
use chrono::{DateTime, Utc};
use log::debug;
use rspotify::model::album::{FullAlbum, SavedAlbum, SimplifiedAlbum};
use crate::library::Library;
use crate::model::artist::Artist;
use crate::model::playable... |
//! Tasks related code.
use crate::{
config::Config, error::Error, filter::TaskDescriptionFilter, metadata::Metadata,
metadata::Priority,
};
use chrono::{DateTime, Duration, Utc};
use serde::{Deserialize, Serialize};
use serde_json as json;
use std::{cmp::Reverse, collections::HashMap, fmt, fs, str::FromStr};
use ... |
//! `CmpLog` logs and reports back values touched during fuzzing.
//! The values will then be used in subsequent mutations.
//!
use core::fmt::{self, Debug, Formatter};
use libafl::{
bolts::{ownedref::OwnedRefMut, tuples::Named},
observers::{CmpMap, CmpObserver, CmpValues, Observer},
state::HasMetadata,
... |
mod calculator;
use self::calculator::Calculator;
use crate::{config::Config, error, item};
use lazy_static::lazy_static;
use log::debug;
use regex::Regex;
use std::{
fs::File,
io::{self, BufRead},
};
const STR: &str = "str";
const ISIZE: &str = "isize";
const F64: &str = "f64";
const NOOP: &str = "noop";
con... |
use std::cell::Cell;
use std::fmt;
use std::marker::PhantomData;
use std::ptr::NonNull;
use std::sync::atomic;
use std::sync::atomic::AtomicPtr;
use std::sync::{self, Arc};
// To make [`WriteHandle`] and friends work.
#[cfg(doc)]
use crate::WriteHandle;
mod guard;
pub use guard::ReadGuard;
mod factory;
pub use facto... |
//!
//! Rust Firebird Client
//!
//! Representation of a fetched row
//!
use rsfbclient_core::{Charset, Column, FbError, SqlType};
use std::{mem, result::Result};
use crate::{ibase, ibase::IBase, status::Status, varchar::Varchar};
use ColumnBufferData::*;
#[derive(Debug)]
/// Types supported by the crate
pub enum C... |
/*
* Copyright 2018 Bitwise IO, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
//! Manages the spawning of tasks which process the various work queues in
//! the system, as well as notifying subsequent queue processors to pick up the
//! work that was left off.
//!
//! The following table lays out the queues and the workflows that consume them,
//! as well as the follow-up workflows. A "source" q... |
extern crate nalgebra as na;
use na::{Isometry3, Point3, RealField, Vector3};
use ncollide3d::shape::{Cuboid, ShapeHandle};
use nphysics3d::force_generator::DefaultForceGeneratorSet;
use nphysics3d::joint::DefaultJointConstraintSet;
use nphysics3d::joint::{
BallJoint, FixedJoint, HelicalJoint, PinSlotJoint, Planar... |
#![feature(use_extern_macros)]
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate wasm_bindgen;
extern crate reproto_ast as ast;
extern crate reproto_backend_csharp as csharp;
extern crate reproto_backend_go as go;
extern crate reproto_backend_java as java;
extern crate reproto_backend_js as js;... |
// Copyright Materialize, Inc. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License... |
use anyhow::{Context, Result};
use serde::de::DeserializeOwned;
use std::convert::TryFrom;
use std::io::{ErrorKind, Read, Write};
use std::mem::size_of;
use std::net::TcpStream;
#[derive(Debug)]
pub enum ConnectionError {
HelloFailed(&'static str),
}
impl std::fmt::Display for ConnectionError {
fn ... |
#[macro_use]
extern crate simple_error;
use crate::cli::{parse_args, Method};
use crate::errors::{print_error, AnyErr, ErrorWithHint};
use crate::util::{have_command, sd_booted};
use log::{debug, info, warn};
use posix_acl::{PosixACL, Qualifier, ACL_EXECUTE, ACL_READ, ACL_RWX};
use simple_error::SimpleError;
use std::... |
use crate::{Graph, Vertex, algorithms};
use crate::algorithms::{VisitorDFS, VisitorDFSAction, dfs_with_visitor};
use crate::error::{GraphError, ErrorKind};
struct CustomVisitor {
orders: Vec<usize>
}
impl<T> VisitorDFS<T> for CustomVisitor {
fn entry_to_vertex_event(&mut self, vertex: &Vertex<T>) -> Result<V... |
// Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0
use crate::{
backend::k8s::node::K8sNode, create_k8s_client, query_sequence_numbers, remove_helm_release,
set_validator_image_tag, ChainInfo, FullNode, Node, Result, Swarm, Validator, Version,
};
use anyhow::{anyhow, bail, format_err};
use aptos_con... |
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Tetcoin.
// Tetcoin 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 later ... |
use embedded_hal_mock::i2c::{Mock as I2cMock, Transaction as I2cTrans};
use mma8x5x::{ic, mode, Mma8x5x, SlaveAddr};
#[allow(unused)]
pub const ADDRESS: u8 = 0x1D;
pub struct Register {}
#[allow(unused)]
impl Register {
pub const STATUS: u8 = 0x00;
pub const OUT_X_H: u8 = 0x01;
pub const SYSMOD: u8 = 0x0B... |
use crate::context::AutocompleteContext;
use crate::{
argument::CommandArgument,
builder::{FrameworkBuilder, WrappedClient},
command::{Command, CommandMap},
context::SlashContext,
group::{GroupParent, ParentGroupMap, ParentType},
hook::{AfterHook, BeforeHook},
twilight_exports::{
App... |
use anyhow::{anyhow, Result};
use glib::{object_subclass, wrapper};
use gtk::{prelude::*, subclass::prelude::*};
use std::cell::RefCell;
use crate::error_handling_ctx;
wrapper! {
pub struct CircProg(ObjectSubclass<CircProgPriv>)
@extends gtk::Bin, gtk::Container, gtk::Widget;
}
pub struct CircProgPriv {
... |
//! Mock file for eth-backing.
use std::cell::RefCell;
use frame_support::{impl_outer_origin, parameter_types, weights::Weight};
use hex_literal::hex;
use sp_core::{crypto::key_types, H256};
use sp_io;
use sp_runtime::{
testing::{Header, UintAuthorityId},
traits::{IdentifyAccount, IdentityLookup, OpaqueKeys, Verify... |
use super::{
component::Component, component::ComponentText, item::Item, item_section::ItemSection, Bar,
};
use crate::{
config::Config, display::Display, event::Event, system::DisplayId, system::Rectangle,
window::Api, window::WindowEvent, AppState, NOG_BAR_NAME,
};
use log::{debug, error, info};
use mlua:... |
//! # Extended Isolation Forest
//!
//! This is a rust port of the anomaly detection algorithm described in [Extended Isolation Forest](https://doi.org/10.1109/TKDE.2019.2947676)
//! and implemented in [https://github.com/sahandha/eif](https://github.com/sahandha/eif). For a detailed description see the paper or the
//... |
#![allow(clippy::wildcard_imports)]
use seed::{prelude::*, *};
use std::{convert::TryFrom, u16, usize};
use std::mem;
use std::{collections::BTreeMap, u64};
use serde::{Deserialize, Serialize};
use strum::IntoEnumIterator;
use strum_macros::EnumIter;
use ulid::Ulid;
use chrono::{DateTime, Duration, FixedOffset, Utc... |
/*!
# Deku: Declarative binary reading and writing
Deriving a struct or enum with `DekuRead` and `DekuWrite` provides bit-level,
symmetric, serialization/deserialization implementations.
This allows the developer to focus on building and maintaining how the data is
represented and manipulated and not on redundant, er... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Start resolving addresses based on IRKs specified in the IRK data structure"]
pub tasks_start: TASKS_START,
_reserved1: [u8; 4usize],
#[doc = "0x08 - Stop resolving addresses"]
pub tasks_stop: TASKS_STOP,
_reserved2... |
// Copyright 2019, 2020 Wingchain
//
// 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... |
extern crate fixedbitset;
extern crate getopts;
extern crate libc;
extern crate regex;
extern crate toml;
extern crate num_cpus;
use regex::Regex;
use std::fs;
use std::io;
use std::io::{Read, Write, BufRead};
use std::path;
use std::sync;
use std::sync::mpsc;
use std::thread;
#[cfg(not(test))]
fn main()
{
let arg... |
use nu_engine::CallExt;
use nu_protocol::ast::Call;
use nu_protocol::ast::CellPath;
use nu_protocol::engine::{Command, EngineState, Stack};
use nu_protocol::{Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value};
use std::cmp::Ordering;
use std::sync::Arc;
#[derive(Clone)]
pub struct SubCommand;
str... |
use inflector::Inflector;
use botocore::{Service, Shape, ShapeType, Operation};
use std::ascii::AsciiExt;
use self::ec2::Ec2Generator;
use self::json::JsonGenerator;
use self::query::QueryGenerator;
use self::rest_json::RestJsonGenerator;
use self::error_types::{GenerateErrorTypes, JsonErrorTypes, XmlErrorTypes};
mod... |
// needs Debug because FileStyle derives it
use std::fmt::Debug;
use std::marker::Sync;
use std::path::Path;
use ansi_term::{ANSIString, Style};
use crate::fs::{File, FileTarget};
use crate::output::cell::TextCellContents;
use crate::output::escape;
use crate::output::render::FiletypeColours;
/// Basically a file na... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use crate::ack::ack_ranges::AckRanges;
use core::time::Duration;
use s2n_quic_core::{
frame::ack::EcnCounts,
packet::number::{PacketNumber, PacketNumberRange},
};
/// Stores aggregated ACK info for del... |
use crate::{
Encoding,
Header,
Msbt,
SectionTag,
section::*,
traits::Updates,
};
use byteordered::Endianness;
use std::{
boxed::Box,
pin::Pin,
ptr::NonNull,
};
pub struct MsbtBuilder {
section_order: Vec<SectionTag>,
header: Header,
lbl1: Option<Pin<Box<Lbl1>>>,
txt2: Option<Txt2>,
nli1: ... |
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//! Defines the structures needed for saving/restoring Virtio primitives.
use super::device::*;
use super::queue::*;
use crate::virtio::MmioTransport;
use snapshot::Persist;
use versionize::{VersionMap, V... |
mod file_operations;
mod global_data;
use self::global_data::{
TagBlacklistedUsers, TagResponseChannelIds, TagsContainer, BLACKLISTED_USERS_PATH,
BOT_CHANNEL_PATH, TAG_PATH,
};
use super::{create_file_if_missing, ButtonIds};
use crate::client::{tags::file_operations::save_user_tag_blacklist_to_file, Command};
... |
use std::io::{self, Read};
use std::fs::File;
use std::collections::HashMap;
use std::f64;
type Num = i64;
type Pos = (Num, Num);
#[derive(Debug)]
struct Instruction {
opcode : Num,
mode1 : Num,
mode2 : Num,
mode3 : Num,
}
#[derive(Debug)]
enum Direction {
N,
S,
E,
W
}
fn decode (i :... |
use orbtk::{prelude::*, render::platform::RenderContext2D, utils};
use std::cell::Cell;
use euc::{buffer::Buffer2d, rasterizer, Pipeline};
use vek::*;
// Cube is copied from euc spinning_cube example
// https://github.com/zesterer/euc/blob/master/examples/spinning_cube.rs
struct Cube<'a> {
mvp: Mat4<f32>,
pos... |
use crate::html_tree::HtmlDashedName;
use std::{
cmp::Ordering,
convert::TryFrom,
ops::{Deref, DerefMut},
};
use syn::{
braced,
parse::{Parse, ParseStream},
token::Brace,
Block, Expr, ExprBlock, ExprPath, Stmt, Token,
};
pub struct Prop {
pub label: HtmlDashedName,
/// Punctuation b... |
// Contributed by <NAME>
// non-parallel version of 3-m.rs on https://programming-language-benchmarks.vercel.app/
// which in turn inspired by C++ #6 SIMD implementation by <NAME>
// on https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
// Requires SSE3 and SSE4 instruction set
use std::arch::x86_64::{__m128... |
/*
* Copyright (C) 2015 <NAME> <<EMAIL>>
*
* 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 a... |
use super::Expr;
use super::Symbol;
use num::{BigInt, BigUint};
use std::ops::{Add, Sub, Mul, Div, Neg};
// impls for operators
// Clone it if it's a ref.
macro_rules! fwd_clone {
(@Take $name:ident) => {$name};
(@Ref $name:ident) => {$name.clone()}
}
/// Expand to the functuon details in implaccording to th... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
crate::cobalt,
argh::FromArgs,
fidl_fuchsia_component as fcomponent, fidl_fuchsia_sys2 as fsys, fuchsia_async as fasync,
fuchsia_comp... |
use std::{collections::BTreeMap, fmt::Debug};
use crate::{
data::input::TouchDeviceId,
emath::{normalized_angle, Pos2, Vec2},
Event, RawInput, TouchId, TouchPhase,
};
/// All you probably need to know about a multi-touch gesture.
pub struct MultiTouchInfo {
/// Point in time when the gesture started.
... |
use crate::soap::{
self,
auth::{digest::Digest, username_token::UsernameToken},
};
use async_recursion::async_recursion;
use async_trait::async_trait;
use schema::transport::{Error, Transport};
use std::{
fmt::{Debug, Formatter},
time::Duration,
};
use url::Url;
macro_rules! event {
($lvl:expr, $se... |
use parser::ast;
use std::{
collections::{hash_map::Entry, HashMap},
fmt,
rc::Rc,
};
use strtab::Symbol;
#[derive(Debug)]
pub struct ClassDoesNotExist;
#[derive(Debug)]
pub struct ClassAlreadyDeclared;
#[derive(Debug, Default)]
pub struct TypeSystem<'src, 'ast> {
pub defined_classes: HashMap<Symbol<'s... |
//! `slb` main executable
use std::fs::File;
use std::io::{BufReader, Write};
use std::ops::Deref;
use std::path::PathBuf;
use std::process::{Command, Stdio};
use std::sync::mpsc::{sync_channel, TrySendError};
use std::sync::{Arc, Mutex};
use std::thread;
use structopt::StructOpt;
use slb::{fileblocks, sharder};
/... |
use core::str::FromStr;
use itertools::Itertools;
use plotters::prelude::*;
use plotters_canvas::CanvasBackend;
use web_sys::HtmlCanvasElement;
use yew::prelude::*;
mod input;
use input::{FnInput, FnInputKind, Input, Set};
enum Msg {
Left(ChangeData),
Right(ChangeData),
AddFnInput,
Function(usize, Cha... |
use na::{self, Dim, Dynamic, RealField, VectorSliceMut, U1, Const};
use std::ops::MulAssign;
use crate::joint::JointConstraintSet;
use crate::math::Isometry;
use crate::object::{BodyHandle, BodySet, ColliderAnchor, ColliderSet};
use crate::solver::{
ForceDirection, GenericNonlinearConstraint, IntegrationParameters... |
use super::BTreeMappable;
#[derive(Clone, Debug, Default)]
struct DarkestEntry(Vec<(String, Vec<String>)>);
#[derive(Clone, Debug, Default)]
struct DarkestFile(Vec<(String, DarkestEntry)>);
macro_rules! explode {
($with:ident) => {
|(key, value)| {
value
.0
.$w... |
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum 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 yo... |
use std::sync::Arc;
use std::time::Duration;
use anyhow::{Context, Result};
use futures::StreamExt;
use signal_hook::consts::TERM_SIGNALS;
use sqlx::postgres::PgPool;
use svc_agent::{
mqtt::{Agent, AgentBuilder, AgentNotification, ConnectionMode, IncomingMessage, QoS},
request::Dispatcher,
AgentId, Authent... |
extern crate rayon;
use renderer::rayon::prelude::*;
use framebuffer::FrameBuffer;
use geometry::Vec3f;
use lights::Light;
use optics::reflect;
use optics::reflect_ray;
use optics::refract_ray;
use scene::Scene;
use shapes::find_closest_intersect;
use shapes::intersect_shape_set;
use shapes::Intersection;
use shapes::... |
//! Kernel memory allocator.
//!
//! The `memory` module contains a kernel memory allocator that is
//! loosely based on the Vmem allocator (Bonwick, 2001).
//!
//! # References
//!
//! Bonwick, Jeff, and <NAME>. "Magazines and Vmem: Extending
//! the Slab Allocator to Many CPUs and Arbitrary Resources." USENIX
//! Ann... |
// Super WIPy sixel parser
// Works in the few test cases I tried at least
#[derive(Copy, Clone, Debug)]
pub struct HeaderParser {
macro_param: usize,
transparent_bg: bool,
grid_size: usize,
aspect_numerator: usize,
aspect_denominator: usize,
xsize: usize,
ysize: usize,
state: HeaderPar... |
use rustc::mir;
use rustc::ty::{self, Ty};
use rustc::ty::layout::LayoutOf;
use syntax::codemap::Span;
use syntax::abi::Abi;
use rustc::mir::interpret::{EvalResult, PrimVal, Value};
use super::{EvalContext, eval_context,
Place, Machine, ValTy};
use rustc_data_structures::indexed_vec::Idx;
use interpret::m... |
use std::path::PathBuf;
use std::collections::HashMap;
use std::sync::atomic::AtomicUsize;
use std::sync::Arc;
use crate::config::GemBS;
use crate::common::defs::{Section, Metadata, DataValue, Command};
use crate::common::assets::GetAsset;
use crate::common::json_call_stats::CallJson;
use super::{QPipe, QPipeCom};
us... |
use gdal::{Dataset, Driver};
use failure::ResultExt;
use protobuf::{Filter, Image, ImageListRequest, ImageManagementClient, Node, NodeLocateRequest, NodeManagementClient};
use structopt::StructOpt;
use geocode::Geocode;
use tonic::Request;
mod tile;
use tile::Tile;
use std::error::Error;
use std::ffi::{CStr, CString}... |
// Copyright 2018 Parity Technologies (UK) Ltd.
// Copyright 2020 Netwarps Ltd.
//
// 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 ... |
/// An EVM instruction.
#[derive(Debug)]
enum Instruction {
// Stop and arithmetic operations.
Stop,
Add,
Mul,
Sub,
Div,
SDiv,
Mod,
SMod,
AddMod,
MulMod,
Exp,
SignExtend,
// Comparison and bitwise logic operations.
Lt,
Gt,
SLt,
SGt,
Eq,
IsZ... |
use std::time::Instant;
use crate::terrarium_raster::Raster;
use rome_map::{Map, Height};
use geo::prelude::*;
use geo::{Point, Rect, Coordinate};
use bitvec::bitvec;
use rayon::prelude::*;
use indicatif::{ParallelProgressIterator, ProgressBar, ProgressStyle};
use bitvec::vec::BitVec;
use itertools::Itertools;
use std:... |
//! Parses ITM packets from binary to Rust enums.
extern crate byteorder;
use self::byteorder::ReadBytesExt;
use self::byteorder::LittleEndian as LE;
use std::io::{Read, Error, ErrorKind};
use super::types::*;
use ::utils::bittuple::{to_bits,to_u32};
/// Reads variable length value encoded in the "protocol" encodin... |
// 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 futures::prelude::*;
use regex::{Error, Regex, RegexSet};
use serde::Serialize;
use std::{borrow::Cow, convert::TryFrom, sync::Arc};
mod serialize;
pub... |
// SPDX-License-Identifier: Apache-2.0 or MIT
//
// Copyright 2021 Sony Group Corporation
//
use crate::error::ErrorKind::*;
use crate::error::{Result, SeccompError};
use libseccomp_sys::*;
use std::str::FromStr;
/// Represents a CPU architecture.
/// Seccomp can restrict syscalls on a per-architecture basis.
#[deriv... |
use crate::bigint_pow;
use crate::kind::*;
use crate::table::*;
use crate::tuple::*;
use crate::vec_table::*;
use num::{BigInt, FromPrimitive, Zero};
use rand::prelude::*;
#[allow(unused_imports)]
use crate::{eprint, eprintln};
pub const DEFAULTS_FUNCTIONS: [DefaultFunction; 12] = [
DefaultFunction::Read,
Def... |
use crate::error::IdenticonError;
use image::codecs::jpeg::JpegEncoder;
use image::codecs::png::PngEncoder;
use image::imageops::FilterType;
use image::{DynamicImage, GenericImage, ImageBuffer, ImageEncoder};
use sha3::{Digest, Sha3_256};
mod color;
pub mod error;
mod grid;
mod map_values;
/// Generic Identicon struc... |
//! Markdown parser - parses markdown and generates html
//! Also generates TOC if the markdown contains a toc-generation flag
//!
use crate::Result;
use pulldown_cmark::{Event, Options as MdOptions, Parser, Tag};
/// Max depth of generated TOC: 3 is usually enough, 4 is bordering on excessive
const MAX_TOC_DEPTH: u8 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.