text stringlengths 3.09k 13.9k |
|---|
use crate::game::{
components::*, town::new_temple_menu, units::worker_factory::create_worker_entities,
units::workers::Worker,
};
use crate::init::loading::LoadingState;
use crate::init::quicksilver_integration::{GameState, Signal};
use crate::net::graphql::query_types::WorkerResponse;
use crate::net::graphql:... |
//! Font metrics.
pub mod chars;
pub mod kerning;
pub mod width;
use crate::font::layout;
use serde::{Deserialize, Serialize};
use crate::metrics::{Length, Point, Size};
// We hardcode the general layout of a font texture using the following
// constants:
/// The number of columns in a font.
const NUM_COLS: u8 = 3... |
extern crate regex;
use regex::Regex;
use std::io;
use std::io::prelude::*;
use std::collections::HashMap;
use std::collections::HashSet;
fn parse_input<T: BufRead>(input: T) -> (HashMap<String, HashSet<Vec<String>>>, Vec<String>) {
let transform_re = Regex::new("^(([A-Z][a-z]?)|e) => ([A-Z][a-z]?)+$").unwra... |
use ate::prelude::*;
use clap::Parser;
#[allow(unused_imports)]
use tracing::{debug, error, info, instrument, span, trace, warn, Level};
use ate_auth::helper::*;
use ate_auth::prelude::*;
#[derive(Parser)]
#[clap(version = "1.5", author = "<NAME>. <<EMAIL>>")]
struct Opts {
/// Sets the level of log verbosity, ca... |
//! ADS-B Simulator - see README.md
//
// © NewForester, 2018. Available under MIT licence terms.
//
//! The msg246 module implements the _mavlink message trait_ for the
//! MAVLink 'traffic report' message (id 246).
//!
//! Only message serialise is actually implemented
//! as the ADS-B Simulator need only generate t... |
#![forbid(unsafe_code)]
#![warn(missing_docs)]
#![warn(clippy::all, clippy::pedantic)]
/*!
# Proton Caller
This is the library which defines the Proton Caller API.
View [bin/proton-call.rs](bin/proton-call.rs) for more information about the `proton-call` executable.
*/
use std::ffi::OsString;
use std::io::{Error, E... |
use rust_forth::forth_compiler::ForthCompiler;
use rust_forth::stack_machine::GasLimit;
use rust_forth::ForthError;
use std::fs;
fn main() -> Result<(), ForthError> {
println!("Hello, world! This is rust_forth");
run()?;
Ok(())
}
fn run() -> Result<(), ForthError> {
let mut fc = ForthCompiler::new()... |
use super::*;
use bytes::{Buf, BufMut, Bytes, BytesMut};
/// The error frame.
///
/// Error frames are used for errors on individual requests/streams as well as connection errors
/// and in response to SETUP frames.
///
/// # Frame Contents
///
/// The error frame is structured as follows:
///
/// ```text
/// 0 ... |
//! Use and manage Bash shell
//!
//! This is essentially my hello world application and using it as a stalking horse for finding user stories
//! THINK: Considering to change this to a generic unix shell with a plugin for specific type (Bash, ZSH),
//! since they seem to be common with the differences coming fr... |
#![feature(iter_map_while, iterator_fold_self, exclusive_range_pattern)]
use clap::Clap;
use std::io;
use std::io::prelude::*;
/// Apply a mathmatical operation to a stream of inputs.
/// e.x.
/// ```
/// $ printf '2\n3\n\n' | mathcli mul
/// $ 6
/// $ printf '6\n2\n\n' | mathcli sub
/// $ 4
/// $ printf '7\n3\n\n' |... |
pub mod camera;
pub mod pixels;
pub mod ppm;
use rand::Rng;
use rayon;
use crate::entity::{Entity, EntityInterface};
use crate::material::{MaterialInterface, ScatterRecord};
use crate::math::{Color, Ray};
use camera::Camera;
pub struct Image {
pixels: Vec<Color>,
width: usize,
height: usize,
}
impl Ima... |
//! # Security key data
use core::convert::TryFrom;
use crate::pack::PackFixed;
use crate::Error;
extended_enum!(
// 4.4.3 Transport-Key Services
// Table 4.14 KeyType Parameter of the Transport-Key Primitive
/// Key type
KeyType, u8,
/// Trust center master key
TrustCenterMasterKey => 0x00,
/// Standard network key... |
// Copyright 2020 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute... |
pub use crate::err::{Cause, Error, SaveError, Trace};
/// The configuration of your interface
///
/// This tell to the interpreter what your interface can do. It use it to set/clear header flags. See the [`Interface`] trait and [the format of the header](http://inform-fiction.org/zmachine/standards/z1point1/sect11.htm... |
use nalgebra::geometry::Point2;
use std::str::FromStr;
pub fn parse_points(directions: &Vec<&str>) -> Vec<Point2<f32>> {
const DIRECTION_UP: char = 'U';
const DIRECTION_RIGHT: char = 'R';
const DIRECTION_DOWN: char = 'D';
const DIRECTION_LEFT: char = 'L';
let mut last_point: Point2<f32> = Point2::... |
#![no_std]
//! The monospace fonts from
//! [embedded-graphics](https://github.com/embedded-graphics/embedded-graphics/tree/embedded-graphics-v0.6.2)
//! back the overhauled font handling form 0.7. The fronts provided here use
//! the same bitmaps with new
//! [`MonoFont`](embedded_graphics::mono_font::MonoFont) struc... |
/// TODO:
/// - Move this code into another independent crate
use std::io::{Result, Error};
use std::os::raw::c_int;
use std::mem::{size_of, size_of_val, MaybeUninit};
use std::sync::Arc;
use libc::{signalfd, signalfd_siginfo, SFD_CLOEXEC, SFD_NONBLOCK, SIGCHLD};
use libc::{sigset_t, SIG_BLOCK, sigemptyset, sigaddse... |
#![allow(dead_code)]
const DOCKED: u32 = 0x00000001;
const LANDED: u32 = 0x00000002;
const LANDING_GEAR_DOWN: u32 = 0x00000004;
const SHIELDS_UP: u32 = 0x00000008;
const SUPERCRUISE: u32 = 0x00000010;
const FLIGHT_ASSIST_OFF: u32 = 0x00000020;
const HARDPOINTS_DEPLOYED: u32 = 0x00000040;
const IN_WING: u32 = 0x0000008... |
#[macro_use]
extern crate diesel;
extern crate diesel_derive_enum;
extern crate dotenv;
use diesel::update;
use crate::models::NewActor;
use diesel::dsl::insert_into;
use crate::models::Actor;
use r2d2::Pool;
use std::ops::Deref;
use diesel::pg::PgConnection;
use diesel::prelude::*;
use dotenv::dotenv;
use std::env;
... |
//! Rust crate for managing the systemd-boot loader configuration.
#[macro_use]
extern crate thiserror;
pub mod entry;
pub mod loader;
use self::entry::*;
use self::loader::*;
use once_cell::sync::OnceCell;
use std::fs;
use std::fs::File;
use std::io::prelude::*;
use std::io::{self, BufWriter};
use std::path::{Pat... |
// Variant of ActorRc using our own Rc implementation (MinRc). Saves
// 8 bytes compared to safe version because we can pack the state into
// the count value.
//
// TODO: We could save another 8 bytes by using ptr::read/write
// instead of the Inner enum. However that is impossible right now
// because `union` only ... |
use super::events::{Code, Key};
use super::util::maybe_utf8;
use serde_derive::{Deserialize, Serialize};
use serde_json::Value;
use std::error::Error;
use std::fmt;
#[derive(PartialEq)]
pub enum APIEvent {
// from application to IO glue to WormholeCore
Start,
AllocateCode(usize), // num_words
InputCode... |
#![warn(missing_docs)]
#![warn(rustdoc::missing_doc_code_examples)]
//! Moon Engine
pub mod camera;
pub mod collider;
pub mod component;
pub mod gl;
pub mod input;
pub mod math;
pub mod mesh;
pub mod particle;
pub mod renderer;
pub mod shader;
pub mod texture;
pub mod transform;
pub mod ui;
pub mod utils;
pub mod web... |
use random_access_storage::RandomAccess;
use std::io::Write;
#[derive(Debug,Clone)]
pub struct WriteCache<S> where S: RandomAccess {
store: S,
queue: Vec<(u64,Vec<u8>)>,
length: u64,
enabled: bool
}
impl<S> WriteCache<S> where S: RandomAccess {
pub fn open (store: S) -> Result<Self,S::Error> {
let lengt... |
#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
//! GPIOG
//!
//! Used by: stm32mp153, stm32mp157
#[cfg(not(feature = "nosync"))]
pub use crate::stm32mp::peripherals::gpiog::Instance;
pub use crate::stm32mp::peripherals::gpiog::{RegisterBlock, ResetValues};
pub use crate::stm32mp::per... |
use super::{Icon, IconStyle};
use crate::{
agents::{notifier, repo},
objects::JsError,
};
use podcast_player_common::{item_meta::DownloadStatus, Item};
use uuid::Uuid;
use yew::{prelude::*, Component, Properties};
use yew_agent::{Dispatched, Dispatcher};
pub struct ItemListCompact {
repo: Dispatcher<repo::... |
//! Displays a [`TabBar`](TabBar) to select the content to be displayed.
//!
//! You have to manage the logic to show the contend by yourself or you may want
//! to use the [`Tabs`](super::tabs) widget instead.
//!
//! *This API requires the following crate features to be activated: tab_bar*
use iced_graphics::{Backe... |
// Imports
use crate::error::GraphicsError;
/// Color type for image data.
#[derive(Debug, PartialEq, Clone, Copy)]
pub enum ColorType {
// RGB
RGB24,
BGR24,
R8G8B8,
// RGBA
RGBA32,
ABGR32,
R8G8B8A8
}
impl ColorType {
/// Size of one color sample.
pub fn sample_size(self) -> u8... |
use std::{
collections::vec_deque::{self, VecDeque},
fmt, iter,
net::SocketAddr,
};
use crate::uri::Uri;
pub trait Address {
/// Get hostname part.
fn hostname(&self) -> &str;
/// Get optional port part.
fn port(&self) -> Option<u16> {
None
}
}
impl Address for Uri<'_> {
... |
#[cfg(target_arch = "aarch64")]
use frida_gum::instruction_writer::Aarch64Register;
#[cfg(target_arch = "x86_64")]
use frida_gum::instruction_writer::X86Register;
#[cfg(target_arch = "aarch64")]
use capstone::{
arch::{self, arm64::Arm64OperandType, ArchOperand::Arm64Operand},
Insn,
};
#[cfg(target_arch = "aar... |
// Import iced modules.
use iced::{
Column, Container, Element, Length, Sandbox, Settings, Align
};
// Import iced_audio modules.
use iced_audio::{
Normal, FloatParam, LogDBParam, OctaveParam, h_slider, HSlider,
v_slider, VSlider, knob, Knob, xy_pad, XYPad, TickMarkGroup, TickMark,
TickMarkTier
};
// C... |
use std::fmt::Display;
use std::{cmp, error};
#[allow(dead_code)]
pub enum Align {
Left,
Center,
Right,
}
impl Align {
pub fn new() -> Self {
Align::Center
}
}
pub enum Segment {
None,
OnlyHeader,
Full,
}
impl Segment {
pub fn new() -> Self {
Segment::OnlyHeader
... |
/// Enum representing the various kinds of errors
#[derive(Fail, Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
pub enum ErrorKind {
/// Additional data too long. Length in byte... |
// Copyright 2021 Lido
//
// Licensedicensed 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 ... |
#![cfg_attr(feature = "nightly", deny(missing_docs))]
#![cfg_attr(feature = "nightly", feature(external_doc))]
#![cfg_attr(feature = "nightly", doc(include = "../README.md"))]
#![cfg_attr(test, deny(warnings))]
mod iter;
mod page;
pub use crate::iter::Iter;
pub use crate::page::Page;
use std::fs::File;
use std::io;
... |
//-----------------------------------------------------
// Setup.
use aoc::Day;
use nom::{
branch::alt,
bytes::complete::tag,
character::complete::{alpha1, line_ending, u64},
multi::many1,
sequence::tuple,
IResult,
};
use std::{
collections::{HashMap, HashSet},
str,
};
static INPUT: &... |
#![feature(box_syntax)]
extern crate e2d2;
extern crate fnv;
extern crate time;
extern crate getopts;
extern crate rand;
use self::nf::*;
use e2d2::common::*;
use e2d2::config::*;
use e2d2::interface::*;
use e2d2::operators::*;
use e2d2::scheduler::*;
use getopts::Options;
use std::collections::HashMap;
use std::env;
u... |
use amethyst::{
assets::{AssetStorage, Loader},
core::transform::Transform,
ecs::prelude::{Component, DenseVecStorage, Entity},
prelude::*,
renderer::{
Camera, Flipped, PngFormat, Projection, SpriteRender, SpriteSheet, SpriteSheetFormat,
SpriteSheetHandle, Texture, TextureMetadata,
... |
use crate::ndarray_ext::{NdArray, NdArrayView};
use crate::op;
use crate::ops;
use crate::tensor::Tensor;
use crate::Float;
use ndarray;
pub struct SoftmaxCrossEntropy;
pub struct SparseSoftmaxCrossEntropy;
pub struct SparseSoftmaxCrossEntropyGrad;
pub struct SigmoidCrossEntropy;
pub struct LogSoftmax {
pub axis: ... |
use crate::abi::call::{ArgAbi, ArgAttribute, CastTarget, FnAbi, PassMode, Reg, RegKind, Uniform};
use crate::abi::{self, HasDataLayout, LayoutOf, Size, TyAndLayout, TyAndLayoutMethods};
fn extend_integer_width_mips<Ty>(arg: &mut ArgAbi<'_, Ty>, bits: u64) {
// Always sign extend u32 values on 64-bit mips
if le... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use std::collections::BTreeMap;
use move_binary_format::{
errors::{Location, PartialVMError, VMError},
file_format::CodeOffset,
};
use move_core_types::vm_status::StatusCode;
use move_model::ast::TempIndex;
use crate::concrete... |
/*
MIT License
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 without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distrib... |
use std::ffi::OsStr;
use std::env;
use std::path::PathBuf;
use crate::common::Config;
use log::*;
/// Conversion table from triple OS name to Rust SYSNAME
const OS_TABLE: &'static [(&'static str, &'static str)] = &[
("android", "android"),
("androideabi", "android"),
("bitrig", "bitrig"),
("cloudabi",... |
#[macro_use] extern crate rocket;
use rocket::http::RawStr;
use rocket::http::uri::{UriDisplay, Query, Path};
macro_rules! assert_uri_display_query {
($v:expr, $s:expr) => (
let uri_string = format!("{}", &$v as &dyn UriDisplay<Query>);
assert_eq!(uri_string, $s);
)
}
#[derive(UriDisplayQuery... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
mod lexer;
pub(crate) mod syntax;
pub mod ast;
pub mod comments;
pub(crate) mod merge_spec_modules;
pub(crate) mod sources_shadow_deps;
use crate::{
command_line::MOVE_EXTENSION, errors::*, parser, parser::syntax::parse_file_strin... |
use alloc::alloc::{alloc, dealloc, Layout};
use std::cmp::{max, min};
use std::ptr;
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Arc;
use super::*;
#[derive(Debug)]
pub struct RingBuf {
pub reader: RingBufReader,
pub writer: RingBufWriter,
}
impl RingBuf {
pub fn new(capaci... |
// 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 crate::account_handler_context::AccountHandlerContext;
use account_common::{AccountManagerError, LocalAccountId, ResultExt as AccountResultExt};
use an... |
// Copyright 2020 the .NET Foundation
// Licensed under the MIT License.
//! Generic error handling for the WWT aligner frontend, copied from Tectonic.
//!
//! This crate provides a generic boxed error type, plus supporting utilities.
//! In particular:
//!
//! - The basic `Error` type is an `anyhow` 1.x boxed Error
/... |
//! Configuration for DDlog programs
use crate::program::{worker::ProfilingData, Program, PROF_MSG_BUF_SIZE};
use ddlog_profiler::{DDlogSourceCode, Profile};
use differential_dataflow::Config as DDFlowConfig;
use std::{
env,
fmt::{Debug, Error as FmtError, Formatter},
io::Write,
net::SocketAddr,
nu... |
use proc_macro2::Span;
use syn::AttributeArgs;
use syn::Attribute;
use syn::Result;
use syn::spanned::Spanned;
use syn::Error;
use syn::NestedMeta;
use syn::Meta;
use syn::MetaNameValue;
use syn::Lit;
use syn::LitStr;
use syn::Ident;
use syn::Path;
/// Represents bindgen attributes
/// Attribute can be attached to ... |
//! This example showcases a simple native custom widget that renders using
//! arbitrary low-level geometry.
mod rainbow {
// For now, to implement a custom native widget you will need to add
// `iced_native` and `iced_wgpu` to your dependencies.
//
// Then, you simply need to define your widget type a... |
extern crate rocksdb;
use super::rocksdb::Error as RocksError;
use super::rocksdb::{Options, DB};
use super::{ClientDB, DBError, DBValue};
use std::fs;
use std::path::Path;
/// A on-disk database which implements the ClientDB trait.
///
/// This implementation uses RocksDB with default options.
pub struct DiskDB {
... |
extern crate clap;
extern crate regex;
use std::{env, fs, io, thread};
use std::borrow::{Borrow, Cow};
use std::ops::Deref;
use std::path::{Path, PathBuf, StripPrefixError};
use std::sync::{Arc, mpsc};
#[macro_export]
macro_rules! def_from {
($t:ident, $src:ty => $dst:ident) => {
impl From<$src> for $t {
... |
//! This crate provides an encoding from byte to uwu and back.
//! Encode:
//! ```
//! use uwucodec::encode;
//!
//! fn main() {
//! println!("Hello World in uwu is: {}", encode("Hello World".as_bytes()));
//! }
//! ```
//!
//! Decode:
//! ```
//! use uwucodec::decode;
//! fn main() {
//! let text = "omo o~o q_... |
use std::cmp::max;
use std::fs::File;
use std::io::{self, BufRead};
use std::ptr;
#[derive(Debug, Clone)]
struct SNumber {
regular_left: isize,
pair_left: Vec<SNumber>,
regular_right: isize,
pair_right: Vec<SNumber>,
}
fn main() {
let mut lines = io::BufReader::new(File::open("input.txt").unwrap()... |
mod chinachu;
mod record_with_raw;
use std::fs::File;
use std::io::{BufReader, Read};
use std::time::Instant;
use clap::{App, Arg};
use envy::Error;
use serde::Deserialize;
use serde_json::value::RawValue;
use tokio::sync::mpsc;
use tokio_stream::wrappers::ReceiverStream;
use tonic::transport::Uri;
use dtvault_types... |
use std::io::prelude::*;
use std::io::BufReader;
use std::fs::File;
use std::path::Path;
fn lines_from_file<P>(filename: P) -> Vec<String>
where
P: AsRef<Path>,
{
let file = File::open(filename).expect("no such file");
let buf = BufReader::new(file);
buf.lines()
.map(|l| l.expect("Could not par... |
//! Internal API bindings generator for the godot-rust bindings.
//!
//! # Creating custom binding crates
//!
//! It's possible to create custom binding crates without forking the repository by passing
//! custom `api.json` data to `Api::new()`. The JSON data can be generated from Godot using
//! the following command:... |
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License in the LICENSE-APACHE file or at:
// https://www.apache.org/licenses/LICENSE-2.0
//! Layout solver
//!
//! Size units are physical (real) pi... |
use crate::{
ElementId,
Node,
};
/// This trait contains methods that check element's type according to the
/// [SVG spec](https://www.w3.org/TR/SVG/intro.html#Definitions).
///
/// Note that all methods works with `Node` type and will return `false`
/// if node's type is not equal to `NodeType::Element`.
///
... |
//! Unit propagation.
use partial_ref::{partial, PartialRef};
use crate::context::{parts::*, Context};
pub mod assignment;
pub mod binary;
pub mod graph;
pub mod long;
pub mod watch;
pub use assignment::{backtrack, enqueue_assignment, full_restart, restart, Assignment, Trail};
pub use graph::{Conflict, ImplGraph, Im... |
use crate::transport::{
error::{TransportError, TransportResult},
protocol::TransportEvent,
};
use lib3h_protocol::DidWork;
use std::{
collections::{HashMap, VecDeque},
sync::{Mutex, RwLock},
};
use url::Url;
//--------------------------------------------------------------------------------------------... |
#![deny(clippy::float_arithmetic)]
use macros::{
add_assign, d, fmt_debug, fmt_display, integer_newtype, ord, sub_assign, usize_newtype,
};
/// The nth space between utf8 characters. So in the string "aöc" there are
/// five possibe `CharOffset`s. (Note that "ö" is two characters: "o\u{308}".)
/// Here they ... |
use gltf_derive::Validate;
use serde_derive::{Deserialize, Serialize};
/// A node in the node hierarchy. When the node contains `skin`, all
/// `mesh.primitives` must contain `JOINTS_0` and `WEIGHTS_0` attributes.
/// A node can have either a `matrix` or any combination of
/// `translation`/`rotation`/`scale` (TRS) p... |
use actix_web::ResponseError;
use async_trait::async_trait;
use chrono::Utc;
use drogue_cloud_service_api::{
api::{ApiKey, ApiKeyCreated, ApiKeyCreationOptions, ApiKeyData},
auth::user::{UserDetails, UserInformation},
};
use drogue_cloud_service_common::keycloak::{error::Error, KeycloakClient};
use serde_json::... |
//! # commands
//!
//! Manages the pubsub subscriber connection and if needed resubscribes in case of reconnections.
//!
#[cfg(test)]
#[path = "./subscriber_test.rs"]
mod subscriber_test;
use crate::types::{Interrupts, Message, RedisEmptyResult, RedisError};
use std::option::Option;
use std::time::Duration;
/// The ... |
// Copyright (c) The Dijets Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
use crate::{
cluster::Cluster,
experiments::{
compatibility_test::update_batch_instance, Context, Experiment, ExperimentParam,
},
instance,
instance::Instance,
tx_emitter::{exec... |
extern crate proc_macro;
#[macro_use]
extern crate quote;
extern crate syn;
use proc_macro::TokenStream;
use syn::{
Data, DataStruct, DeriveInput, Ident, ImplGenerics, Item,
Meta::{List, NameValue},
NestedMeta::Meta,
TypeGenerics, WhereClause,
};
#[proc_macro_derive(PostgresMapper, attributes(pg_mapp... |
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
use async_std::fs::File;
use async_std::io::BufReader;
use blocks::{BlockHeader, Tipset, TipsetKeys};
use chain::ChainStore;
use cid::Cid;
use fil_types::verifier::ProofVerifier;
use forest_car::{load_car, CarReader};
use futures::Asy... |
//! PKCS#1 RSA private key document.
use crate::{error, DecodeRsaPrivateKey, EncodeRsaPrivateKey, Error, Result, RsaPrivateKey};
use alloc::{borrow::ToOwned, vec::Vec};
use core::{
convert::{TryFrom, TryInto},
fmt,
};
use der::Encodable;
use zeroize::{Zeroize, Zeroizing};
#[cfg(feature = "pem")]
use {
cra... |
use crate::annotations::{Field, FieldAnnotation};
use crate::definitions::{
ColumnDefinition, FieldDefinition, ForeignKeyDefinition, IndexDefinition, TableDefinition,
};
use crate::resolver::error::{DataConvertError, ResolveError};
use crate::resolver::{EntityName, EntityResolver, FieldPath, TypePathResolver};
use ... |
use std::sync::Arc;
use log::{error, info};
use crate::diffs::DiffOfDiffs;
use crate::git::Git;
use crate::git_clone_manager::GitCloneManager;
use crate::worker;
use octobot_lib::errors::*;
use octobot_lib::github;
use octobot_lib::github::api::GithubSessionFactory;
use octobot_lib::github::Commit;
use octobot_lib::m... |
const NMAX: usize = 5536;
const CHUNK_SIZE: usize = 32;
#[derive(Copy, Clone, Debug)]
pub struct State {
state: (u32, u32),
}
impl State {
#[cfg(not(feature = "std"))]
pub fn new(initial: u32) -> Option<Self> {
if cfg!(target_feature = "avx2") {
// SAFETY: Ensure that all required inst... |
//! Serial numbers.
//!
//! This module define a type [`Serial`] that wraps a `u32` to provide
//! serial number arithmetics.
//!
//! [`Serial`]: struct.Serial.html
use std::{cmp, fmt, hash, str};
//------------ Serial --------------------------------------------------------
/// A serial number.
///
/// Serial numb... |
extern crate cssparser;
use cssparser::{Parser, ParserInput, Token};
/// Styleseet適用優先順位を示します
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum CascadeOrder {
/// ブラウザの宣言、一番優先度が低い
Browser,
/// ユーザーの宣言
/// 重要な宣言であればtrue、この場合製作者の内容よりも順位が高い
User(bool),
/// 製作者の宣言
/// 重要な宣言であればtrue
Maker(bo... |
// Copyright 2013 The color-rs developers. For a full listing of the authors,
// refer to the AUTHORS file at the top-level directory of this distribution.
//
// 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 o... |
use std::cmp::Reverse;
use std::collections::{BTreeMap, BinaryHeap};
use std::ops::Add;
type Graph<V, E> = BTreeMap<V, BTreeMap<V, E>>;
// performs Dijsktra's algorithm on the given graph from the given start
// the graph is a positively-weighted undirected graph
//
// returns a map that for each reachable vertex ass... |
use failure::Fallible;
use Elkridge;
use fuse::{FileType, FileAttr, Request};
use rusqlite as sql;
use std::ffi::{OsStr, OsString};
/// Implementation of Filesystem, returning Fallible responses instead of using reply objects
///
/// The major advantage of this is just the use of Try.
pub trait BasicFilesystem {
... |
/*!
# Argyle: Key Kind
**Note:** This is not intended for external use and is subject to change.
*/
use std::num::NonZeroU16;
#[doc(hidden)]
#[derive(Debug, Clone, Copy, Hash, PartialEq)]
/// The `KeyKind` enum is used to differentiate between the types of CLI argument
/// keys [`Argue`](crate::Argue) might encoun... |
// SPDX-License-Identifier: MIT
// Copyright (C) 2018-present iced project and contributors
use crate::enum_utils::to_register;
use core::hash::{Hash, Hasher};
use pyo3::class::basic::CompareOp;
use pyo3::prelude::*;
use pyo3::PyObjectProtocol;
use static_assertions::const_assert_eq;
use std::collections::hash_map::De... |
//! A module to access Rutracker API
use chrono::naive::serde::ts_seconds;
use chrono::naive::NaiveDateTime;
use reqwest::{self, Client, IntoUrl, Url};
use std::collections::HashMap;
pub type Result<T> = std::result::Result<T, failure::Error>;
#[derive(Debug, Fail)]
#[fail(
display = "Rutracker API responded wit... |
use super::MeshBuilder;
use crate::mesh::Meshify;
use glam::Vec3;
use rstar::{RTree, RTreeObject, AABB};
use std::convert::TryInto;
pub struct RstarMeshBuilder {
tree: RTree<MeshBuilderData, rstar::DefaultParams>,
indices: Vec<u32>,
}
const EPSILON: f32 = 1e-4;
#[derive(Clone, Debug)]
struct MeshBuilderData {
... |
// Copyright Materialize, Inc. and contributors. 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 ... |
use super::{CreateAcceptor, MaybeTlsSettings, MaybeTlsStream, TcpBind, TlsError, TlsSettings};
#[cfg(feature = "listenfd")]
use super::{Handshake, MaybeTls, PeerAddress};
use bytes::{Buf, BufMut};
use futures::{future::BoxFuture, FutureExt, Stream, StreamExt};
use openssl::ssl::{SslAcceptor, SslMethod};
use snafu::Resu... |
#![no_std]
use core::cell::UnsafeCell;
use gcn::gx;
use proc_macro_hack::proc_macro_hack;
#[proc_macro_hack]
pub use gcn_fonts_macro::include_font;
pub mod prelude;
use prelude::Glyph;
pub struct DecodedGlyph<'a> {
glyph: &'a Glyph,
advance_x: f32,
width: f32,
height: f32,
}
impl DecodedGlyph<'_> ... |
use super::*;
pub fn new<T: Clone + Copy>(values: Vec<T>, shape_ref: &[usize]) -> Matrix<T> {
if shape_ref.iter().product::<usize>() != values.len() {
panic!("shape dosent match with values")
}
let shape = shape_ref.to_vec();
Matrix { values, shape }
}
pub fn vec_to_matrix<T: Clone + Copy... |
use anyhow::{anyhow, bail, Result};
use async_trait::async_trait;
use bollard::{container, errors, exec, image, models, Docker};
use colored::Colorize;
use futures::prelude::*;
use std::time::Duration;
use tokio::time::Instant;
// tcp port binding from container to host
pub type PortBinding = (u16, u16);
pub struct M... |
use num::BigUint;
use num::traits::Pow;
use serde::{Deserialize, Serialize};
use crate::crypto::group::{Element, Exponent, generator};
/// A proof of posession of the private key.
///
/// This provides the same API as `chaum_pedersen::Proof`, except there is only one property to
/// reason about, so there is only one... |
use crate::core::{ColourModel, Image};
use crate::processing::Error;
use ndarray::prelude::*;
use ndarray::{s, Zip};
use num_traits::{Num, NumAssignOps};
use std::marker::PhantomData;
use std::marker::Sized;
/// Perform image convolutions
pub trait ConvolutionExt
where
Self: Sized,
{
/// Underlying data type t... |
use super::{percent_text, ProgressWindow, WindowConfig, UPDATE_INTERVAL};
use crate::Progress;
use crossbeam_channel::{unbounded, Receiver, Sender};
use gtk::prelude::*;
use lazy_static::lazy_static;
use log::error;
use std::error::Error;
use std::rc::Rc;
use std::sync::Arc;
use std::thread;
use std::time::Duration;
t... |
use crate::{
scene::{
Scene,
node::Node,
},
animation::Animation,
resource::{fbx, fbx::error::FbxError},
engine::resource_manager::ResourceManager,
core::{
pool::Handle,
visitor::{Visit, VisitResult, Visitor},
},
utils::log::Log
};
use std::{
path::{Pa... |
use crate::error::RPCError;
use ckb_core::cell::{CellProvider, CellStatus};
use ckb_core::{transaction::ProposalShortId, BlockNumber};
use ckb_shared::shared::Shared;
use ckb_store::ChainStore;
use ckb_traits::ChainProvider;
use jsonrpc_core::{Error, Result};
use jsonrpc_derive::rpc;
use jsonrpc_types::{
BlockView,... |
use std::{
fs,
path::{Path, PathBuf},
};
use crate::{
core::{output, CliError, LalResult},
storage::{Backend, CachedBackend, Component},
};
fn is_cached(backend: &dyn Backend, name: &str, version: u32, env: &str) -> bool {
get_cache_dir(backend, name, version, env).is_dir()
}
fn get_cache_dir(bac... |
extern crate clap;
extern crate parquet;
use clap::{App, Arg, SubCommand};
use parquet::schema::printer;
use parquet::file::reader::{FileReader, SerializedFileReader};
use parquet::file::metadata::FileMetaData;
use std::fs::File;
use std::path::Path;
fn main() {
let app = App::new("Parquet Viewer")
.about("A CLI t... |
mod events;
mod fonts;
mod shapes;
mod tasks;
mod update;
use deno_bindgen::deno_bindgen;
use sdl2::image::InitFlag;
use sdl2::mouse::Cursor;
use sdl2::render::Texture;
use sdl2::render::WindowCanvas;
use sdl2::surface::Surface;
use sdl2::video::Window;
use sdl2::video::WindowBuilder;
use events::CanvasEvent;
use sh... |
use ttf_parser::GlyphId;
use crate::{Face, Mask};
use crate::buffer::{Buffer, GlyphInfo, GlyphPropsFlags};
use crate::tables::gsubgpos::{LookupFlags, LookupIndex};
use super::{LayoutLookup, LayoutTable, TableIndex, MAX_NESTING_LEVEL};
/// Find out whether a lookup would be applied.
pub trait WouldApply {
/// Whet... |
use super::session::SharedSession;
use crate::auth::UserDetail;
use crate::storage;
use bytes::Bytes;
use lazy_static::*;
use log::warn;
use proxy_protocol::version1::ProxyAddressFamily;
use proxy_protocol::ProxyHeader;
use rand::rngs::OsRng;
use rand::RngCore;
use std::collections::HashMap;
use std::net::IpAddr;
use ... |
use crate::core::error::ContractError;
use crate::core::msg::InitMsg;
use crate::core::state::{config_v2, StateV2};
use crate::migrate::version_info::migrate_version_info;
use cosmwasm_std::{DepsMut, Env, MessageInfo, Response, Uint128};
use provwasm_std::{bind_name, NameBinding, ProvenanceMsg, ProvenanceQuery};
/// S... |
use std::{
collections::BTreeSet,
fmt,
time::{Duration, Instant},
};
use termion::event::Key;
use tui::{
style::{Color, Style},
widgets::{Block, BorderType, Borders},
};
use super::game::{Coordinate, Difficulty, Game, Rule, Status, COLS, ROWS};
pub struct App {
pub title: String,
pub should_quit: bool,... |
use std::cmp::max;
use std::fmt;
use crate::{FretID, Semitones, UkeString, Voicing, MIN_CHART_WIDTH};
pub struct ChordChart {
voicing: Voicing,
/// Number of frets to use to display the chord voicing
width: Semitones,
}
impl ChordChart {
pub fn new(voicing: Voicing, width: Semitones) -> Self {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.