text stringlengths 7.05k 33.9k |
|---|
extern crate libc;
use std::default::Default;
use std::ptr;
use std::fmt;
/// enable streaming
pub const WATCH_ENABLE:libc::c_int = 0x000001;
/// disable watching
pub const WATCH_DISABLE:libc::c_int = 0x000002;
/// JSON output
pub const WATCH_JSON:libc::c_int = 0x000010;
/// output in NMEA
pub const WATCH_NMEA... |
use std::mem;
use std::sync::Arc;
use std::collections::VecDeque;
use std::time::Instant;
use futures::{Future, Poll, Async};
use tk_bufstream::{IoBuf, WriteBuf, ReadBuf};
use tokio_io::{AsyncRead, AsyncWrite};
use tokio_core::reactor::{Handle, Timeout};
use super::encoder::{self, get_inner, ResponseConfig};
use supe... |
use txt::encoding::Unicode;
#[derive (Copy, Clone)]
pub struct UTF8;
impl Unicode for UTF8 {
#[inline (always)]
fn char_max_bytes_len (self) -> u8 { 4 }
fn check_bom (self, bom: &[u8]) -> bool { bom == &[0xEF, 0xBB, 0xBF] }
fn check_is_flo_num (self, stream: &[u8]) -> bool {
if stream... |
//use syn::Type;
use makepad_render::*;
use makepad_widget::*;
use makepad_microserde::*;
use makepad_worlds::set_worlds_style;
use crate::makepadwindow::*;
use crate::makepadstorage::*;
use crate::filetree::*;
use crate::buildmanager::*;
use crate::makepadstyle::*;
pub struct MakepadApp {
pub makepad_window_state... |
use std::f64;
use BitMap;
use line;
use Axis;
const W_ARROW: usize = 4; //width of arrow
const W_NUMBER: usize = 4; //number width in pixel
const H_NUMBER: usize = 5; //number height in pixels
const W_BORDER: usize = 1; //space around graph width
const H_ARROW_HALF: usize = 3;
const LEFT_SHIFT: usiz... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
#![cfg_attr(feature = "kern", no_std, no_main, feature(lang_items))]
#[cfg(feature = "kern")]
use ebpf_kern as ebpf;
#[cfg(feature = "user")]
use ebpf_user as ebpf;
#[cfg(feature = "kern")]
ebpf::license!("Dual MI... |
use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer};
use vulkano::command_buffer::{AutoCommandBufferBuilder, DynamicState};
use vulkano::device::{Device, DeviceExtensions};
use vulkano::framebuffer::{Framebuffer, FramebufferAbstract, RenderPassAbstract, Subpass};
use vulkano::image::{ImageUsage, SwapchainImage};
us... |
#[macro_use]
extern crate log;
extern crate env_logger;
extern crate kiss3d;
extern crate nalgebra as na;
extern crate ndarray;
use ndarray::prelude::*;
macro_rules! pos {
($tuple:expr) => (
Position { x: $tuple.0, y: $tuple.1, z: $tuple.2 }
)
}
/// Main game structure.
///
/// size: game board siz... |
//! Information parsed from an input and format description.
use core::convert::{TryFrom, TryInto};
use core::num::{NonZeroU16, NonZeroU8};
use crate::error::TryFromParsed::InsufficientInformation;
use crate::format_description::modifier::{WeekNumberRepr, YearRepr};
use crate::format_description::{Component, FormatIt... |
use std::cmp;
use std::fmt;
use std::io;
use std::ops::{Index, IndexMut};
use std::process::exit;
use std::time::{Instant, Duration};
use rand::{thread_rng, Rng};
use self::Visibility::*;
use self::GameError::*;
use self::GameStatus::*;
/* basic objects */
#[derive(Debug, Clone, Copy, PartialEq)]
struct Coords { x: u... |
pub mod item;
pub mod player;
pub mod projectile;
pub mod toriel;
pub mod dave;
pub mod toriel_fireball;
pub mod toriel_oven;
use strum::IntoEnumIterator;
use treeflection::{Node, NodeRunner, NodeToken, KeyedContextVec, ContextVec};
use crate::files::engine_version;
use crate::geometry::Rect;
use player::PlayerActio... |
use core_foundation::{
base::{CFAllocatorRef, CFIndex, CFOptionFlags, CFTypeID, CFTypeRef, OSStatus, TCFType},
data::CFDataRef,
dictionary::CFDictionaryRef,
error::CFErrorRef,
string::{CFString, CFStringRef},
};
use std::{
borrow::Cow,
fmt::{self, Debug},
os::raw::{c_char, c_void},
p... |
use std::{
fmt::Debug,
ops::{Deref, DerefMut},
pin::Pin,
};
use libc::c_void;
use nix::errno::Errno;
use spdk_rs::{
libspdk::{spdk_bdev_io, spdk_io_channel},
BdevIo,
};
use super::{
nexus_lookup_mut,
Nexus,
NexusChannel,
NexusChannelInner,
NexusStatus,
NEXUS_PRODUCT_ID,
};... |
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// This file is part of substrate-subxt.
//
// subxt 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 optio... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
annotations::Annotations,
borrow_analysis, livevar_analysis, reaching_def_analysis,
stackless_bytecode::{AttrId, Bytecode, Operation, SpecBlockId, TempIndex},
};
use itertools::Itertools;
use move_model::{
a... |
use self::delims::*;
use self::doc::*;
use self::docfile::*;
use self::kv::*;
use self::outputs::*;
use clap::ArgMatches;
use dirs::home_dir;
use glob::glob;
use handlebars::{to_json, Handlebars};
use nom::types::CompleteStr;
use nom::*;
use nom_locate::{position, LocatedSpan};
use serde::{Deserialize, Serialize};
use ... |
// Copyright (c) 2021 The vulkano developers
// 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. All files in the project carrying such
// notice may not be ... |
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// 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
//
// Unl... |
//! Non-finalized chain state management as defined by [RFC0005]
//!
//! [RFC0005]: https://zebra.zfnd.org/dev/rfcs/0005-state-updates.html
mod chain;
mod queued_blocks;
#[cfg(test)]
mod tests;
pub use queued_blocks::QueuedBlocks;
use std::{collections::BTreeSet, mem, ops::Deref, sync::Arc};
use zebra_chain::{
... |
use std::fmt::Debug;
use std::io;
use std::thread;
use std::time::{Duration, Instant};
use spidev::Spidev;
use sysfs_gpio::{Direction, Edge, Pin, PinPoller};
use regrw::{FakeRegs, RegRw, RfmReg, RfmRegs, RegLogger};
const FIFO_SIZE: usize = 64;
#[repr(u8)]
#[derive(Clone, Copy)]
pub enum Rfm22RegVal {
Interrupt... |
/* Math builtin module
*
*
*/
use statrs::function::erf::{erf, erfc};
use statrs::function::gamma::{gamma, ln_gamma};
use num_bigint::BigInt;
use num_traits::{One, Signed, Zero};
use crate::function::{Args, OptionalArg};
use crate::obj::objfloat::{self, IntoPyFloat, PyFloatRef};
use crate::obj::objint::{self, PyI... |
use iced::{scrollable, text_input, window, Align, Application, Color, Column, Command, Container, Element, Length, Row, Scrollable, Settings, Subscription, Text, TextInput, Clipboard};
use crate::entries::{Entries, EntriesState, Entry};
use crate::subscriptions::custom::ExternalCommandSubscription;
use crate::subscrip... |
// Copyright 2021 <NAME>
//
// 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 writi... |
// Copyright 2021 Red Hat, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 21/05/2018
Last Modified: 22/10/2019
License: MIT
NOTES: 1. The tool should be updated to take multiple file inputs.
2. Unlike the original Whitebox GAT tool that this is based on,
this tool will operat... |
// Copyright 2015 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 ... |
/*
Copyright (c) 2020, ZomboDB, LLC
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and
without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the
following two paragraphs appear in... |
use std::collections::hash_map::{Entry, HashMap};
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use std::sync::Arc;
use std::time::{Duration};
use bytes::Bytes;
use futures::prelude::*;
use futures::{pin_mut};
use quick_error::quick_error;
use tokio::sync::{mpsc, oneshot};
use tokio::select;
use crate::app_messages;
... |
#![allow(clippy::len_zero)]
#[allow(unused_imports)]
use log::{debug, error, info, trace, warn};
#[cfg(feature = "dx12")]
use gfx_backend_dx12 as back;
#[cfg(feature = "metal")]
use gfx_backend_metal as back;
#[cfg(feature = "vulkan")]
use gfx_backend_vulkan as back;
use arrayvec::ArrayVec;
use core::mem::ManuallyDr... |
use quote::quote;
use proc_macro2::TokenStream;
use proc_macro2::Span;
use syn::ItemFn;
use syn::Ident;
use syn::LitInt;
use syn::LitStr;
use crate::ast::FunctionArgs;
use crate::ast::FunctionArg;
use crate::ast::FunctionAttributes;
use crate::ast::FunctionArgType;
use crate::util::ident;
use super::FnGeneratorCtx;... |
//! Displays spheres with physically based materials.
use std::path::Path;
use amethyst::{
animation::{
get_animation_set, AnimationBundle, AnimationCommand, AnimationControlSet, AnimationSet,
EndControl, VertexSkinningBundle,
},
assets::{
AssetLoaderSystemData, AssetStorage, Compl... |
//! X11 resource manager library.
//!
//! Usage example (please cache the database in real applications instead of re-opening it whenever
//! a value is needed):
//! ```
//! use x11rb::{connection::Connection, errors::ReplyError, resource_manager::Database};
//! fn get_xft_dpi(conn: &impl Connection) -> Result<Option<u... |
extern crate time;
pub mod store;
use error::CellError;
// Maximum number of times to retry set_if_not_exists/compare_and_swap
// operations before returning an error.
const MAX_CAS_ATTEMPTS: i64 = 5;
#[derive(Debug, PartialEq)]
pub struct Rate {
pub period: time::Duration,
}
impl Rate {
pub fn per_day(n: ... |
// (c) 2016 Productize SPRL <<EMAIL>>
// extension: .kicad_pcb
// format: new-style
// from parent
use footprint;
use wrap;
use Sexp;
use symbolic_expressions::iteratom::*;
use symbolic_expressions::SexpError;
use layout::data::*;
// TODO: switch more to IterAtom like in footprint/de.rs
struct Version(i64);
impl ... |
#[cfg(test)]
#[path = "../../../tests/unit/construction/heuristics/context_test.rs"]
mod context_test;
use crate::construction::constraints::*;
use crate::construction::heuristics::factories::*;
use crate::models::common::Cost;
use crate::models::problem::*;
use crate::models::solution::*;
use crate::models::{Extras, ... |
use crate::record::GcPcSaftRecord;
use feos_core::joback::JobackRecord;
use feos_core::parameter::{
BinaryRecord, ChemicalRecord, FromSegments, IdentifierOption, ParameterError, SegmentRecord,
};
use indexmap::{IndexMap, IndexSet};
use ndarray::{Array1, Array2};
use quantity::si::{JOULE, KB, KELVIN};
use std::fmt::... |
//! Error management
//!
//! Depending on a compilation flag, the content of the `Context` enum
//! can change. In the default case, it will only have one variant:
//! `Context::Code(I, ErrorKind<E=u32>)` (with `I` and `E` configurable).
//! It contains an error code and the input position that triggered it.
//!
use i... |
use std::sync::Arc;
use anyhow::*;
use cgmath::Vector2;
use corrode::renderer::{Camera2D, Line};
use hecs::Entity;
use rapier2d::geometry::Collider;
use vulkano::buffer::CpuAccessibleBuffer;
use crate::{
matter::MatterDefinitions,
object::{
collider_from_polylines, collider_sensor_from_polylines, doug... |
use nom::branch::alt;
use nom::bytes::complete::take_till1;
use nom::character::complete::{anychar, char, digit1};
use nom::combinator::{all_consuming, map_res};
use nom::multi::fold_many0;
use nom::sequence::{delimited, preceded, tuple};
use nom::IResult;
use anyhow::Result;
/// Template fragments that are valid at ... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved0: [u8; 0x10],
#[doc = "0x10 - Start SPI transaction"]
pub tasks_start: crate::Reg<tasks_start::TASKS_START_SPEC>,
#[doc = "0x14 - Stop SPI transaction"]
pub tasks_stop: crate::Reg<tasks_stop::TASKS_STOP_SPEC>,
_reserved2:... |
#[allow(dead_code)]
#[allow(clippy::wildcard_imports)]
// use super::cubic_calc::Point;
use super::cubic_calc::*;
// pub const ROTATE_STEP: f32 = PI / 16.0;
pub const CUBE_SIZE: f32 = 100.0;
const ADJUST_THRESHOLD: f32 = 0.001;
#[derive(PartialEq)]
pub enum CubeColor {
White,
Yellow,
Blue, // 青
Red, // 赤
... |
use std::collections;
use std::collections::{HashMap, HashSet};
use std::env;
use std::path::PathBuf;
use crate::ResultApp;
use crate::errors::ApplicationErrors;
use crate::mappings::AcceptedType;
use crate::{error, warning, info, time_info};
use std::io::Read;
use std::time::Instant;
use encoding_rs::{Encoding};
... |
//! # startrust::the_game
#[allow(unused_imports)]
use std::io::{BufRead, Write};
use std::str::FromStr;
use log::debug;
use num_enum::{FromPrimitive, IntoPrimitive};
use strum_macros::{AsRefStr, EnumString};
use termcolor::{Color, ColorSpec, WriteColor};
use unwrap_infallible::UnwrapInfallible;
use crate::error::St... |
// Copyright (C) 2019 <NAME>
//
// This software may be modified and distributed under the terms
// of the MIT license. See the LICENSE file for details.
use crate::bcbp::{Bcbp, ConditionalMetadata, Leg, SecurityData};
use crate::de::field;
use crate::error::{Error, Result};
use arrayvec::{Array, ArrayString};
use n... |
use clippy_utils::diagnostics::{span_lint_and_note, span_lint_and_then};
use clippy_utils::source::{first_line_of_span, indent_of, reindent_multiline, snippet, snippet_opt};
use clippy_utils::{
eq_expr_value, get_enclosing_block, hash_expr, hash_stmt, if_sequence, is_else_clause, is_lint_allowed,
search_same, C... |
//! 4x4 matrix inverse
// Code ported from the `packed_simd` crate
// Run this code with `cargo test --example matrix_inversion`
#![feature(array_chunks, portable_simd)]
use core_simd::Which::*;
use core_simd::*;
// Gotta define our own 4x4 matrix since Rust doesn't ship multidim arrays yet :^)
#[derive(Copy, Clone, D... |
// SPDX-License-Identifier: BSD-2-Clause
/*
* resource.rs - Types for converting between libcoap and Rust data structures.
* Copyright (c) 2022 The NAMIB Project Developers, all rights reserved.
* See the README as well as the LICENSE file for more information.
*/
//! Types required for conversion between libcoap C... |
use std::mem;
use bevy::math::*;
use bevy::prelude::*;
use bevy::render::{mesh::*, pipeline::PrimitiveTopology, prelude::*};
use hashbrown::HashSet;
use itertools::Itertools;
use crate::array::Array;
pub const INF_MASS: f32 = 0.0;
#[derive(Debug, Clone, Copy)]
pub struct Friction(pub f32);
impl Default for Frictio... |
use std::{
borrow::Cow,
collections::{hash_map::RandomState, BTreeMap, BTreeSet, HashSet},
sync::Arc,
};
use bonsaidb_core::{
arc_bytes::{serde::Bytes, ArcBytes, OwnedBytes},
connection::Connection,
schema::{
view::{self, map, Serialized},
CollectionName, ViewName,
},
};
use... |
//! Processing module, defining the mechanism to recognize log formats,
//! extract dates, process individual files and write them to the output
//! directory.
//!
//! # Provided
//!
//! This module provides the core processing logic, with regexes, enums and
//! structures created to analyse and parse files into the de... |
//! The bootloader interface
use enum_iterator::IntoEnumIterator;
use hidapi::HidApi;
use serde::{Deserialize, Serialize};
pub mod error;
pub use error::*;
// use error::Error as BootloaderError;
use crate::types::*;
pub mod protocol;
use protocol::Protocol;
#[derive(Debug)]
pub struct Bootloader {
pub protoco... |
//! The default implementation of the State layer.
//!
//! This implementation is of a Key/Value state where a value can be anything that can be serialized
//! into a JSON representation.
//!
//! The default state has the following behavior:
//! - It's a Key/Value store
//! - It supports TTL
//! - It resolves conflicts... |
/*
* Copyright © 2019-2020 <NAME> <EMAIL>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... |
//! Interaction is a minimal and a simple readline library.
//!
//! Features
//! * Single line editing mode
//! * Multi line editing mode
//! * Key bindings
//! * History
//! * Completion
//!
//! # Example
//! ```no_run
//! use interaction::InteractionBuilder;
//! use std::io;
//!
//! fn main() {
//! let history_fi... |
extern crate rota;
use rota::{
backend::gen_code::{self, SectionName},
frontend::{
lexer::{self, SourceFile},
parser,
},
};
#[test]
fn ret() {
do_test("ret", "c3");
}
#[test]
fn hlt() {
do_test("hlt", "f4");
}
#[test]
fn syscall() {
do_test("syscall", "0f 05");
}
#[test]
fn ... |
//! # About
//!
//! This crate provides bindings for the `libmagic` C library, which recognizes the
//! type of data contained in a file (or buffer).
//!
//! You might be familiar with `libmagic`'s CLI; [`file`](https://www.darwinsys.com/file/):
//!
//! ```sh
//! $ file data/tests/rust-logo-128x128-blk.png
//! data/tes... |
use crate::{
channel::Channel,
chars::Chars,
os::{self, ClientCtx, Krb5Ctx},
path::Path,
pool::{Pool, Pooled},
protocol::resolver::{
ClientAuthRead, ClientAuthWrite, ClientHello, ClientHelloWrite, FromRead,
FromWrite, ReadyForOwnershipCheck, Referral, Secret, ServerAuthWrite,
... |
use crate::{Config, Coordinates, VersionCheck};
use clap::{
App,
AppSettings::{
AllowNegativeNumbers, ArgRequiredElseHelp, ColoredHelp, DeriveDisplayOrder,
UnifiedHelpMessage,
},
Arg,
};
use semver::VersionReq;
use std::{fmt::Display, str::FromStr};
#[derive(Debug)]
#[cfg_attr(test, der... |
use std::fmt::Debug;
use std::iter::FromIterator;
use std::str::FromStr;
fn main() {
let input = include_str!("input.txt");
let answer = part_one(input).expect("no solution for part one");
println!("part 1: {}", answer);
let answer = part_two(input).expect("no solution for part two");
println!("p... |
// Ported from https://github.com/randall77/makefat/blob/master/makefat.go
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
use std::{
cmp::Ordering,
fs::File,
io::{self, BufWriter, Write},
path::Path,
};
#[cfg(feature = "bitcode")]
use goblin::mach::cputype::{
CPU_SUBTYPE_ARM64_32_ALL, CPU_SUBT... |
use std::{
collections::{BTreeMap, HashMap},
net::IpAddr,
path::PathBuf,
str::FromStr,
sync::Arc,
time::Duration,
};
use crate::{
addresses::Calculator,
hosts::{parse_hosts, HostsFile},
traits::{ToHostname, ToPointerSOA, ToWildcard},
utils::parse_member_name,
};
use async_trait... |
use serde::{Deserialize, Serialize};
use crate::prototypes::{Prototype, Visitor};
use crate::types::*; // TODO: Import only specific types
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct UtilitySprites {
/// achievement_label_failed :: Sprite
achievement_label_failed: Sprite,
/// achievement_l... |
// Copyright 2018 <NAME>
// 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 writing,... |
use std::process;
use console::Term;
use structopt::clap::AppSettings::{ColorAlways, ColoredHelp, DeriveDisplayOrder};
use structopt::StructOpt;
use crate::bat::assets::HighlightingAssets;
use crate::bat::output::PagingMode;
use crate::config;
use crate::env;
use crate::rewrite;
use crate::theme;
#[derive(StructOpt,... |
extern crate quicksilver;
extern crate rand;
mod consts;
mod error;
mod graphics;
mod util;
use quicksilver::{
geom::{Rectangle, Shape, Vector},
graphics::{Background, Color, Font, FontStyle},
input::{Key, Keyboard},
lifecycle::{run, Asset, Settings, State, Window},
};
use rand::{rngs::ThreadRng, Rng... |
use crate::{
bio::Buf,
fs::BSIZE,
memlayout::VIRTIO0,
proc::{Process, CPUS, PROCS},
riscv::{PGSHIFT, PGSIZE},
spinlock::Mutex,
};
use alloc::sync::Arc;
use bitflags::bitflags;
use core::{
convert::TryInto,
sync::atomic::{fence, Ordering},
};
//
// driver for qemu's virtio disk device.
/... |
#![allow(clippy::all)]
use bevy::{
asset::LoadState,
prelude::*,
sprite::{TextureAtlas, TextureAtlasBuilder},
utils::HashSet,
window::WindowMode,
};
use bevy_tilemap::prelude::*;
use bevy::utils::HashMap;
const TILE_SIZE: f32 = 32.0;
const CHUNK_WIDTH: u32 = TILE_SIZE as u32; //16;
const CHUNK_HEI... |
//<NAME>
//Rust Final Project: Frustracean
//Much credit goes to Quantum Badger, creator of Speedy2d.
//I learned the Speedy2d framework from the User_events.rs example
//(https://github.com/QuantumBadger/Speedy2D/blob/master/examples/user_events.rs)
//I kept some of the variable names (MyWindowHelper) and what not.
... |
// LNP P2P library, plmeneting both legacy (BOLT) and Bifrost P2P messaging
// system for Lightning network protocol (LNP)
//
// 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 t... |
use crate::backend::traits::{Backend, Emitable};
use crate::errors::{Error, Result};
use crate::frontend::{
colors,
colors::ColorHelper,
pretty_print::{display, PrettyHelper},
};
use crate::lang::library::ast as lib;
use crate::lang::structure::Node;
use crate::{
lang::{
ast,
ast::{Atom,... |
#[cfg(has_aot)]
pub mod aot;
#[cfg(has_asm)]
pub mod asm;
pub mod elf_adaptor;
pub mod trace;
use std::fmt::{self, Display};
use bytes::Bytes;
use scroll::Pread;
use super::debugger::Debugger;
use super::decoder::{build_decoder, Decoder};
use super::instructions::{execute, Instruction, Register};
use super::memory::... |
// This file is part of Substrate.
// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the F... |
#![unstable(feature = "raw_vec_internals", reason = "unstable const warnings", issue = "none")]
use core::alloc::LayoutError;
use core::cmp;
use core::intrinsics;
use core::mem::{self, ManuallyDrop, MaybeUninit};
use core::ops::Drop;
use core::ptr::{self, NonNull, Unique};
use core::slice;
#[cfg(not(no_global_oom_han... |
use crate::app::config::AppCommon;
use crate::app::datadogstatsd::{CustomMetrics, DdMetrics};
use crate::app::db;
use crate::app::fetch_actor;
use crate::app::head_actor;
use actix_service::Service;
use actix_web::middleware::Logger;
use actix_web::{get, middleware, post, web, HttpResponse, HttpServer};
use anyhow::{Co... |
use std::convert::TryFrom;
use std::fmt;
use anyhow::{anyhow, Result, Context};
use num_enum::TryFromPrimitive;
pub type Hz = f32;
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum Note {
A,
B,
C,
D,
E,
F,
G,
}
impl Note {
pub fn next(&self) -> Self {
use Note::*;
... |
use crate::ospfv2::*;
use crate::parser::{parse_ospf_vec_u32, parse_ospfv3_router_links, take_vec_u8};
use nom::combinator::cond;
use nom::number::streaming::{be_u24, be_u32};
use nom_derive::*;
use rusticata_macros::newtype_enum;
use std::net::Ipv4Addr;
/// An OSPF version 3 packet
#[derive(Debug)]
pub enum Ospfv3Pac... |
#![allow(clippy::unreadable_literal)]
use crate::avm1::opcode::OpCode;
use crate::avm1::types::*;
use crate::error::{Error, Result};
use crate::read::SwfRead;
use std::io::Cursor;
#[allow(dead_code)]
pub struct Reader<'a> {
inner: Cursor<&'a [u8]>,
version: u8,
}
impl<'a> SwfRead<Cursor<&'a [u8]>> for Reader... |
use log::*;
use rand::prelude::*; // for info, trace, warn, etc.
use mhd_memory::{ScoreType, ZERO_SCORE}; // ScoreType not needed (?!?)
/// # Example Implementations
///
///
///
use optimizer::{Problem, Solution, Solver};
/**************************************************************************************/
// Hel... |
use std::io;
use std::iter::Peekable;
use std::path::Path;
use proc_macro::{
Delimiter, Diagnostic, Level, Literal, Spacing, Span, TokenNode,
TokenStream, TokenTree, TokenTreeIter
};
use literalext::LiteralExt;
use ast::{self, Ident};
use Result;
use util::Spanned;
/// Parses the input token stream into an ... |
//! Parsing of CLI flags
//!
//! The [`Action`] enum represents what action to perform based on the
//! command-line arguments passed to the program.
use std::{
collections::HashMap,
env,
fmt::Write,
fs::File,
io::{BufRead, BufReader, Read},
path::{Path, PathBuf},
str::FromStr,
string::... |
//! The `darling::Error` type and its internals.
//!
//! Error handling is one of the core values of `darling`; creating great errors is hard and
//! never the reason that a proc-macro author started writing their crate. As a result, the
//! `Error` type in `darling` tries to make adding span information, suggestions, ... |
use crate::{get_zero_hash, Hash256, HASHSIZE};
use eth2_hashing::{Context, Sha256Context, HASH_LEN};
use smallvec::{smallvec, SmallVec};
use std::mem;
type SmallVec8<T> = SmallVec<[T; 8]>;
#[derive(Clone, Debug, PartialEq)]
pub enum Error {
/// The maximum number of leaves defined by the initialization `depth` ha... |
use codespan::{ByteIndex, ByteOffset, ByteSpan};
use codespan_reporting::{Diagnostic, Label as DiagnosticLabel};
use im;
use moniker::{Binder, Embed, FreeVar, Nest, Scope, Var};
use pikelet_core::syntax::{Label, Level, LevelShift};
use crate::syntax::concrete;
use crate::syntax::raw;
/// The environment used when de... |
//! This module abstracts the communication with GitHub API for a given crate
use anyhow::{anyhow, Result};
use chrono::{DateTime, Duration, FixedOffset, Utc};
use guppy::graph::PackageMetadata;
use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION, USER_AGENT};
use serde::{Deserialize, Serialize};
use std::coll... |
#![feature(test)]
extern crate test;
use rustfft;
use std::sync::Arc;
use test::Bencher;
use rustfft::FFT;
use rustfft::num_complex::Complex;
use rustfft::algorithm::*;
use rustfft::algorithm::butterflies::*;
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_fft(b: ... |
use std::{
ptr,
sync::atomic::{AtomicPtr, Ordering},
};
#[cfg(target_os = "windows")]
use std::{ffi::OsStr, mem, os::windows::prelude::OsStrExt, thread};
use anyhow::anyhow;
use libwebrtc_sys as sys;
#[cfg(target_os = "linux")]
use pulse::mainloop::standard::IterateResult;
#[cfg(target_os = "windows")]
use ... |
/*!
This module defines a low level and *mostly* safe abstraction around the
core PCRE2 regex primitives. Callers may still need to deal with some
unsafety, but this layer will take care of the obvious things, such as
resource management and error handling.
*/
use std::cmp;
use std::ptr;
use std::slice;
use libc::c_v... |
//! Parsing and cleanup logic to extract data out of the Detailed Info
//! section of product pages.
use color_eyre::eyre::{eyre, Result, WrapErr};
use lazy_static::lazy_static;
use regex::Regex;
use std::collections::HashMap;
use std::str::FromStr;
/// Data extracted from the Detailed Info section of product pages.
... |
// 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 crate::{
align::{AlignAlgorithm, AlignMode, Banded, DEFAULT_BLOCKSIZE, DEFAULT_KMER, DEFAULT_WINDOW},
control::Settings,
drawer::{DisplayMode, Style},
view::{Aligned, Unaligned},
};
use cursive::{event::Key, theme::PaletteColor, traits::*, views::*, Cursive, View};
use std::{fmt::Display, str::FromS... |
#![allow(clippy::comparison_chain)]
use std::collections::{BTreeMap, HashSet};
use serde_json::Value;
use crate::helpers::{after_last};
use crate::my_ldap_subjects::{get_subjects_from_urls, get_subjects};
use crate::my_types::*;
use crate::api_log;
use crate::my_err::{Result, MyErr};
use crate::ldap_wrapper::{LdapW,... |
#![deny(warnings)]
use std::io::{self, BufReader, Write};
use std::path::{Component, Path};
use std::process::{Command, Stdio};
use std::{env, str};
use anyhow::{bail, Result};
use cargo_metadata::{Artifact, CargoOpt, Message, Metadata, MetadataCommand};
use clap::{App, AppSettings, Arg, ArgMatches};
use rustc_cfg::C... |
use super::*;
impl<T: Config> Pallet<T> {
/// Helper function for getting next base ID
/// Currently, BaseId is auto-incremented from zero, may be worth changing
/// to BoundedVec to allow arbitrary/unique naming, making cross-chain functionality
/// more tenable
pub fn get_next_base_id() -> Result<BaseId, Error<... |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use anyhow::{bail, Context};
use aws_sdk_polly::model::{Engine, OutputFormat, VoiceId};
use aws_sdk_transcribe::model::{LanguageCode, Media, MediaFormat};
use clap::{crate_authors, crate_description, crate... |
// 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... |
use crate::entry::{Descriptor, EntryRights};
use crate::fd;
use crate::path::PathGet;
use crate::sys::entry::OsHandle;
use crate::wasi::{types, Errno, Result};
use std::convert::TryInto;
use std::ffi::{OsStr, OsString};
use std::fs::{File, OpenOptions};
use std::os::windows::ffi::{OsStrExt, OsStringExt};
use std::os::w... |
//! Types and macros for defining library functions in Rust, callable from Lea.
use value::Value;
use mem::{GcStrategy, TracedRef};
use number::*;
use Str;
use VM;
use std::hash::*;
use std::fmt;
/// Kinds of error objects a `LibFn` can return
pub enum LibFnError {
Val(Value),
String(String),
}
impl From<St... |
use std::f64::consts::PI;
const TWO_PI: f64 = PI * 2.0;
pub struct DspaceOptions {
pub irez: f64,
pub d2201: f64,
pub d2211: f64,
pub d3210: f64,
pub d3222: f64,
pub d4410: f64,
pub d4422: f64,
pub d5220: f64,
pub d5232: f64,
pub d5421: f64,
pub d5433: f64,
pub dedt: f64... |
#![allow(missing_docs)]
use super::sigma_byte_writer::SigmaByteWrite;
use crate::serialization::{
sigma_byte_reader::SigmaByteRead, SerializationError, SigmaSerializable,
};
use crate::types::stuple::STuple;
use crate::types::stype::SType;
use crate::types::stype_param::STypeVar;
use sigma_ser::vlq_encode;
use std... |
use std::collections::hash_map::Entry as HMEntry;
use std::net::SocketAddr;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{mpsc, Arc, RwLock};
use std::time::Duration;
use std::{io, thread};
use bincode;
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use bytes::{BufMut, Bytes, BytesMut};
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.