text stringlengths 3.09k 13.9k |
|---|
#![allow(clippy::type_complexity)]
mod ecs;
use amethyst::{
core::{frame_limiter::FrameRateLimitStrategy, transform::TransformBundle},
network::{NetworkBundle, ServerConfig},
prelude::{Application, GameDataBuilder},
LogLevelFilter, LoggerConfig, StdoutLog,
};
use laminar::Config as LaminarConfig;
use ... |
/*use rocket::data::{FromData, Outcome, Transform, Transformed};
use rocket::http::Status;
use rocket::{Data, Outcome::*, Request};
use std::io::{self, Read};
*/
use std::{
collections::HashSet,
convert::TryFrom,
time::{Duration, SystemTime},
};
use rand::{distributions::Alphanumeric, prelude::*};
use u... |
extern crate nalgebra as na;
use na::{Point3, Vector3};
use ncollide3d::shape::{Ball, Cuboid, ShapeHandle};
use nphysics3d::force_generator::DefaultForceGeneratorSet;
use nphysics3d::joint::{DefaultJointConstraintSet, RevoluteJoint};
use nphysics3d::object::{
Body, BodyPartHandle, BodyStatus, ColliderDesc, Default... |
// Copyright © 2021 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
use crate::vhdx_bat::{BatEntry, VhdxBatError};
use crate::vhdx_header::{self, RegionInfo, RegionTableEntry, VhdxHeader, VhdxHeaderError};
use crate::vhdx_io::{self, VhdxIoError};
use crate::vhdx_metadata::{DiskSpec, VhdxMetadataError};
use... |
use crate::{
core::{
algebra::{Scalar, Vector2},
math::Rect,
num_traits::{cast::*, NumAssign},
pool::Handle,
},
grid::{Column, GridBuilder, Row},
message::{MessageDirection, UiMessage, UiMessageData, Vec2EditorMessage},
text::TextBuilder,
vec::vec2::Vec2EditorBuil... |
use anyhow::{anyhow, Result};
use chrono::NaiveDateTime;
use diesel::prelude::*;
use futures::{join, try_join};
use serenity::{
framework::standard::macros::hook,
model::{channel::Message, id::ChannelId},
prelude::*,
utils::MessageBuilder,
};
use crate::{
discord::{
channel_groups::{get_gro... |
use std::{convert::TryFrom, future::Future, pin::Pin, sync:: Arc};
use arrayref::array_ref;
use pin_project::pin_project;
use async_std::{channel::Sender, io::{
Read,
Write,
BufRead,
BufReader,
}, task::{Context, Poll, block_on}};
use crate::{event_message::{parse::{message, sig_coun... |
use super::data::State;
// addr (add register) stores into register C the result of adding register A and register B.
pub fn addr(state: &mut State, a: i128, b: i128, c: i128) {
apply_rr(state, a, b, c, |x, y| x + y);
}
// addi (add immediate) stores into register C the result of adding register A and value B.
pub ... |
mod sdf;
mod geometry;
mod camera;
use std::{
time::{SystemTime},
sync::{mpsc},
io::{stdout, Write, Stdout},
process,
thread::{self}
};
use crossterm::{
event::{self, Event},
ExecutableCommand, QueueableCommand,
cursor, style::{self, Colorize}, Result, terminal
};
use geometry::{Vec2D, ... |
use std::collections::VecDeque;
use std::iter::FromIterator;
fn main() {
let input = include_str!("../../input/16.txt");
println!("Part 1: {}", part_1(input));
println!("Part 2: {}", part_2(input));
}
fn parse_input(s: &str) -> VecDeque<char> {
VecDeque::from_iter(
s.chars()
.filte... |
// 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 ... |
use crate::components::player::*;
use amethyst::{
animation::{
self, AnimationCommand, AnimationControlSet, AnimationSampling, AnimationSet, EndControl,
StepDirection,
},
core::{math::*, SystemDesc, Transform},
derive::SystemDesc,
ecs::{prelude::Entities, Join, Read, ReadStorage, Sys... |
use std::collections::BTreeMap;
use crate::builtins::Builtin;
use crate::error::Error;
use crate::operations::OpKind;
use crate::semantics::Universe;
use crate::syntax::visitor;
use crate::syntax::*;
pub type Integer = i64;
pub type Natural = u64;
pub type Double = NaiveDouble;
/// Double with bitwise equality
#[der... |
// This module captures all relevant information from all areas.
//
use std::rc::Rc;
use std::str::FromStr;
use std::option::Option;
use std::net::{SocketAddr};
use ini;
use country::{country_hash,MAX_COUNTRY_HASH};
#[derive(Debug)]
pub struct Node {
id: u8,
name: String,
probe: Option<String>,
country... |
use crate::misc::Vector2;
use ggez::event::{KeyCode, MouseButton};
use imgui::*;
use std::collections::HashSet;
#[derive(Copy, Clone, PartialEq)]
pub enum DisplayFlowField {
Cost,
Integration,
}
#[derive(Copy, Clone, PartialEq)]
pub enum CursorControl {
CostDrawing,
TripSetting,
}
pub struct HighLeve... |
use alloc::borrow::ToOwned;
use alloc::boxed::Box;
use alloc::collections::VecDeque;
use alloc::sync::Arc;
use core::alloc::{GlobalAlloc, Layout};
use core::borrow::Borrow;
use core::borrow::BorrowMut;
use core::cell::RefCell;
use core::fmt::{Debug, Error, Formatter};
use core::ops::{Deref, DerefMut};
use core::{mem, p... |
//! Actions on the UI triggered by keybindings.
use std::collections::HashMap;
use anyhow::anyhow;
use gdk::ModifierType;
use gdk::keys::{self, Key};
use log::debug;
use serde::{Serialize, Deserialize};
use crate::input::MappingDefinition;
/// Mappable actions
#[derive(Clone, Debug, PartialEq, Serialize, Deserializ... |
//! Various utilities.
use crate::errors::{bail, Result, ResultExt};
use log::trace;
use serde_derive::{Deserialize, Serialize};
use std::collections::hash_map::{Entry, HashMap};
use std::ffi::OsString;
use std::fmt::{Debug, Display};
use std::hash::{BuildHasher, Hash};
use std::io::{stderr, stdout, Write};
use std::p... |
use quote::ToTokens;
use syn::{AttrStyle, DeriveInput, Error, Ident, Lit, LitStr, Meta, MetaList, NestedMeta, Path};
pub struct Repr {
pub rust: Option<Path>,
pub transparent: Option<Path>,
pub packed: Option<Path>,
pub c: Option<Path>,
pub int: Option<Path>,
}
impl Default for Repr {
fn defau... |
use super::transport::TransportLayer;
use crate::types::*;
use async_std::task::{Context, Poll};
use libp2p::{
gossipsub::{
error::{PublishError, SubscriptionError},
Gossipsub, GossipsubConfigBuilder, GossipsubEvent, IdentTopic, MessageAuthenticity,
MessageId,
},
kad::{
recor... |
// TODO: Documentation
// TODO: Pattern matching for errors in this file
use godwit::{glyph::Glyph, *};
use log::{debug, error, info};
use simplelog::*;
use std::path::PathBuf;
use structopt::{clap::Shell, StructOpt};
/// Define CLI syntaxes.
#[derive(Debug, StructOpt)]
#[structopt(
name = "Godwit",
about = "An all-... |
use gdnative::{
godot_error, godot_wrap_method_inner, godot_wrap_method_parameter_count, methods, FromVariant,
GodotString, Instance, NativeClass, Resource, Variant, VariantArray,
};
use crate::game_data::BrushData;
use crate::game_data::PointData;
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum EntityType ... |
use std::sync::Arc;
use crate::{
color::Color,
element::{Element, Intersection, Plane, Sphere},
material::SurfaceType,
point::Point,
scene::Scene,
vector::Vector3,
};
const BLACK: Color = Color {
red: 0.0,
green: 0.0,
blue: 0.0,
};
pub struct Ray {
pub origin: Point,
pub d... |
use std::{convert::Infallible, fmt::Display, str::FromStr};
use structopt::StructOpt;
use crate::api::{
config::{
config::{write_config, Config},
configuration::Sort,
},
reddit::repository::Repository,
};
use anyhow::{bail, Context, Error, Result};
use crate::api::config::configuration::Subreddit as SubredditC... |
//! Potentials which describe Coulombic electrostatic interactions.
#[cfg(feature = "f64")]
use libm::erfc as erfc;
#[cfg(not(feature = "f64"))]
use libm::erfcf as erfc;
use crate::internal::consts::COULOMB;
use crate::internal::Float;
use crate::internal::consts::FRAC_2_SQRT_PI;
use crate::potentials::types::{Dampe... |
//////////////////////////////// CODE ADDED IN BOARD.RS /////////////////////////////
use rand::{
distributions::{Distribution, Standard},
Rng,
};
impl Distribution<Direction> for Standard {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Direction {
match rng.gen_range(0, 4) {
0 => ... |
const ISO_PAYLOAD_SIZE: usize = 4096;
const ERR_ISO_MASK: u32 = 0x000F_0000;
const ERR_ISO_BASE: u32 = 0x0000_FFFF;
const ERR_ISO_CONNECT: u32 = 0x0001_0000; // Connection error
const ERR_ISO_DISCONNECT: u32 = 0x0002_0000; // Disconnect error
const ERR_ISO_INVALID_PDU: u32 = 0x0003_0000; // Bad format
const ERR_ISO_I... |
use cfg;
use std::collections::HashSet;
use std::fmt;
#[derive(Debug, Hash, PartialEq, Clone)]
pub struct State<'er> {
rule: &'er cfg::Production,
dot: usize,
origin: usize,
}
impl<'er> Eq for State<'er> {}
impl<'er> fmt::Display for State<'er> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
... |
use std::cmp;
use std::fs::File;
use std::io::Read;
use std::path::Path;
use toml;
use super::backend::EmulatorBackend;
use super::emulator::EmulatorApplication;
use super::input::KeyboardBinding;
use rustboylib::gpu::{SCREEN_H, SCREEN_W};
// Default display scale, i.e. the actual size (in pixels) of each individual... |
use crate::server::{Error, Event, Settings, Stopper};
use crate::tcp_session::TcpSession;
use mio::net::TcpListener;
use slab::Slab;
use std::io::ErrorKind;
use std::panic;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::{Arc, Mutex, RwLock};
use std::time::Duration;
use crate::web_session;
use crate::web... |
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
use debug_ignore::DebugIgnore;
use narwhal_config::{
Authority, Committee as ConsensusCommittee, PrimaryAddresses, Stake, WorkerAddresses,
};
use rand::rngs::OsRng;
use std::{
num::NonZeroUsize,
path::{Path, PathBuf},
};
use su... |
use crate::*;
use borsh::BorshSerialize;
use mpl_token_metadata::{
id,
instruction::{self, MetadataInstruction, MintNewEditionFromMasterEditionViaTokenArgs},
state::{EDITION, EDITION_MARKER_BIT_SIZE, PREFIX},
};
use solana_program::{
borsh::try_from_slice_unchecked,
instruction::{AccountMeta, Instru... |
#![crate_name = "uu_fmt"]
/*
* This file is part of `fmt` from the uutils coreutils package.
*
* (c) kwantam <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
extern crate unicode_width;
#[macro_use]
extern crate uucore;... |
use std::mem::replace;
use swc_common::{util::take::Take, Span, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::perf::Check;
use swc_ecma_transforms_macros::fast_path;
use swc_ecma_utils::{alias_if_required, undefined, StmtLike};
use swc_ecma_visit::{noop_fold_type, noop_visit_type, Fold, FoldWith, Node, ... |
use std::collections::hash_map::Entry;
use rustc_hash::{FxHashMap, FxHashSet};
use crate::llir::{
llir_nodes::{Call, Function, Node, VariableAccess},
utils::{BlockId, ItemId, ScoreboardValue},
CallGraph, Runtime,
};
use super::{function_parameters::FunctionParameters, variable_metadata::VariableUsage, No... |
use crate::Result;
use crate::{Arguments, OptionItem, Options};
use std::iter::Peekable;
use std::marker::PhantomData;
/// Helper struct for parsing command line arguments.
#[derive(Debug)]
pub struct Command<Opts, Args> {
name: String,
version: String,
_phantom: PhantomData<(Opts, Args)>,
}
impl<Opts, Ar... |
use std::convert::TryFrom;
use actix_files::NamedFile;
use actix_web::{web, HttpRequest, HttpResponse};
use actix_web_actors::ws;
use borsh::{BorshDeserialize, BorshSerialize};
use futures::{future, TryFutureExt};
use laplace_common::{api::Peer, lapp::settings::GossipsubSettings};
use laplace_wasm::http;
use crate::... |
extern crate glium;
extern crate glob;
extern crate png;
use std::borrow::Cow;
use std::env;
use std::fs::File;
use std::io;
use std::path;
use glium::backend::glutin::Display;
use glium::glutin::{self, dpi, Event, VirtualKeyCode};
use glium::texture::{ClientFormat, RawImage2d};
use glium::{BlitTarget, Rect, Surface}... |
use std::{collections::HashSet, path::Path};
use tree_sitter::{Parser, TreeCursor};
use crate::style::HighlightConfiguration;
const DEFAULT_CODE_LENS_LIST: &[&str] = &["source_file"];
const DEFAULT_CODE_LENS_IGNORE_LIST: &[&str] = &["source_file"];
const RUST_CODE_LENS_LIST: &[&str] =
&["source_file", "impl_item... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{error::MempoolError, state_replication::TxnManager};
use anyhow::{format_err, Result};
use consensus_types::{block::Block, common::Payload};
use diem_logger::prelude::*;
use diem_mempool::{
CommittedTransaction, Consensu... |
//! Provides utilities for operating on the filesystem.
use std::fs::{self, create_dir_all, read_dir, DirEntry, File, Metadata};
use std::io;
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
use std::path::Path;
use crate::error::{Context, ErrorKind, Fallible};
use crate::layout::volta_home;
use retry::delay::Fibo... |
use std::{env, fmt, path::PathBuf};
type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug)]
enum Error {
GenerateBindings,
WriteBindings(std::io::Error),
Env(std::env::VarError),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match s... |
use std::{
io::{
Read,
Result,
},
ops::Shl,
};
fn copy_into_array<A, T>(slice: &[T]) -> A
where
A: Default + AsMut<[T]>,
T: Copy,
{
let mut a = A::default();
<A as AsMut<[T]>>::as_mut(&mut a).copy_from_slice(slice);
a
}
/// Modified from https://github.com/stusmall/murm... |
pub type c_char = i8;
s! {
pub struct lconv {
pub decimal_point: *mut ::c_char,
pub thousands_sep: *mut ::c_char,
pub grouping: *mut ::c_char,
pub int_curr_symbol: *mut ::c_char,
pub currency_symbol: *mut ::c_char,
pub mon_decimal_point: *mut ::c_char,
pub mo... |
use super::obj::objsequence;
use super::obj::objstr;
use super::obj::objtype;
use super::pyobject::{
create_type, AttributeProtocol, PyContext, PyFuncArgs, PyObjectRef, PyResult, TypeProtocol,
};
use super::vm::VirtualMachine;
fn exception_init(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
let zelf ... |
use crate::geometry::{
Collider, ColliderSet, ContactDispatcher, ContactEvent, ContactManifold, ContactPair, Shape,
};
use crate::math::Isometry;
#[cfg(feature = "simd-is-enabled")]
use crate::math::{SimdFloat, SIMD_WIDTH};
use crate::pipeline::EventHandler;
use std::any::Any;
#[derive(Copy, Clone)]
pub enum Conta... |
// These functions are necessarily inefficient, because they must revert
// encoding conversions performed by the standard library. However, there is
// currently no better alternative.
use std::borrow::Cow;
use std::error::Error;
use std::ffi::OsStr;
use std::ffi::OsString;
use std::fmt;
use std::fmt::Display;
use st... |
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
use std::{env, mem, str};
use psl::{List, Psl, Type};
use rspec::report::ExampleResult;
#[test]
fn list_behaviour() {
rspec::run(&rspec::describe("the official test", (), |ctx| {
let body = {
let root = env::var("CARGO_MANIFEST_D... |
use crate::io::util::DEFAULT_BUF_SIZE;
use crate::io::{async_buf_read, AsyncBufRead, AsyncRead, AsyncWrite, ReadBuf};
use pin_project_lite::pin_project;
use std::fmt;
use std::io::{self, Write};
use std::pin::Pin;
use std::task::{Context, Poll};
pin_project! {
/// Wraps a writer and buffers its output.
///
... |
use core::marker::PhantomData;
use core::pin::Pin;
use futures_core::stream::Stream;
use futures_core::task::{LocalWaker, Poll};
use futures_sink::Sink;
use pin_utils::{unsafe_pinned, unsafe_unpinned};
/// Sink for the `Sink::with_flat_map` combinator, chaining a computation that
/// returns an iterator to run prior t... |
// Copyright 2017 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 ... |
//!
//! The malloc bdev as the name implies, creates an in memory disk. Note
//! that the backing memory is allocated from huge pages and not from the
//! heap. IOW, you must ensure you do not run out of huge pages while using
//! this.
use std::{collections::HashMap, convert::TryFrom};
use async_trait::async_trait;
u... |
//! A single audio track on the playlist.
use crate::traits::{AudioPlaybin, PathToURI};
use anyhow::Result;
use gst::prelude::*;
use std::path::{Path, PathBuf};
use std::time::Duration;
/// The `Song` object is a single audio track on the
/// [`Playlist`][crate::playlist::Playlist].
///
/// It stores the URI, metada... |
//!
// This integration relies on _knowing_ which backend is being used at compile-time
// This is a poor woman's XOR - if you know how to make it more pretty, PRs welcome <3
#[cfg(any(
all(feature = "pg", feature = "mysql"),
all(feature = "pg", feature = "sqlite3"),
all(feature = "mysql", feature =... |
use std::f64;
use std::cmp;
use i_bound::BoundType;
use i_bound::IBound;
use i_shape::ShapeType;
#[derive(Debug)]
#[derive(Clone)]
pub struct AxisAlignedBBox {
pub _bound_lower: [ f64; 3 ],
pub _bound_upper: [ f64; 3 ],
}
#[derive(Debug)]
#[derive(Clone)]
pub enum Axis {
X,
Y,
Z,
}
impl AxisAlig... |
extern crate glium;
extern crate glutin;
extern crate image;
use std::time::Instant;
use std::io::{Cursor, Read};
use std::fs::File;
use image::RgbaImage;
use glutin::window::WindowBuilder;
use glutin::event_loop::EventLoop;
use glutin::{ContextBuilder, NotCurrent};
use glutin::event::Event;
use glium::Display;
use... |
use crate::*;
use near_sdk::{Gas, Balance};
const GAS_FOR_RESOLVE_FIRE: Gas = Gas(10_000_000_000_000);
const GAS_FOR_FIRE: Gas = Gas(25_000_000_000_000 + GAS_FOR_RESOLVE_FIRE.0);
const NO_DEPOSIT: Balance = 0;
#[near_bindgen]
impl Fleet {
/*
Fire a shot on the opposing fleet.
performs a CCC to t... |
//! # Examples
//!
//! How to monitor if there's a new update and install it.
//! Only available for Flatpak applications.
//!
//! ```rust,no_run
//! use ashpd::flatpak::FlatpakProxy;
//! use ashpd::WindowIdentifier;
//!
//! async fn run() -> ashpd::Result<()> {
//! let connection = zbus::Connection::session().awai... |
//! Collection of composition types.
pub mod basic_f32;
pub mod basic_premultiplied_f32;
#[cfg(feature = "image-crate")]
pub mod image_rgb_rgba;
/// Compositor attributes
pub trait CompositorAttr {
/// If true, the compositor requires updating destinations even alpha is zero.
fn keep_dst_on_transparent_src(&s... |
//! HTTP extensions.
use bytes::Bytes;
use http::header::HeaderName;
#[cfg(feature = "http1")]
use http::header::{IntoHeaderName, ValueIter};
use http::HeaderMap;
#[cfg(feature = "ffi")]
use std::collections::HashMap;
#[cfg(feature = "http2")]
use std::fmt;
#[cfg(feature = "http2")]
/// Represents the `:protocol` pse... |
use crate::{
graph::{Bool, Byte, EdgeKind, Gamma, Int, NodeExt, Rvsdg, Store, Theta},
passes::{
utils::{ChangeReport, Changes, ConstantStore},
Pass,
},
values::{Cell, Ptr},
};
/// Removes unobserved stores
// FIXME: Every time an unobserved store is removed, a new node becomes the last ... |
use test_integer::TestInteger;
use std::sync::{Arc, Mutex};
use std::sync::mpsc;
use std::thread;
use std::collections::VecDeque;
/// An iterator that returns the nth integer squared.
struct Squares {
count: u64,
max: u64,
}
impl Squares {
pub fn new(max: u64) -> Squares {
Squares { count: 0, max:... |
/*!
Provides a Serde-enabled model for AWS Identity and Access Management (IAM) policies.
This implementation only provides a convenient API to construct and consume IAM
policy resources using [Serde](https://serde.rs/) to serialize and deserialize into
the AWS-defined JSON representation.
# Policy Grammar
The follo... |
use std::io::{Read, Seek};
use byteorder::ReadBytesExt;
use chrono::prelude::*;
mod boot;
mod primary;
mod supplementary;
pub use crate::vd::{
boot::BootRecord,
primary::PrimaryVolume,
supplementary::SupplementaryVolume
};
#[derive(Clone, Debug)]
pub enum VolumeDescriptor {
Boot(BootRecord),
Prim... |
use model::constants::SECRETS_PATH;
use model::SecretName;
use snafu::{OptionExt, ResultExt};
use std::collections::BTreeMap;
use std::fmt::{Display, Formatter};
use std::fs;
use std::path::PathBuf;
/// Reads the keys (which become files) and values of a Kubernetes generic/[opaque] secret.
/// [opaque]: https://kubern... |
use super::{Ring, SeqRead, SeqWrite};
use crate::Result;
use std::io::{self, BufRead, ErrorKind, Read, Write};
/// The `BufReader` adds buffering to any reader using a specialized buffer.
///
/// This is very similar `std::io::BufReader`, but it uses a
/// [`Ring`](struct.Ring.html) for the internal buffer, and it pr... |
use crate::titlemapper::TitleMapping;
use anyhow::{Context, Result};
use log::{error, info, warn};
use quick_xml::{events::Event, Reader};
use regex::bytes::Regex;
use std::{
collections::{HashMap, HashSet},
path::Path,
};
pub fn gen_wikigraph<P: AsRef<Path>>(
titlemap: &TitleMapping,
datapath: P,
) ->... |
// 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 {
crate::{
blob_actor::BlobActor, deletion_actor::DeletionActor, instance_actor::InstanceActor, Args,
BLOBFS_MOUNT_PATH,
},
... |
use crate::Error;
#[doc(hidden)]
pub use tokenizer::Tokenizer;
macro_rules! create_status_codes {
($($name:ident => $code:expr),*) => {
/// The SIP [Response](super::super::Response) status code (or response code as SIP main
/// RFC refers to them). This is not a `Copy` type because in case of an ... |
//! Generates machine code for a given program.
use crate::asm::aarch64::{AArch64Assembly, Label, W, X};
use crate::ir::BlockLabel;
use crate::ir::ControlFlowGraph;
use crate::ir::ThreeAddressInstruction;
// REGISTERS:
//
// x0 - working byte
const VAL: W = W(0);
// x19 (callee saved) - current pointe... |
pub mod color;
#[cfg(feature = "gif")]
pub mod gif;
#[cfg(feature = "png")]
pub mod png;
pub use color::Color;
use cstr_core::CString;
/// Draw a single pixel using the specified [`Color`] on the framebuffer at the given X/Y coordinates.
///
/// ***DO NOT USE THIS TO DRAW MULTIPLE PIXELS!*** Use [`draw_batch`] instea... |
// Copyright 2015 <NAME>
//
// Orientation code adapted from "Real-Time Collision Detection" by
// <NAME>, published by <NAME>,
// Copyright 2005 Elsevier Inc
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a cop... |
use std::{
env,
io::Write,
fs::{File, create_dir_all},
time::Duration,
};
use nalgebra::{Vector3, Matrix3, Rotation3};
use clay::{
prelude::*,
shape::*,
material::*,
object::*,
scene::{TargetListScene, GradientBackground as GradBg},
view::ProjectionView,
filter::{IdentityFilt... |
use crate::{
component, AppState, BUILDING_BASE_HEIGHT, BUILDING_WIDTH_RANGE, FACTOR, FASTFALL_FORCE, GAP,
GRAVITY, HEIGHT_OFFSET_RANGE, HORIZON, JUMP_FORCE, LANDING_TOLERANCE, LOWER_LIMIT,
SCROLL_SPEED, SQUARE_SIZE, UPPER_LIMIT,
};
use bevy::{
prelude::*,
sprite::collide_aabb::{collide, Collision},... |
#[cfg(feature = "mesalock_sgx")]
use std::prelude::v1::*;
use crate::key_types::ValueType;
use crate::memtable::MemTable;
use crate::types::SequenceNumber;
use integer_encoding::{FixedInt, VarInt, VarIntWriter};
use std::io::Write;
const SEQNUM_OFFSET: usize = 0;
const COUNT_OFFSET: usize = 8;
const HEADER_SIZE: usi... |
use core::alloc::{CannotReallocInPlace, Layout};
use core::mem;
use core::ptr::NonNull;
#[cfg(target_pointer_width = "64")]
use heapless::consts::U152 as UHEAP_SIZES_LEN;
#[cfg(target_pointer_width = "32")]
use heapless::consts::U57 as UHEAP_SIZES_LEN;
use heapless::Vec;
use lazy_static::lazy_static;
use liblumen_al... |
//! Definitions of template function abstractrepresentations
use glsl_lang::ast::*;
use indexmap::IndexMap;
use super::{instantiate::InstantiateTemplate, FnRef, LocalScope, Scope};
use crate::{Error, Result};
/// Function parameter of a template
#[derive(Debug, Clone)]
pub struct TemplateParameter {
/// Name o... |
extern crate ignore;
extern crate json;
extern crate term;
extern crate thiserror;
extern crate rustc_ast;
extern crate rustc_ast_pretty;
extern crate rustc_data_structures;
extern crate rustc_errors;
extern crate rustc_expand;
extern crate rustc_parse;
extern crate rustc_session;
extern crate rustc_span;
use std::co... |
//! Contains HTTP symbol retrieval specific functionality
use crate::*;
use log::{debug, trace, warn};
use reqwest::{Client, Url};
use std::fs;
use std::io::{self, Write};
use std::path::{Path, PathBuf};
use std::time::Duration;
use tempfile::NamedTempFile;
/// An implementation of `SymbolSupplier` that loads Breakpa... |
use std::fmt::{self, Display};
use std::str::FromStr;
use anyhow::{Context, Error, Result};
use crate::Direction::*;
use crate::Tile::*;
const DIRECTIONS: [Direction; 8] = [Up, Down, Left, Right, UpLeft, UpRight, DownLeft, DownRight];
#[derive(Debug, Clone)]
pub struct Area {
width: usize,
height: usize,
... |
use failure::format_err;
use log::error;
use rusqlite::types::ToSql;
use serde_derive::{Deserialize, Serialize};
use crate::db::{self, Database};
use crate::errors::*;
#[derive(Deserialize, Serialize, Clone)]
pub struct UserInfo {
pub id: Option<i32>,
pub github: String,
pub slack: String,
pub mute_di... |
//! The Commitment enum, used for the corresponding block header field.
use thiserror::Error;
use crate::parameters::{Network, NetworkUpgrade, NetworkUpgrade::*};
use crate::sapling;
use super::super::block;
/// Zcash blocks contain different kinds of commitments to their contents,
/// depending on the network and ... |
extern crate sdl2;
use crate::consts::*;
use crate::cpu;
use crate::ram;
use anyhow::{anyhow, Result};
use sdl2::controller::{Button, GameController};
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
bitflags! {
pub struct Joypad: u8 {
const MODE_BUTTONS = 1<<5;
const MODE_DPAD = 1<<4;
... |
use super::ledger::{Error, Ledger, LedgerStaticParameters};
use crate::block::{BlockDate, ChainLength};
use crate::config::ConfigParam;
use crate::stake::DelegationState;
use crate::value::*;
use crate::{account, legacy, multisig, setting, update, utxo};
use chain_addr::Address;
use chain_time::TimeEra;
use std::sync::... |
use smithay_client_toolkit::{
reexports::{
client::protocol::{wl_compositor, wl_output, wl_shm, wl_surface},
client::{Attached, Main},
protocols::wlr::unstable::layer_shell::v1::client::{
zwlr_layer_shell_v1, zwlr_layer_surface_v1,
},
},
shm::DoubleMemPool,
};
us... |
//! Dotrix camera implementation
use crate::{
ecs::{Const, Mut},
renderer::UniformBuffer,
services::{Frame, Globals, Input, Renderer, Window},
};
use dotrix_math::{perspective, Mat4, Point3, Rad, Vec3};
use std::f32::consts::PI;
const ROTATE_SPEED: f32 = PI / 10.0;
const ZOOM_SPEED: f32 = 10.0;
/// Proje... |
/*
# Introduction To `cargotest`
Cargo has a wide variety of integration tests that execute the `cargo` binary
and verify its behavior. The `cargotest` module contains many helpers to make
this process easy.
The general form of a test involves creating a "project", running cargo, and
checking the result. Projects a... |
use std::hash::{Hash, Hasher};
macro_rules! finite {
(@op => $opname:ty, $opnamety:ty, $func:tt, $name:tt, $ty:ty) => {
impl $opname for $name {
type Output = Option<$ty>;
fn $func(self, other: Self) -> Option<$ty> {
let result = (self.0).$func(other.0);
... |
use anyhow::Context as _;
use devolutions_gateway::token::{new_token_cache, ApplicationProtocol, JrlTokenClaims};
use devolutions_gateway_generators::*;
use parking_lot::Mutex;
use picky::jose::jwe;
use picky::jose::jws::JwsAlg;
use picky::jose::jwt::CheckedJwtSig;
use picky::key::{PrivateKey, PublicKey};
use proptest:... |
use log::info;
use alloc::boxed::Box;
use esp_idf_hal::mutex::Mutex;
use esp_idf_sys::*;
type Singleton<T> = Mutex<Option<Box<T>>>;
static RECV_CALLBACK: Singleton<dyn FnMut(&[u8], &[u8]) + Send> = Mutex::new(None);
static SEND_CALLBACK: Singleton<dyn FnMut(&[u8], SendStatus) + Send> = Mutex::new(None);
pub static... |
use std::fmt;
use std::mem::MaybeUninit;
use std::sync::atomic::{AtomicUsize, Ordering};
pub mod arm;
pub mod riscv;
pub mod x86_64;
mod lookup;
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum BitWidth {
U128,
U64,
U32,
U16,
}
pub struct Array<T, const S: usize> {
bytes: [T; S],
len: A... |
//! This module contains the IOx implementation for using local disk as the
//! object store.
use crate::{
path::{file::FileConverter, ObjectStorePath},
DataDoesNotMatchLength, Result, UnableToCopyDataToFile, UnableToCreateDir, UnableToCreateFile,
UnableToDeleteFile, UnableToOpenFile, UnableToPutDataInMemor... |
// Copyright (C) 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,
// dis... |
use std::collections::{HashMap, VecDeque};
use std::fs;
use std::fs::Metadata;
use std::os::unix::fs::MetadataExt;
use std::path::PathBuf;
use chrono::{DateTime, Local};
use lazy_static::lazy_static;
use crate::lang::command::OutputType::Known;
use crate::lang::errors::{error, to_crush_error, CrushResult};
use crate... |
#![no_std]
extern crate alloc;
use alloc::string::String;
use alloc::vec::Vec;
use alloc::sync::Arc;
use smoltcp::wire::{EthernetAddress, IpAddress, IpCidr, Ipv4Address};
use lazy_static::lazy_static;
use spin::RwLock;
use device_tree::{DeviceTree, Node};
use device_tree::util::SliceRead;
use core::mem::size_of;
use ... |
// 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 {
crate::{
component_instance::{
ComponentInstanceInterface, ExtendedInstanceInterface, WeakExtendedInstanceInterface,
... |
use crate::people::PlayerPositionType;
use crate::r#match::random_gamma;
use crate::Squad;
use std::mem;
pub struct FootballEngine<'s> {
home_squad: Squad<'s>,
away_squad: Squad<'s>,
}
const MATCH_ACTIONS: u16 = 100;
impl<'s> FootballEngine<'s> {
pub fn new(home_squad: Squad<'s>, away_squad: Squad<'s>) -... |
/*!
A derive proc macro that allow a struct to be read from a database using the mssql_client crate.
# Example
```
use mssql_client::Connection;
use mssql_client_derive::Sql;
use futures::future::Future;
use tokio::executor::current_thread::block_on_all;
#[derive(Sql)]
struct MyRow {
id: i32,
name: String,
... |
// 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 fidl_fuchsia_cobalt_test::{LogMethod, LoggerQuerierProxy};
use fidl_fuchsia_testing::Increment;
use fidl_fuchsia_time_external::{Status, TimeSample};
u... |
use std::cmp::Ordering;
use std::cmp::Ordering::{Greater, Less};
use std::fmt::{Debug, Display};
use std::ops::{Add, BitAnd, BitOrAssign, Shl, Shr, Sub};
use crate::{BitReader, BitWriter};
use crate::bits;
use crate::errors::QCompressResult;
pub use timestamps::{TimestampMicros, TimestampNanos};
mod boolean;
mod flo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.