text stringlengths 3.09k 13.9k |
|---|
// Copyright 2020 The Tink-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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
use pyo3::{
prelude::*,
PyObjectProtocol,
types::{PyDict, PyAny, },
};
use python_utils;
use python_utils::{
py_repr,
// rc_wrapper_type,
// wrapper_type,
wrapper_type,
get_from_kwargs,
};
use fp::vector::FpVectorT;
use python_fp::vector::FpVector;
use python_fp::pri... |
use super::{DatabaseKey, DeltaBatch, DeltaBatchBuilder, ReadableChunkDb};
use crate::prelude::ChunkKey;
use sled;
use sled::Tree;
/// A persistent, crash-consistent key-value store of compressed chunks, backed by the `sled` crate.
///
/// The keys are Morton codes for the corresponding chunk coordinates. This ensure... |
use bevy::log::{debug, error, warn};
use bevy::prelude::{Assets, Handle, Image, TextureAtlas, Vec2};
use bevy::render::render_resource::{Extent3d, TextureDimension, TextureFormat};
use bevy::render::texture::TextureFormatPixelInfo;
use bevy::sprite::{Rect, TextureAtlasBuilderError};
use std::collections::HashMap;
/// ... |
use std::collections::VecDeque;
pub fn to_register(ch: char) -> usize {
(ch as u8 - b'a') as usize
}
#[derive(Debug, Copy, Clone)]
pub enum Value {
Register(usize),
Value(i64),
}
impl Value {
pub fn resolve(self, registers: &[i64]) -> i64 {
match self {
Value::Register(reg) => reg... |
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
#[macro_use]
extern crate log;
extern crate env_logger;
use serde_json::Value;
use clap::{App, Arg, SubCommand};
use ve_exporter::Config;
use futures::FutureExt;
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
if let Err(_) = std::env::var("RUST_LOG") {
println!("set env var");
std::env... |
// Copyright (c) <NAME> worlds <<EMAIL>>
// SPDX-License-Identifier: MIT
//! pentacle is a library for executing programs as sealed anonymous files on Linux, using
//! `memfd_create(2)`.
//!
//! This is useful for executing programs that execute untrusted programs with root permissions, or
//! ensuring a cryptographic... |
use ash::vk;
use ash::prelude::VkResult;
use ash::version::DeviceV1_0;
use renderer::vulkan::{VkDeviceContext, MsaaLevel};
use renderer::vulkan::VkSwapchain;
use renderer::vulkan::SwapchainInfo;
use renderer::vulkan::VkQueueFamilyIndices;
/// Draws sprites
pub struct VkMsaaRenderPass {
pub device_context: VkDevi... |
pub use buttons::TOOL_BUTTONS;
use wasm_bindgen::{closure::Closure, JsCast};
use yew::prelude::*;
use yew_macro::function_component;
use crate::{
app::attach::AttachView,
components::{
icon::{Icon, IconSize},
Visibility,
},
model::{self, proof, Proof},
};
mod buttons;
mod drawers;
#[d... |
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use byteorder::{BigEndian, ByteOrder};
use failure::Fail;
use serde::de::{self, Visitor};
use serde_derive::{Deserialize, Serialize};
use serde_json;
use s... |
#[cfg(test)]
#[path = "../../tests/unit/solver/evolution_test.rs"]
mod evolution_test;
use crate::construction::heuristics::InsertionContext;
use crate::construction::Quota;
use crate::models::Problem;
use crate::solver::mutation::*;
use crate::solver::population::DominancePopulation;
use crate::solver::selection::{Na... |
mod compare_details;
mod details;
mod style;
use super::{
command_pump, event_pump, CommandBlocking, CommandInfo,
Component, DrawableComponent, EventState, FileTreeComponent,
};
use crate::{
accessors, keys::SharedKeyConfig, queue::Queue, strings,
ui::style::SharedTheme,
};
use anyhow::Result;
use asyncgit::{
syn... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - 32-bit operand 1 - multiply - low word"]
pub mpy32l: crate::Reg<mpy32l::MPY32L_SPEC>,
#[doc = "0x02 - 32-bit operand 1 - multiply - high word"]
pub mpy32h: crate::Reg<mpy32h::MPY32H_SPEC>,
#[doc = "0x04 - 32-bit operand... |
// Copyright 2021 Parity Technologies (UK) Ltd.
// This file is part of polkadot-rewards.
// polkadot-rewards 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 ... |
/*
* Copyright (c) 2016-2017 Boucher, Antoni <<EMAIL>>
*
* 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, mod... |
// Copyright (C) 2019-2021 Crust Network Technologies Ltd.
// This file is part of Crust.
use crate::*;
pub use frame_support::{
parameter_types, assert_ok,
weights::{Weight, constants::RocksDbWeight},
traits::{OnInitialize, OnFinalize, Get, TestRandomness, WithdrawReasons}
};
pub use sp_core::{crypto::{A... |
use bytes::Bytes;
use futures::{Stream, StreamExt};
use rweb::{get, post, sse::ServerSentEvent, Filter, Rejection, Reply};
use std::{
collections::HashMap,
sync::{
atomic::{AtomicUsize, Ordering},
Arc, Mutex,
},
};
use tokio::sync::{mpsc, oneshot};
/// Our global unique user id counter.
sta... |
//! actix-web-requestid.
//!
//! [`RequestID`] provides a "request-id" to a http request. This can be
//! used for tracing, debuging, user error reporting.
//!
//! Insert the request id middleware to provide the request-id to the
//! `request-id` http header. To access requestID data, [`RequestID`] actix
//! extractor... |
// Copyright (c) 2018-2020 MobileCoin Inc.
//! Define DiscoveryHint buffer size, and serialization defs for it
//! Also define `fake_onetime_hint` which samples the distribution that
//! should be used for these hints when there is no discovery server.
//!
//! Note: Using generic array because rust has poor support fo... |
use crate::FieldKind;
use std::borrow::Borrow;
use std::cmp::Ordering;
use std::hash::{Hash, Hasher};
use uncased::{AsUncased, UncasedStr};
impl From<&FieldKind> for FieldName {
fn from(kind: &FieldKind) -> FieldName {
kind.into_name()
}
}
/// The name of a WARC header field.
///
/// Field names are c... |
// https://github.com/freebsd/freebsd/blob/master/sys/dev/acpica/acpiio.h
// https://github.com/freebsd/freebsd/blob/master/sys/dev/acpica/acpi_battery.c
use std::io;
use std::mem;
use std::str::FromStr;
use std::default::Default;
use std::os::unix::io::{RawFd, IntoRawFd};
use std::ffi::CStr;
use nix::Error;
use cra... |
use crate::math::{Isometry, Point, Real, Vector};
use crate::object::{ContiguousArena, ContiguousArenaIndex};
use crate::solver::NonPressureForce;
use num::Zero;
/// A fluid object.
///
/// A fluid object is composed of movable particles with additional properties like viscosity.
pub struct Fluid {
/// Nonpressur... |
use crate::*;
use near_sdk::Gas;
use near_sdk::utils::{is_promise_success};
/// Callback gas
pub const CALLBACK: Gas = Gas(25_000_000_000_000);
// This function supposedly be in internal.rs, but we're not using
// it anywhere so let's just put it here.
// /// Converts royalty percentage and amount to pay into payo... |
use graph::{GraphDef, GraphShapes, Result};
use id::{NodeID, OpID, PassID};
use init::Initialiser;
use ops::math::add::Add;
use ops::{standard_op_name, standard_inner_parameter_name, Op, OpInstance};
use shape::NodeDim;
use smallvec::SmallVec;
#[must_use]
#[derive(Clone, Debug)]
pub struct Bias {
output_id: NodeID,
... |
use crate::ErrorCode;
use core::{
fmt::{self, Debug, Formatter},
ptr,
};
/// A chained formatter function for a single error category.
///
/// A single `ErrorCodeFormatter` function is considered to be uniquely associated with a
/// type that implements [`ErrorCategory`]. Meaning one such function only ever r... |
/*
* DMNTK - Decision Model and Notation Toolkit
*
* MIT license
*
* Copyright (c) 2018-2022 <NAME> Software
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRIN... |
use super::*;
use pin_project_lite::pin_project;
use std::{
pin::Pin,
task::{Context, Poll},
time::Instant,
};
#[derive(Debug)]
enum MeasuredFutureState {
Ready(&'static str, Vec<Event>),
Running(&'static str, Vec<Event>, Instant),
Complete,
}
impl MeasuredFutureState {
fn start_timer(&mut... |
// Copyright 2022 pyke.io
// 2019-2021 Tauri Programme within The Commons Conservancy
// [https://tauri.studio/]
//
// 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... |
use shred::{Fetch, FetchMut, Resource};
use specs::error::WrongGeneration;
use specs::{storage::InsertResult, Component, Entity, ReadStorage, World, WriteStorage};
use parking_lot::RwLock;
use std::sync::Arc;
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::time::{Duration, Instant... |
mod editor;
// Construct the command line cli
// In the future this should all be able to be customized through
// a config file.
//
// If I want to integrate python scripts as configs this could be
// a could first try.
// Source: https://github.com/RustPython/RustPython
//
//
//
//
//
//
// Form own command line:
/... |
#[cfg(feature = "specfile")]
use crate::flexi_error::FlexiLoggerError;
use crate::log_specification::LogSpecification;
use crate::primary_writer::PrimaryWriter;
use crate::writers::LogWriter;
use std::borrow::Borrow;
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
/// Allows reconfiguring the logger pro... |
use std::convert::TryFrom;
use std::fmt::{self, Debug, Display, Formatter};
use std::cmp::Ordering;
use std::hash::{Hash, Hasher};
use std::ops::Deref;
use std::marker::PhantomData;
use crate::error::ModelError;
use crate::expressions::parser::parse_name;
use crate::parser as p;
/// Contains tags to create distinguis... |
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use std::time::Duration;
use headless_chrome::browser::tab::RequestInterceptionDecision;
use headless_chrome::protocol::network::methods::RequestPattern;
use headless_chrome::{Browser, LaunchOptions};
use reqwest::Client;
use crate::error::PSNServerError;
us... |
use crate::backend::{Backend, BackendError, ProgressReporter};
use crate::config::S3BackendOpt;
use crate::file_utils;
use crate::progress::{ProgressReaderAdapter, ProgressReaderAsyncAdapter};
use anyhow::Error;
use atty::Stream;
use futures::future::lazy;
use futures::StreamExt;
use futures::TryStreamExt;
use indicati... |
#![allow(unused_variables)]
use std::{io::BufRead, time::Duration};
use super::*;
submodule!(context_creation);
submodule!(create_destroy);
submodule!(paint);
submodule!(size);
submodule!(event_queue_cleared);
#[derive(Debug)]
pub struct GlWindow {
window_class: WindowClassAtom,
hwnd: HWND,
}
impl Drop for GlWi... |
use super::ErrorKind;
use crate::project::{Application, Package, Project};
use clap::ArgMatches;
use colored::Colorize;
use failure::{bail, format_err, Error, ResultExt};
use serde::Serialize;
use slog::Logger;
use std::{fs::OpenOptions, io::BufWriter};
pub fn run(matches: &ArgMatches, _logger: &Logger) -> super::Resu... |
#![feature(async_closure)]
#[macro_use]
extern crate lazy_static;
use std::collections::HashMap;
use std::error::Error;
use std::fs;
use std::io::{BufReader, Read};
use crate::config::Config;
use crate::http::HttpServer;
use clap::{crate_version, App, Arg, ArgMatches, ErrorKind};
use rumqttc::MqttOptions;
use simple... |
#[macro_use]
extern crate bitflags;
extern crate bytes;
#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate futures;
#[macro_use]
extern crate hyper;
#[macro_use]
extern crate log;
extern crate tokio_core;
extern crate tokio_timer;
use std::time::*;
use bytes::*;
use futures::future::*;
use futures::stre... |
//! Explaining how *filecheck* matched or failed to match a file.
use crate::MatchRange;
use std::cmp::min;
use std::fmt::{self, Display, Formatter};
/// Record events during matching.
pub trait Recorder {
/// Set the directive we're talking about now.
fn directive(&mut self, dct: usize);
/// Matched a p... |
use volatile_register::{RO, RW};
/// System Control Block
///
/// This is the v8-M mainline version with all registers.
/// Smaller cores implement only a subset of registers,
/// and some registers depend on configuration options,
/// but this is currently not implemented.
// TODO implement different configurations
#... |
use super::{ChildStderr, ChildStdin, ChildStdout, Error, Session};
use std::io;
use std::process::{ExitStatus, Output};
use tokio::io::AsyncReadExt;
use tokio::try_join;
#[derive(Debug)]
pub(crate) enum RemoteChildImp {
#[cfg(feature = "process-mux")]
ProcessImpl(super::process_impl::RemoteChild),
#[cfg... |
//! This module contains the types and implementations for the
//! `PublicGroupState` and `PublicGroupStateTbs` structs of the MLS spec. The
//! `PublicGroupState` implements type-enforced verification in the same way as
//! the `MlsPlaintext` and as described in the [`OpenMLS Wiki`].
//!
//! [`OpenMLS Wiki`]: https://... |
use crate::objects::Hash;
use crate::objects::{Object, Tree};
use chrono::offset::{FixedOffset, Local, TimeZone};
use chrono::DateTime;
use colored::Colorize;
use std::fmt;
use std::io::BufRead;
use std::path::PathBuf;
use std::str::FromStr;
/// This object represents a version. It contains the root of the tree and
//... |
// Noblit -- An immutable append-only database
// Copyright 2020 <NAME>
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// A copy of the License has been included in the root of the repository.
//! An evaluator for query plans.
us... |
use num_traits::PrimInt;
use bit_vec::BitVec;
use int_vec::{IntVec, IntVector};
use space_usage::SpaceUsage;
use storage::{Address, BlockType};
use super::{RankSupport, BitRankSupport};
/// Jacobson’s rank structure for fast rank queries over a `BitVec`.
///
/// Construct with `JacobsonRank::new`.
#[derive(Clone, De... |
//! Use a color picker as an input element for picking colors.
//!
//! *This API requires the following crate features to be activated: color_picker*
use dodrio::bumpalo;
use iced_web::{Bus, Color, Css, Element, Widget};
pub use crate::style::color_picker::{Style, StyleSheet};
use std::rc::Rc;
/// An input element f... |
use std::collections::HashMap;
use std::error::Error;
use std::fs;
use std::path::Path;
use std::sync::{Arc, Mutex};
use std::time::Duration;
use haikunator::Haikunator;
use nix::sys::signal;
use nix::sys::signal::kill;
use nix::unistd::Pid;
use tokio::time::sleep;
/// A squish container. A container is basically jus... |
//! # Credential Registry pallet
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode};
use core::result::Result;
use frame_support::{
decl_error, decl_event, decl_module, decl_storage, dispatch, ensure, sp_runtime::RuntimeDebug,
sp_std::prelude::*, traits::EnsureOrigin,
};
use frame_system::... |
///////
// Utilities for Aws S3 resources
use super::{BinRepoError, BINST_REPO_BUCKET, ENV_BINST_REPO_AWS_KEY_ID, ENV_BINST_REPO_AWS_KEY_SECRET, ENV_BINST_REPO_AWS_REGION};
use dirs::home_dir;
use regex::Regex;
use s3::{creds::Credentials, Bucket, Region};
use std::{
collections::HashMap,
env::{self, VarError},
fs:... |
//! The `umgap seedextend` command.
use std::cmp;
use std::io;
use std::path::PathBuf;
use crate::errors;
use crate::io::fasta;
use crate::taxon;
use crate::taxon::TaxonId;
#[derive(Debug, StructOpt)]
#[structopt(verbatim_doc_comment)]
/// Selects promising regions in sequences of taxon IDs
///
/// The `umgap seedex... |
use block::{Block, Register};
use errors::{Error, ErrorType};
use database::{Database, Change, Transaction};
use runtime::Runtime;
use table::{Table, TableIndex, TableId};
use value::{Value, NumberLiteral, ValueMethods};
use std::sync::Arc;
use std::cell::RefCell;
use rust_core::fmt;
use operations::{
math_add,
ma... |
//
// Copyright (C) 2019 Kubos Corporation
//
// 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... |
#[cfg(not(target_os = "linux"))]
compile_error!("ojcmp does not support this platform now");
use ojcmp::{ByteReader, Comparison};
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::os::unix::prelude::FromRawFd;
use std::path::PathBuf;
use std::process;
use structopt::clap::ArgGroup;
use structopt::StructO... |
// Copyright 2018 Grove Enterprises LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed ... |
use crate::buffer::Buffer;
use crate::buffer_mode::BufferMode;
use crate::buffer_mode::TabOperation;
use crate::config::ConfigWithDefault;
use crate::core::CoreBuffer;
use crate::draw;
use crate::draw::CharStyle;
use crate::rmate::{start_server, RmateSave, RmateStorage};
use crate::storage::Storage;
use crate::syntax::... |
use crate::{timecode_parse::round_seconds_to_frame, Framerate, TimecodeParseError};
use core::result::Result;
use core::result::Result::Ok;
use num::Rational32;
use num::{FromPrimitive, Rational64};
use regex::Match;
use crate::consts::{RUNTIME_REGEX, SECONDS_PER_HOUR_I64, SECONDS_PER_MINUTE_I64};
use crate::timecode_... |
extern crate proc_macro;
use proc_macro::TokenStream;
use proc_macro2::{Span, TokenStream as TokenStream2};
use quote::{quote, quote_spanned};
use syn::spanned::Spanned;
use syn::{
parse_macro_input, Attribute, Data, DeriveInput, Field, GenericParam, Ident, Lifetime,
LifetimeDef,
};
#[proc_macro_derive(Depend... |
use crate::classifieds::{ClassifiedsApi, ClassifiedsDetails, ClassifiedsItem};
use crate::guids;
use crate::telegram::TelegramApi;
use anyhow::Result;
use rand::Rng;
use std::path::PathBuf;
use std::time::Duration;
use tokio::time::sleep;
use tracing::Level;
pub struct App {
classifieds: ClassifiedsApi,
guids_... |
//! WebSocket frame parsing.
use std::io::{BufReader, Read, Write};
use byteorder::{NetworkEndian, ReadBytesExt, WriteBytesExt};
use super::message::Message;
#[derive(Debug, Clone, PartialEq, Eq)]
/// A WebSocket frame.
pub struct Frame {
pub(crate) fin: bool,
pub(crate) rsv1: bool,
pub(crate) rsv2: boo... |
#![cfg_attr(feature = "strict", deny(warnings))]
#![feature(const_fn_trait_bound)]
mod detail;
pub mod numeric_types;
pub mod serialization;
#[macro_use]
extern crate uom;
use std::{cmp, ops};
use async_trait::async_trait;
use num_traits::FromPrimitive;
use detail::Rectangle;
// Trait used for abstracting away lo... |
use core::{Board, Colour, Piece};
use std::fmt::Display;
const BUFFER_WIDTH: usize = 80;
const BUFFER_HEIGHT: usize = 24;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct ScreenCell {
c: char,
colour: Colour,
}
impl Default for ScreenCell {
fn default() -> Self {
Self {
c: ' ',... |
//mod alu;
//mod controller;
//mod dataPath;
mod alu;
mod register;
use std::io;
//use controller::controller;
//use dataPath::dataPath;
fn hex_convert(mut hex: &str) -> String {
let mut out = String::new();
if hex.to_uppercase().find('X') != None {
hex = &hex[1..];
}
for digit in hex.to_upper... |
//! Isometric transformations.
#![allow(missing_doc)]
use std::num::{Zero, One};
use rand::{Rand, Rng};
use structs::mat::{Mat3, Mat4, Mat5};
use traits::structure::{Cast, Dim, Col};
use traits::operations::{Inv, ApproxEq};
use traits::geometry::{RotationMatrix, Rotation, Rotate, AbsoluteRotate, Transform, Transforma... |
use std::fmt::Display;
#[derive(PartialEq)]
enum State {
New,
Hello,
MailFrom,
RcptTo,
Data,
Quit,
}
pub struct Mail {
pub helo: Option<String>,
pub mail_from: Option<String>,
pub rcpt_to: Vec<String>,
pub data: Option<String>,
}
impl Mail {
pub fn new() -> Mail {
... |
use crate::infinite_memory_intcomputer::{IntcodeComputer, IntcodeComputerState::{OutputProduced, WaitingForInput}, ParamMode::PositionMode};
use std::collections::HashMap;
use std::error::*;
use std::{thread, time};
const EMPTY: i32 = 0;
const WALL: i32 = 1;
const BLOCK: i32 = 2;
const HORIZONTAL_PADDLE: i32 = 3;
cons... |
use std::borrow::Cow;
use crate::{config::Config, error::AppError, Context};
use poise::serenity_prelude as serenity;
#[derive(Debug, poise::SlashChoiceParameter)]
pub enum Font {
#[name = "明朝体"]
Mincho,
#[name = "ゴシック体"]
Gothic,
#[name = "太明朝体"]
BlackMincho,
#[name = "太ゴシック体"]
BlackGo... |
use failure::*;
use futures::sync::mpsc::{channel, Receiver, Sender};
use std::collections::HashMap;
use std::sync::RwLock;
use graph::components::subgraph::SubgraphProviderEvent;
use graph::prelude::{SubgraphInstance as SubgraphInstanceTrait, *};
use super::SubgraphInstance;
type InstanceShutdownMap = Arc<RwLock<Ha... |
use sp_core::{Pair, Public, sr25519};
use cord_runtime::{
AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig,
SudoConfig, SystemConfig, WASM_BINARY, Signature,
ValidatorSetConfig, SessionConfig, opaque::SessionKeys, RbacConfig
};
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_finality... |
use rafx::render_feature_write_job_prelude::*;
use rafx::api::RafxPrimitiveTopology;
use rafx::framework::{VertexDataLayout, VertexDataSetLayout};
lazy_static::lazy_static! {
pub static ref IMGUI_VERTEX_LAYOUT : VertexDataSetLayout = {
use rafx::api::RafxFormat;
let vertex = imgui::DrawVert {
... |
use std::io::{Read, Seek, SeekFrom, Write};
use std::sync::Mutex;
use byteorder::{ReadBytesExt, LE, WriteBytesExt};
use crate::anim::{self, ErrKind, Error};
pub struct DdsGrp {
pub frame_count: u16,
pub scale: u8,
pub version: u8,
pub frames: Vec<Frame>,
// Only used if flag 0x10 is set
// 25... |
use crate::geom::{Transform, Vector};
#[derive(Copy, Clone, Debug, PartialEq)]
#[non_exhaustive]
/// The way to adjust the content when the size of the window changes
pub enum ResizeHandler {
/// Use the entire area and stretch to fill it
Stretch,
/// Keep the content area exactly the same size. If necessa... |
use jumprope::JumpRope;
/// This fuzzer is a simple test which simulates 3 peers. Each iteration:
///
/// - We generate a set of changes from one or more peers
/// - We pick two peers and:
/// - Sync all changes to the document state
/// - Verify the two peers have identical document states afterwards
///
/// Any v... |
use std::cell::RefCell;
use std::iter::{IntoIterator, Iterator};
use std::rc::Rc;
use std::vec::IntoIter;
use serde::de::DeserializeOwned;
use tokio_core::reactor::Core;
use rincon_client::cursor::methods::*;
use rincon_client::cursor::types::{Cursor, CursorStatistics, Warning};
use rincon_core::api::connector::{Conn... |
use crate::rltk;
use rltk::{RGB, Point, Algorithm2D, a_star_search, field_of_view};
use super::{fighter::Fighter, Map, Combat, BaseEntity, State, attack, random_choice, Particle};
use rand::Rng;
extern crate serde;
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
pub struct Mob {
pub position... |
use database_error::{
DatabaseError,
DatabaseResult,
};
use diesel::{
Connection,
ExpressionMethods,
OptionalExtension,
PgConnection,
QueryDsl,
QueryResult,
RunQueryDsl,
};
use migrations_internals as migrations;
use pool::Pool;
use query_helper;
use rocket::local::Client;
use server... |
use anyhow::{anyhow, Result};
use std::str::FromStr;
use structopt::StructOpt;
use super::git::{GitRepo, GitRepoIO};
use super::tag;
#[derive(StructOpt, Debug)]
#[structopt(name = "tagging")]
pub struct Opt {
/// Push tag to remote after tagging
#[structopt(long)]
pub push_tag: bool,
/// Disable prom... |
//!
use chrono::prelude::{DateTime, Utc};
use crate::{Apply, Core, Delta, DeltaError, DeltaResult};
use crate::snapshot::SnapshotCtx;
use crate::snapshot::delta::{DeltaSnapshot, DeltaSnapshots};
use serde_derive::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::hash::{Hash, Hasher};
#[macro_export]
macro_ru... |
//! Functions for decoding arbitrary base encoded strings.
use core::fmt;
#[cfg(feature = "alloc")]
use alloc::{vec, vec::Vec};
use crate::{alphabet::Unspecified, Alphabet};
/// A builder for setting up the alphabet and output of a decode.
///
/// See the documentation for [`bsx::decode`](crate::decode()) for a mor... |
//! Space-efficient version of Needleman-Wunsch's algorithm
use crate::alignment::*;
use std::cmp::max;
use std::mem;
pub struct NwSpaceEfficientAligner<F: MatchFunc> {
scoring: Scoring<F>,
}
impl<F: MatchFunc> NwSpaceEfficientAligner<F> {
pub fn new(scoring: Scoring<F>) -> Self {
NwSpaceEfficientAli... |
use std::env;
use guarakapa::{scanpw, crypto, fman, fs};
const MSG_ENTER_PW: &str = "Enter your master password: ";
const MSG_SAVE_ERR: &str = "Failed to save file";
const MSG_LOAD_ERR: &str = "Failed to load file";
const MSG_WRONG_PW: &str = "Password does not match!";
const MSG_ENCODE_ERR: &str = "Failed to encode f... |
// Copyright (c) 2021 ruarango developers
//
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
... |
//! A demonstration of using `winit` to provide events and GFX to draw the UI.
//!
//! `winit` is used via the `glutin` crate which also provides an OpenGL context for drawing
//! `conrod_core::render::Primitives` to the screen.
#![allow(unused_variables)]
extern crate conrod_core;
extern crate conrod_example_shared;... |
/*!
# QR Code Segments Optimizer
This library is used for optimizing the QR code segments.
## Examples
```rust
extern crate qrcode_generator;
extern crate qrcode_segments_optimizer;
extern crate url;
use qrcode_generator::QrCodeEcc;
use url::Url;
let url = "https://magiclen.org/path/to/12345";
let ecc = QrCodeEcc:... |
use core::fmt::Debug;
use core::marker::PhantomData;
use super::frac::C;
use super::ContextInformation;
use super::{Frac, Plan, StepResult};
use crate::encodation::{ascii, c40};
pub(super) trait CharsetInfo: Clone + Debug + PartialEq {
fn val_size(ch: u8) -> u8;
fn in_base_set(ch: u8) -> bool;
}
#[derive(De... |
use glutin_window::GlutinWindow as Window;
use graphics::math::{identity, scale, translate};
use graphics::rectangle::{rectangle_by_corners, square};
use mandelbrot::{pixel_to_point, write_buffer, ImageBuffer};
use num::Complex;
use opengl_graphics::{GlGraphics, OpenGL, Texture, TextureSettings};
use piston::event_loop... |
use crate::chron_service::{CommandType, ThreadState};
use crate::http_error::HttpError;
use actix_web::{
delete, get, http::StatusCode, post, web, web::Bytes, App, HttpServer, Responder, Result,
};
use serde_json::json;
use std::collections::BTreeMap;
use std::fs;
#[get("/status")]
async fn status_overview(data: w... |
mod parser;
mod server;
use notify::{watcher, DebouncedEvent, RecursiveMode, Watcher};
use std::ffi::OsString;
use std::process::Command;
use std::sync::mpsc::{channel, Sender};
use std::sync::{Arc, Mutex};
use std::thread;
use std::time::Duration;
const DEFAULT_EVENT_NAME: &str = "update";
const MIN_EVENT_PORT: u16 ... |
//! Array Virtual Table.
//!
//! Note: `rarray`, not `carray` is the name of the table valued function we
//! define.
//!
//! Port of [carray](http://www.sqlite.org/cgi/src/finfo?name=ext/misc/carray.c)
//! C extension: `https://www.sqlite.org/carray.html`
//!
//! # Example
//!
//! ```rust,no_run
//! # use rusqlite::{t... |
use hc::cmds::*;
use holochain_hc as hc;
use std::path::Path;
use std::path::PathBuf;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
/// Holochain CLI - Helper for generating, running, and interacting with Holochain Conductor "setups".
///
/// A setup is a directory containing a conductor config, databases, and... |
#![feature(test)]
extern crate cgmath;
extern crate shred;
#[macro_use]
extern crate shred_derive;
extern crate test;
use std::ops::{Index, IndexMut};
use cgmath::Vector3;
use shred::*;
use test::Bencher;
#[derive(Debug)]
struct VecStorage<T> {
data: Vec<T>,
}
impl<T: Clone> VecStorage<T> {
fn new(init: T)... |
use std::marker::PhantomData;
use aead::{AeadInPlace, Error, NewAead, Nonce, Tag};
use block_cipher::{Block, BlockCipher, NewBlockCipher};
use crypto_mac::{Mac, NewMac};
use generic_array::ArrayLength;
use subtle::ConstantTimeEq;
use typenum::consts::{U0, U11, U16};
use typenum::marker_traits::Unsigned;
pub use crate... |
mod migrations;
use crate::dirs::WORK_DIR;
use crate::prelude::*;
use r2d2::{CustomizeConnection, Pool};
use r2d2_sqlite::SqliteConnectionManager;
use rusqlite::types::ToSql;
use rusqlite::{Connection, Row, Transaction};
use std::sync::Arc;
use std::time::Instant;
use tempfile::NamedTempFile;
static LEGACY_DATABASE_P... |
extern crate util;
extern crate itertools;
#[macro_use] extern crate scan_fmt;
use itertools::Itertools;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::str::FromStr;
use std::usize;
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
struct Point {
x: i32,
... |
use heck::*;
use proc_macro2::{Ident, TokenStream};
use quote::{format_ident, quote};
use crate::pdl::{DataType, Domain, Event};
pub struct EventType<'a> {
pub protocol_mod: Ident,
pub domain: &'a Domain<'a>,
pub inner: &'a Event<'a>,
pub needs_box: bool,
}
impl<'a> EventType<'a> {
fn ty_ident(&s... |
use super::Optimizer;
use crate::compress::optimize::is_left_access_to_arguments;
use std::iter::repeat_with;
use swc_atoms::js_word;
use swc_common::DUMMY_SP;
use swc_ecma_ast::*;
use swc_ecma_utils::find_ids;
use swc_ecma_utils::ident::IdentLike;
use swc_ecma_utils::private_ident;
use swc_ecma_utils::Id;
use swc_ecma... |
#![recursion_limit="512"]
#![feature(hash_set_entry, try_blocks)]
use discord_bots::{discord, chain, error};
use bytes::Bytes;
use futures::{
pin_mut,
future::FutureExt,
};
use std::{
collections::{
hash_map::HashMap,
hash_set::HashSet,
},
str,
};
use structopt::St... |
/*
* 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 crate::*;
pub struct Compiler<'a> {
chk: &'a mut Chunk
}
impl<'a> Compiler<'a> {
pub fn new(chk: &'a mut Chunk) -> Compiler<'a> {
Compiler {
chk
}
}
fn make_jump(&mut self) -> usize {
self.chk.add_instr(Instruction::JumpPlaceholder, 1);
self.chk.instrs.l... |
use std::string::String;
#[derive(Default)]
pub struct MeshNameParser {
pub full_name: String,
pub full_name_normalized: String,
pub render_parameter_normalized: String,
pub camera_targets_normalized: String,
pub tokens: Vec<String>,
pub mesh_name: String,
pub item_name: String,
pub item_mesh_part: Str... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.