text stringlengths 9.08k 47.9k |
|---|
use crate::{boilerplate::Application, physics};
use m3d::Mesh;
#[cfg(feature = "glsl")]
use vangers::render::{
body::{GpuStore, GpuStoreInit},
collision::{GpuCollider, GpuEpoch},
};
use vangers::{
config, level, model,
render::{body::GpuBody, debug::LineBuffer, object::BodyColor, Batcher, Render, Screen... |
use std::{
fs::File,
io::{BufReader, Read},
path::PathBuf,
};
use clap::{AppSettings, Clap};
type BoxError = Box<dyn std::error::Error + Send + Sync>;
mod parser {
use std::fmt::Debug;
use num_derive::{FromPrimitive, ToPrimitive};
#[allow(unused_imports)]
use num_traits::{FromPrimitive, ... |
//! The `gpsd_proto` module contains types and functions to connect to
//! [gpsd](http://catb.org/gpsd/) to get GPS coordinates and satellite
//! information.
//!
//! `gpsd_proto` uses a plain TCP socket to connect to `gpsd`, reads
//! and writes JSON messages. The main motivation to create this crate
//! was independe... |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
anyhow::Error,
bt_a2dp::{codec::MediaCodecConfig, media_task::*},
bt_a2dp_metrics as metrics,
bt_avdtp::{self as avdtp, MediaStream},... |
extern crate regex;
use regex::Regex;
//
// Rust is a statically typed language: without actually running the program, the compiler checks
// that every possible path of execution will use values only in ways consistent with their types.
// This allows Rust to catch many programming mistakes early, and is crucial to Ru... |
//! Operations on backup files.
//!
//! This sub-module provides information about a backup, by looking at the files present in a
//! backup directory.
mod file_naming;
use std::fmt::{Display, Error, Formatter};
use std::path::Path;
use std::slice;
use time::Timespec;
use self::file_naming as fnm;
use self::file_nam... |
use crate::jambler::JamBLErHalError;
use crate::jambler::HalHarvestedPacket;
use crate::jambler::state::StateMessage;
use crate::jambler::state::DiscoveredAccessAddress;
use crate::jambler::StateReturn;
use super::StateParameters;
use crate::jambler::state::IntervalTimerRequirements;
use crate::jambler::state::StateCon... |
use std::cmp::Ordering;
use crate::arithmetic::sliceops::*;
use crate::arithmetic::inlineops::*;
use crate::arithmetic::muldiv::*;
use crate::arithmetic::sign::Sign;
use crate::arithmetic::conversion::*;
use crate::primes::PRIMELIST;
use crate::primes::MERSENNE_LIST;
use crate::traits::NumberTheory;
#[derive(Debug... |
use crate::adapters::SparseTilesFillAdapter;
use crate::engine::{QueryContext, QueryProcessor, RasterQueryProcessor};
use crate::error;
use crate::util::Result;
use futures::future::BoxFuture;
use futures::{
ready,
stream::{BoxStream, TryFold},
FutureExt, TryFuture, TryStreamExt,
};
use futures::{stream::Fu... |
use anyhow::Result;
use bounded_vec_deque::BoundedVecDeque;
use num::FromPrimitive;
use once_cell::sync::Lazy;
use std::{
collections::HashMap,
sync::Mutex,
time::{Duration, Instant, SystemTime},
};
use super::histogram::StatHistogram;
use super::{FileWriter, StatConfig, StatLogSink};
/// Value and wall t... |
//! Library to query **IP2Proxy BIN Data** files. They contain known proxies,
//! geolocation information, and other meta data for IP address ranges.
//!
//! [https://www.ip2location.com/](https://www.ip2location.com/) is a
//! commercial provider, offering various database files for download.
//!
//! Supports IPv4 and... |
// Validate AST before lowering it to HIR
//
// This pass is supposed to catch things that fit into AST data structures,
// but not permitted by the language. It runs after expansion when AST is frozen,
// so it can check for erroneous constructions produced by syntax extensions.
// This pass is supposed to perform onl... |
use anyhow::Error;
use ethabi::{Error as ABIError, Function, ParamType, Token};
use futures::Future;
use mockall::automock;
use mockall::predicate::*;
use std::cmp;
use std::collections::{HashMap, HashSet};
use std::fmt;
use std::marker::Unpin;
use thiserror::Error;
use tiny_keccak::keccak256;
use web3::types::{Address... |
#![deny(missing_docs)]
//! This module provides translation for bitfield structs and operations on them. Generated code
//! requires the use of the c2rust-bitfields crate.
use std::collections::HashSet;
use std::ops::Index;
use super::TranslationError;
use crate::c_ast::{
BinOp, CDeclId, CDeclKind, CExprId, CExpr... |
use std::collections::HashMap;
use indy::cache;
use indy::future::Future;
use indy::ledger;
use serde_json;
use crate::{settings, utils};
use crate::error::prelude::*;
use crate::libindy::utils::pool::get_pool_handle;
use crate::libindy::utils::wallet::get_wallet_handle;
use crate::utils::random::generate_random_did;... |
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
anyhow::Result,
errors::{ffx_bail, ffx_error},
ffx_core::ffx_plugin,
ffx_pdk_lib::groups::{ArtifactStore, ArtifactStoreEntry, Artifac... |
//! encode and decode the frames for the mux protocol.
//! The frames include the length of a PDU as well as an identifier
//! that informs us how to decode it. The length, ident and serial
//! number are encoded using a variable length integer encoding.
//! Rather than rely solely on serde to serialize and deserializ... |
use crate::font::Font;
use crate::tables::cff::{cff_char_string::*, cff_data::*};
use crate::types::u24;
use crate::util::{Buffer, ReadBuffer};
use read_buffer_derive::ReadBuffer;
use std::fmt;
/// ## `CFF` — Compact Font Format table
///
/// Specification: <https://docs.microsoft.com/en-us/typography/opentype/s... |
/*
* Copyright (c) 2020 TensorBase, and its contributors
* All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* U... |
#![windows_subsystem = "windows"]
extern crate bear_lib_terminal;
extern crate tinyfiledialogs;
extern crate arraydeque;
extern crate pir_8_emu;
extern crate dlopen;
extern crate time;
use arraydeque::{ArrayDeque, Wrapping as ArrayDequeBehaviourWrapping};
use bear_lib_terminal::terminal::{self, KeyCode, Event};
use d... |
// The MIT License (MIT)
// Copyright (c) 2014 <NAME> <<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, co... |
//! Module for analysis related to fire weather and wildfire plumes.
use crate::{
error::{AnalysisError, Result},
parcel::Parcel,
sounding::Sounding,
};
use itertools::{izip, Itertools};
use metfor::{
Celsius, CelsiusDiff, GigaWatts, HectoPascal, Kelvin, KelvinDiff, Meters, MetersPSec, Quantity,
Wi... |
mod packet;
use packet::{hex_to_word, word_to_hex, validate_packet, get_checksum_hex, get_u8_from_hex, leading_alpha};
mod query;
use query::{Query, Set};
use std::collections::{HashSet, VecDeque};
use std::env;
use std::ffi::{OsString};
use std::io::prelude::*;
use std::io::{Read};
use std::net::{TcpStream, TcpListe... |
// Bitcoin Pro: Professional bitcoin accounts & assets management
// Written in 2020-2021 by
// Dr. <NAME> <<EMAIL>>
//
// To the extent possible under law, the author(s) have dedicated all
// copyright and related and neighboring rights to this software to
// the public domain worldwide. This software is distribut... |
// vim: tw=80
use crate::{
label::*,
types::*,
util::*,
vdev::*
};
use divbuf::DivBuf;
use futures::{
Future,
TryFutureExt,
future,
task::{Context, Poll}
};
#[cfg(test)] use mockall::mock;
use nix::libc::{c_int, off_t};
use num_traits::FromPrimitive;
use serde_derive::{Deserialize, Seri... |
use error::{Error};
use log_entry::LogEntry;
use panic_payload;
use primitive_types::{H256, U256};
use schedule::Schedule;
use state::State;
use address::Address;
use types::{ActionParams, ActionType};
use wasmi::{MemoryRef, RuntimeArgs, RuntimeValue};
pub struct Runtime<'a> {
schedule: &'a Schedule,
gas_counter: u6... |
use bytes::{Buf, BufMut, BytesMut};
use lzzzz::lz4;
use std::str;
use crate::mgmt::{BaseCommandKind, BMS, WRITE};
use crate::ch::blocks::Block;
use crate::ch::codecs::{BytesExt, CHMsgReadAware, CHMsgWriteAware};
use crate::ch::protocol::{
ClientCodes, ClientInfo, ConnCtx, Interface, QueryKind, ServerCodes,
};
use... |
use crate::{
dns::Resolver,
emit,
event::Event,
internal_events::{ElasticSearchEventReceived, ElasticSearchMissingKeys},
region::{region_from_endpoint, RegionOrEndpoint},
sinks::util::{
encoding::{EncodingConfigWithDefault, EncodingConfiguration},
http::{BatchedHttpSink, HttpClie... |
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// https://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT o... |
use std::collections::HashMap;
use crate::{
client::{
render::{
ui::{
glyph::GlyphRendererCommand,
layout::{Anchor, Layout, ScreenPosition, Size},
quad::{QuadRendererCommand, QuadTexture},
},
GraphicsState,
},
... |
/*
This program is free to use under the terms of the Blue Oak Model License 1.0.0.
See: https://blueoakcouncil.org/license/1.0.0
*/
//! This is the example implementation of STEP 3 of the SPECTRUSTY tutorial using `minifb` framebuffer
//! and the `cpal` audio layer.
//!
//! See: https://github.com/royaltm/spec... |
use std::fmt;
use std::time::{SystemTime, UNIX_EPOCH};
use lazy_static::lazy_static;
use num_traits::{abs, Num};
use serde::de::{SeqAccess, Visitor};
use serde::ser::SerializeTupleStruct;
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use crate::bitfield;
use crate::texture_set::G_MAG;
/// Multip... |
// -*- mode: rust; -*-
//
// This file is part of reddsa.
// Copyright (c) 2020-2021 Zcash Foundation
// See LICENSE for licensing information.
//
// Authors:
// - <NAME> <<EMAIL>>
// - <NAME> <<EMAIL>>
// - is<NAME> <<EMAIL>>
//! An implementation of FROST (Flexible Round-Optimized Schnorr Threshold)
//! signatures.
... |
use crate::codec::redis::redis_query_type;
use crate::frame::{
cassandra,
cassandra::{CassandraMetadata, CassandraOperation},
};
use crate::frame::{CassandraFrame, Frame, MessageType, RedisFrame};
use anyhow::{anyhow, Result};
use bigdecimal::BigDecimal;
use byteorder::{BigEndian, WriteBytesExt};
use bytes::{Bu... |
use futures::sync::mpsc::{channel, Sender};
use futures::sync::oneshot;
use semver::{Version, VersionReq};
use tiny_keccak::keccak256;
use std::collections::HashMap;
use std::str::FromStr;
use std::thread;
use std::time::{Duration, Instant};
use super::MappingContext;
use crate::module::{ValidModule, WasmiModule, Was... |
// Copyright 2017-2018 the authors. See the 'Copyright and license' section of the
// README.md file at the top-level directory of this repository.
//
// Licensed under the Apache License, Version 2.0 (the LICENSE-APACHE file) or
// the MIT license (the LICENSE-MIT file) at your option. This file may not be
// copied, ... |
use std::{
collections::HashMap,
fs, io,
path::Path,
str::FromStr,
sync::{Arc, Mutex},
};
use super::super::{Concrete, ElementList, Point, Polytope, RankVec, Subelements};
use crate::{
lang::name::{Con, Name},
polytope::{
r#abstract::{
elements::{AbstractBuilder, Subelem... |
#![deny(
dead_code,
nonstandard_style,
unused_imports,
unused_mut,
unused_variables,
unused_unsafe,
unreachable_patterns
)]
extern crate structopt;
use std::env;
use std::fs::{read_to_string, File};
use std::io;
use std::io::Read;
use std::path::PathBuf;
use std::process::exit;
use std::str... |
pub mod error;
pub mod graphql;
mod indexing;
mod persistent_sequence;
use self::error::{Error, ErrorKind, Result};
use self::graphql::Context;
use self::indexing::{
Addresses, Blocks, ChainLengths, EpochData, Epochs, ExplorerAddress, ExplorerBlock,
ExplorerVotePlan, ExplorerVoteProposal, ExplorerVoteTally, St... |
mod client;
mod informer;
mod metrics;
pub(crate) mod reconcile;
pub(crate) mod resource_map;
mod server;
#[cfg(feature = "testkit")]
pub mod testkit;
#[cfg(feature = "testkit")]
use crate::resource::ObjectIdRef;
use crate::config::{ClientConfig, OperatorConfig, UpdateStrategy};
use crate::handler::{Handler, SyncReq... |
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
#![deny(missing_docs)]
#![deny(warnings)]
/// The module which parses command parameters from command-line arguments.
pub mod commands_parser;
/// The module which provides mappings between NitroCliErrors ... |
mod attestation_service;
mod beacon_node_fallback;
mod block_service;
mod check_synced;
mod cli;
mod config;
mod duties_service;
mod fee_recipient_file;
mod graffiti_file;
mod http_metrics;
mod key_cache;
mod notifier;
mod preparation_service;
mod signing_method;
mod sync_committee_service;
mod doppelganger_service;
p... |
// Copyright 2016 Mozilla Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
/*
* Copyright (c) 2019 c-mnd
*
* MIT License
*
* 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, me... |
use std::collections::HashMap;
use airtable_api::{Airtable, Record};
use anyhow::Result;
use chrono::{Duration, NaiveDate, Utc};
use google_calendar::types::Event;
use handlebars::Handlebars;
use log::{debug, info, warn};
use sendgrid_api::{traits::MailOps, Client as SendGrid};
use crate::{
airtable::{AIRTABLE_DI... |
#![allow(non_snake_case)]
use std::collections::BTreeMap;
use std::collections::HashSet;
use std::fmt;
use context::Context;
use core;
use core::BuiltinType::*;
use core::BuiltinValue::*;
use core::Const::*;
use core::Expr::*;
use core::{app, pi};
use core::{bx, normalize, shift, subst, Expr, V, X};
use self::TypeMes... |
#![allow(clippy::zero_prefixed_literal)]
use crate::utils;
use crate::{Cmd, Event, ServerInfo};
use libtiny_common::{ChanName, ChanNameRef};
use libtiny_wire as wire;
use libtiny_wire::{Msg, Pfx};
use std::cell::RefCell;
use std::collections::HashSet;
use std::rc::Rc;
use tokio::sync::mpsc::{Receiver, Sender};
use t... |
use lapce_core::indent::IndentStyle;
use lapce_rpc::buffer::BufferId;
use lsp_types::Position;
use std::borrow::Cow;
use std::cmp::Ordering;
use std::ops::Range;
use std::sync::atomic::{self, AtomicU64};
use std::{collections::BTreeSet, sync::Arc};
use xi_rope::{multiset::Subset, rope::Rope, DeltaBuilder, RopeDelta};
u... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Clock control, can be changed on-the-fly (except for auxsrc)"]
pub clk_gpout0_ctrl: crate::Reg<clk_gpout0_ctrl::CLK_GPOUT0_CTRL_SPEC>,
#[doc = "0x04 - Clock divisor, can be changed on-the-fly"]
pub clk_gpout0_div: crate::Re... |
use std::{
collections::{HashMap, HashSet},
path::PathBuf,
sync::Arc,
};
use bstr::ByteSlice;
use crossbeam::channel::Sender;
pub mod filter;
pub mod records_list;
pub use filter::*;
pub use records_list::*;
#[allow(unused_imports)]
use handlegraph::{
handle::{Direction, Handle, NodeId},
handleg... |
// Copyright 2022 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.
//! Defines the buffer traits needed by the TCP implementation. The traits
//! in this module provide a common interface for platform-specific buffers
//! ... |
/// PBR Render Routine for rend3.
/// target: todo!(), clear: todo!(), resolve: todo!() target: todo!(), clear: todo!(), resolve: todo!() target: todo!(), clear: todo!(), resolve: todo!() target: todo!(), clear: todo!(), resolve: todo!()
/// Contains [`PbrMaterial`] and the [`PbrRenderRoutine`] which serve as the de... |
use hashbrown::HashMap;
use inkwell::{
builder::Builder,
context::Context,
module::Module,
types::{BasicType, FloatType, FunctionType, IntType, PointerType, StructType, VoidType},
values::{BasicValue, BasicValueEnum, FloatValue, FunctionValue, IntValue, PointerValue},
AddressSpace,
};
use std::m... |
use super::atom_info::{AtomIdent, AtomInfo};
use super::read::{nested_atom, skip_unneeded};
use super::trak::Trak;
use crate::error::{ErrorKind, FileDecodingError, LoftyError, Result};
use crate::file::FileType;
use crate::macros::try_vec;
use crate::properties::FileProperties;
use std::io::{Cursor, Read, Seek, SeekFr... |
use crate::Color;
/// `@class` Palette
///
/// Representa uma paleta de cores usada por um bitmap.
pub struct Palette {
/// `@private`
/// Array de cores da paleta.
colors: Vec<Color>,
/// `@private`
/// Cor padrΓ£o (obtida atravΓ©s de um Γndice de cor invΓ‘lido).
default_color: Color... |
// Copyright 2015 <NAME>. See the COPYRIGHT
// file at the top-level directory of this distribution.
use std::boxed::Box;
use std::env;
use std::fs::File;
use std::io::Write;
use std::ops::Deref;
use std::panic;
use std::path::Path;
use std::str::FromStr;
use std::time::Duration;
use minidump::*;
use minidump_process... |
use proc_macro::TokenStream;
use proc_macro2::{Ident, Span};
use quote::{quote, ToTokens};
use syn::{
parse::{Parse, ParseStream},
punctuated::Punctuated,
Attribute, Data, DataStruct, DeriveInput, Field, Fields, GenericArgument, GenericParam,
Lifetime, LifetimeDef, Path, PathArguments, ReturnType, Token... |
// Copyright 2021 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.
//! Write Machina virtio devices in Rust.
//!
//! This crate aims to simplify the writing of virtio devices as out of process FIDL services by
//! automati... |
use crate::load::{hanzi2word, word2hanzi};
use crate::max_lines::*;
use crate::HB;
use jieba_rs::Jieba;
use pbr::ProgressBar;
use pinyin;
use rand::{seq::SliceRandom, thread_rng};
use rayon::current_num_threads;
use rayon::prelude::*;
use serde_json::Value;
use std::collections::{HashMap, HashSet};
use std::fs::{self, ... |
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
//! This module contains the transactional test runner instantiation for the Sui adapter
use crate::{args::*, in_memory_storage::InMemoryStorage};
use anyhow::{anyhow, bail};
use bimap::btree::BiBTreeMap;
use itertools::Itertools;
use mov... |
use std::borrow::{Borrow, Cow};
use std::cell::RefCell;
use std::io::BufRead;
use std::marker::PhantomData;
use std::sync::atomic::AtomicUsize;
use std::sync::Arc;
use std::{mem, u64};
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use crc32fast::Hasher;
use protobuf::Message;
use crate::cache_evict::CacheT... |
//! This file defines the various tokens requried by the Enso lexer.
//!
//! This file makes heavy use of terminology from the Enso design documentation, particularly the
//! [syntax](https://dev.enso.org/docs/enso/syntax) documentation. For the sake of brevity, many
//! terms will _not_ be defined here.
use crate::pr... |
use super::action::{AcType, DAction};
use super::browser::BrowserCallbacks;
use super::context::{
str_hex_to_utf8, DContext, STATE_CURRENT, STATE_EXIT, STATE_PREV, STATE_ZERO,
};
use super::debot_abi::DEBOT_ABI;
use super::errors::Error;
use super::calltype;
use super::calltype::DebotCallType;
use super::routines;
... |
mod blocks;
use self::blocks::{Block, BlockKind, Connector, FallingBlockChunk};
use crate::{drawutils, Gamemode, Globals, ModeDenoument, Transition, HEIGHT, WIDTH};
use cogs_gamedev::{directions::Direction4, int_coords::ICoord};
use drawutils::mouse_position_pixel;
use itertools::Itertools;
use quad_rand::com... |
//! ```ascii
//! ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
//! β _______ __ __ ______ _______ ______ _______ _ _ _______ _ _ _______ β
//! β | \_/ |_____] |______ |_____/ |______ |_____| |_____| |____/ |______ β
//! β |_____ | |__... |
// Copyright 2018-2020, Wayfair GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
use cgmath::{self, Angle, InnerSpace};
use config::configloader::Config;
use ecs::components::*;
use graphics::pipeline::PipelineSettings;
use graphics::*;
use log::warn;
use objects::Objects;
use rayon::ThreadPool;
use specs::{Entity, Join, World};
use std::{boxed::Box, sync::Arc};
use vulkano::{
buffer::{
... |
use data::{ast, types};
use data::types::Typeable;
use std::fmt::{Write, Display, Formatter, Error};
use std::collections::HashMap;
mod strings_collect;
pub fn translate(ast: &ast::AttrProgram, funcs: HashMap<String, types::InternalType>) -> String {
let mut translator = Translator::new();
translator.translat... |
use super::instruction::Condition::*;
use super::instruction::Opcode;
use super::instruction::Opcode::*;
use super::instruction::OperandType;
use super::instruction::OperandType::*;
pub(super) const INSTRUCTIONS: &[(Opcode, (OperandType, OperandType)); 256] = &[
(Nop, (Implied, Implied)),
(Ld, (RegBC, Imm16)),... |
use anyhow::{bail, Result};
use nix::sys::stat::SFlag;
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, convert::TryFrom, path::PathBuf};
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
/// Linux contains platform-specific configuration for Linux ba... |
extern crate sdl2;
extern crate fps_clock;
extern crate tinyfiledialogs;
#[macro_use]
extern crate lazy_static;
use std::cmp::PartialEq;
use std::io;
use std::io::prelude::*;
use std::fs::File;
use std::env;
use sdl2::video::Window;
use sdl2::render::Canvas;
use sdl2::EventPump;
use sdl2::pixels::Color;
use sdl2::eve... |
// This file is part of Sulis, a turn based RPG written in Rust.
// Copyright 2018 <NAME>
//
// Sulis 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 opt... |
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // Hide console window at Windows
mod config;
mod image_loader;
mod logger;
mod state;
mod texture;
mod utils;
#[cfg(windows)]
mod common_win32;
use crate::image_loader::{ImageCache, ImageLoader, Size2d};
use crate::logger::ResultLogging;
use crate::... |
/* ************************************************************************ **
** This file is part of rsp2, and is licensed under EITHER the MIT license **
** or the Apache 2.0 license, at your option. **
** **
** ... |
use std::collections::{HashMap, HashSet};
use std::iter;
use std::time::{Instant, SystemTime, UNIX_EPOCH};
use super::validation;
use graph::data::subgraph::schema::{
generate_entity_id, SubgraphDeploymentAssignmentEntity, SubgraphDeploymentEntity,
SubgraphEntity, SubgraphVersionEntity, TypedEntity,
};
use gra... |
use bitcoin::blockdata::transaction::Transaction;
use bitcoin::consensus::encode::{deserialize, serialize};
use bitcoin::hashes::hex::{FromHex, ToHex};
use bitcoin::hashes::{sha256d::Hash as Sha256dHash, Hash};
use error_chain::ChainedError;
use serde_json::{from_str, Value};
use std::collections::HashMap;
use std::io:... |
#![type_length_limit = "10000000"]
mod instrumentation;
pub mod node;
use cfg_if::cfg_if;
cfg_if! {
if #[cfg(feature = "monitoring")] {
use tracing_subscriber::{
filter::EnvFilter,
fmt::{time::ChronoUtc, Subscriber},
};
use node::LogWriter;
}
}
#[cfg(feature = ... |
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to... |
// Copyright 2021 Google 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 to in w... |
use bellperson::bls::{Bls12, Engine, Fr, FrRepr};
use bellperson::gadgets::num::AllocatedNum;
use bellperson::groth16::{
aggregate::{
aggregate_proofs, setup_fake_srs, verify_aggregate_proof, AggregateProof, GenericSRS,
},
create_random_proof, generate_random_parameters, prepare_verifying_key, verif... |
use super::item::{ParseItem, ParseItemSet, ParseItemSetCore};
use super::item_set_builder::ParseItemSetBuilder;
use crate::error::{Error, Result};
use crate::generate::grammars::{
InlinedProductionMap, LexicalGrammar, SyntaxGrammar, VariableType,
};
use crate::generate::node_types::VariableInfo;
use crate::generate... |
// 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.
#![deny(warnings)]
use failure::{format_err, Error, Fail};
use std::borrow::Cow;
use std::collections::HashMap;
use std::ops::Deref;
use std::sync::Arc;
u... |
use crate::{database::DatabaseGuard, ConduitResult, Database, Error, Result, Ruma, RumaResponse};
use ruma::{
api::client::r0::{
filter::{IncomingFilterDefinition, LazyLoadOptions},
sync::sync_events,
uiaa::UiaaResponse,
},
events::{
room::member::{MembershipState, RoomMember... |
//! Field arithmetic modulo p = 2^{224}(2^{32} β 1) + 2^{192} + 2^{96} β 1
#![allow(clippy::assign_op_pattern, clippy::op_ref)]
use crate::{
arithmetic::util::{adc, mac, sbb},
FieldBytes,
};
use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign};
use elliptic_curve::{
ff::Field,
rand_cor... |
// Copyright (c) 2021 Quark Container 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 ... |
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use crate::*;
#[test]
fn... |
use crate::ffi::VmaAllocationCreateInfo;
use crate::{ffi, AllocatorPool};
use ash::vk::PhysicalDevice;
use ash::{Device, Instance};
use bitflags::bitflags;
use std::ptr;
/// Intended usage of memory.
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord)]
pub enum MemoryUsage {
/// No intended memory u... |
// Copyright 2014 The Gfx-rs Developers.
//
// 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 serde_json;
use serde_derive::Deserialize;
use crate::utils::hex_to_uint256;
use crate::{BlockHeaderData, BlockSource, BlockSourceRespErr};
use bitcoin::hashes::hex::{ToHex, FromHex};
use bitcoin::hash_types::{BlockHash, TxMerkleNode};
use bitcoin::blockdata::block::{Block, BlockHeader};
use bitcoin::consensus:... |
//! Small [Shadertoy](http://shadertoy.com) browser & viewer for Mac built in [Rust](https://www.rust-lang.org).
//!
//! This application uses the [Shadertoy REST API](http://shadertoy.com/api) to search for Shadertoys and then downloads them locally and converts them using [`shaderc-rs`](https://crates.io/crates/shade... |
use std::path;
use std::result;
use std::cmp;
use std::slice;
use std::mem;
use sdl2::VideoSubsystem;
use sdl2::rect::Rect;
use sdl2::render::{Renderer, Texture, BlendMode};
use sdl2::image::{LoadTexture, LoadSurface};
use sdl2::pixels::Color;
use sdl2::ttf::Font;
use sdl2::surface::Surface;
use ecs::*;
use game::*;
... |
// Copyright 2018 int08h, LLC all rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... |
use std::cmp::Ordering;
use std::collections::HashMap;
use std::default::Default;
use std::ffi::{OsStr, OsString};
use std::fs::File;
use std::io::{Read, Write};
use std::path::{Path, PathBuf};
use std::process::Command;
use std::u32;
use heck::{CamelCase, SnakeCase};
use xml::reader::{EventReader, XmlEvent};
use cra... |
//! Fuse-driven access to revisions with in-memory COW
use crate::backend::{self, Backend, Rev, RevError};
use crate::chunkvec::{ChunkId, RevisionMap};
use crate::{pos2chunk, CHUNKSZ, CHUNKSZ_LOG, ZERO_CHUNK};
use fnv::FnvHashMap as HashMap;
use log::{debug, info};
use lru::LruCache;
use murmur3::murmur3_x64_128;
use... |
use std::{
cell::RefCell,
collections::{HashMap, HashSet},
env,
error::Error,
fs::read_to_string,
io, iter,
path::PathBuf,
rc::Rc,
};
use lsp_server::{Connection, Message, Request, RequestId, Response};
use lsp_types::{
notification::{
DidChangeTextDocument, DidCloseTextDocu... |
#![allow(unused)]
use std::io::{self, Write};
use std::ops::Sub;
use std::sync::{Arc, Mutex};
use std::time::Duration;
use consecrates::api::{CrateResponse, Crates};
use consecrates::Client;
use anyhow::Result;
use chrono::{DateTime, Utc};
use crossterm::event::{read, Event, KeyCode, KeyEvent, KeyModifiers};
use htt... |
//! Calculate the permissions of a member on a guild-level or a channel-level.
//!
//! # Examples
//!
//! ## Calculating member permissions in a channel
//!
//! Take a scenario where a member has two roles: the `@everyone` role (with the
//! same ID as the guild) that grants the [View Channel] permission across the
//!... |
mod forloop;
#[cfg(test)]
mod tests;
use std::collections::HashMap;
use serde_json::to_string_pretty;
use serde_json::value::{Value, to_value, Number};
use serde_json::map::{Map as JsonMap};
use self::forloop::{ForLoop};
use parser::ast::*;
use template::Template;
use tera::Tera;
use errors::{Result, ResultExt};
use... |
//! An abstraciton layer for talking to an underlying X server.
//!
//! An implementation of the [XConn] trait is required for running a [WindowManager][1]. The choice
//! of back end (e.g. xlib, xcb...) is an implementation detail that does not surface in the
//! `WindowManager` itself. All low level details of workin... |
use serde_derive::{Deserialize, Serialize};
use crate::params::Timestamp;
/// An enum representing the versions of the Stripe API.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum ApiVersion {
#[serde(rename = "2011-01-01")]
V2011_01_01,
#[s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.