text
stringlengths
7.05k
33.9k
//! //! Easy-to-use asset manager for many environments. //! //! # Goals //! //! This crate is written with following goals in mind: //! //! * **Batteries included.**\ //! Crate comes with variety of simple data sources like [`FileSource`] and [`HttpSource`]. //! Few [`Format`]s based on serde are included under fe...
use lazy_static::lazy_static; use std::{collections::HashMap, fmt::Display}; /// Represents the information needed to decode an instruction using the opcode. /// /// Contains: /// * Assembler Mnemonic (LDA, ADC, etc.) /// * Addressing mode /// * Changes to status flags /// * Cycles /// * Possible changes to cycles due...
//! Window management. use context::Context; use vek::{Vec2, Extent2, Rect, Rgba}; use os::{OsWindow, OsWindowHandle, OsWindowFromHandleParams}; use gl::{GLPixelFormatChooser}; use error::{self, Result}; impl Context { /// Attempts to create a new `Window` that satisfies given settings. pub fn create_window(&...
use derive_more::{Display, From}; use derive_new::new; use io::{Bytes, Read}; use std::str::FromStr; use std::{io, num}; #[derive(Debug, Display, Clone, Copy)] #[display(fmt = "at line {} column {}", line, col)] pub struct Pos { line: usize, col: usize, } impl Pos { fn inc(&mut self, c: u8) { if c == b'\n' ...
use bit_field::BitField; use bitflags::bitflags; use crate::x86_64::msr::{Msr, MsrReadWrite}; bitflags! { /// 24.6.1 Pin-Based VM-Execution Controls. pub struct PinVmExecControls: u32 { /// VM-Exit on vectored interrupts #[allow(clippy::identity_op)] const INTR_EXITING = 1 << 0; ...
#![deny(missing_docs)] #![allow(clippy::needless_doctest_main)] //! A library for doing live-reloading game development. //! //! This is inspired by the article ["Interactive Programming in C"][] by Chris //! Wellons, and the video ["Loading Game Code Dynamically"][] from Handmade //! Hero by <NAME>. //! //! ["Interac...
//! Format match expression. use std::iter::repeat; use syntax::source_map::{BytePos, Span}; use syntax::{ast, ptr}; use crate::comment::{combine_strs_with_missing_comments, rewrite_comment}; use crate::config::lists::*; use crate::config::{Config, ControlBraceStyle, IndentStyle}; use crate::expr::{ format_expr,...
use core::fmt; use mc_crypto_digestible::{DigestTranscript, Digestible, MerlinTranscript}; use serde_json::json; use std::{ops::Deref, vec::Vec}; // Digestible AST node types /// Represents a node in the AST /// /// Here "AST" means "abstract syntax tree", corresponding to the structure /// that we inferred from the ...
use std::cell::RefCell; use std::collections::{hash_map::Entry, HashMap}; use std::path::{Path, PathBuf}; use std::rc::Rc; use std::io::Write; use sylt_common::error::Error; use sylt_common::prog::{Prog, BytecodeProg}; use sylt_common::{Op, RustFunction, Type, Value}; use sylt_parser::statement::NameIdentifier; use syl...
// Copyright 2019 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT // http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD // https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied, // modified, or di...
//! An asynchronously awaitable mutex for synchronization between concurrently //! executing futures. use crate::{ intrusive_double_linked_list::{LinkedList, ListNode}, utils::update_waker_ref, NoopLock, }; use core::{ cell::UnsafeCell, ops::{Deref, DerefMut}, pin::Pin, }; use futures_core::{ ...
/* * Copyright 2018 Bitwise IO, 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 agree...
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::{ both, count_eq, eq_expr_value, get_enclosing_block, get_parent_expr, if_sequence, in_macro, is_else_clause, is_lint_al...
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::path::{Path, PathBuf}; use std::sync::Arc; use std::{env, fs}; use failure::{bail, format_err}; use tempfile::Builder as TempFileBuilder; use crate::core::compiler::Freshness; use crate::core::compiler::{CompileKind, DefaultExecutor, Executor}; us...
// //! Copyright 2020 Alibaba Group Holding Limited. //! //! 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 ...
//! Common module with common used structures across different //! commands. use crate::common::WasmFeatures; use anyhow::{Error, Result}; use clap::Clap; use std::path::PathBuf; use std::str::FromStr; use std::string::ToString; #[allow(unused_imports)] use std::sync::Arc; use wasmer::*; #[cfg(feature = "compiler")] u...
#![allow(non_camel_case_types,non_snake_case,non_upper_case_globals)] extern crate libc; use std::os::raw; use std::sync::{Once, ONCE_INIT}; pub const MAX_OID_LEN: libc::size_t = 128; pub const STAT_SUCCESS: raw::c_int = 0; pub const STAT_ERROR: raw::c_int = 1; pub const STAT_TIMEOUT: raw::c_i...
use std::sync::{Arc, Mutex}; use std::rc::Rc; use std::collections::{HashMap, HashSet}; use arrow::array::*; use arrow::datatypes::*; use arrow::record_batch::RecordBatch; use arrow::datatypes::DataType; use histo_fp::Histogram; use noisy_float::prelude::*; use crate::error::*; #[derive(Clone)] pub struct ChunkedArra...
use std::fmt; use std::rc::Rc; use std::collections::{HashMap, HashSet}; use std::cmp::PartialEq; use std::hash::{Hash, Hasher}; use std::iter::{Iterator, IntoIterator}; use ast::Loc; use typecheck::types::{TypeEnv, TypeRef}; #[derive(Debug,Clone)] pub struct BoundType<'ty, 'object: 'ty> { pub ty: TypeRef<'ty, 'o...
use core::fmt; use std::{ cmp::Ordering, collections::HashMap, error::Error, fmt::Display, io::{stdin, BufRead}, mem, num::NonZeroU8, }; #[derive(Copy, Clone, Debug, Default, PartialEq, Eq)] struct Point(u8, u8); impl Ord for Point { fn cmp(&self, other: &Self) -> Ordering { match self.1 != other....
use std::str; use std::u64; use message as m; use kailua_diag as diag; use kailua_env::{SourceData, Pos, Span, Spanned, WithLoc}; use kailua_env::SourceData::{U8, U16, EOF}; use kailua_diag::{Report, Reporter, Localize}; use super::{Tok, Punct, Keyword}; fn is_digit(c: SourceData) -> bool { match c { U8(b'0'...b...
mod construction_combine; mod construction_derive; mod construction_hash; mod construction_metadata; mod construction_parse; mod construction_payloads; mod construction_preprocess; mod construction_submit; use crate::ledger_client::blocks::Blocks; use crate::{convert, models, API_VERSION, NODE_VERSION}; use ic_interfa...
// Copyright 2021 The Chromium OS 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 std::io::Read; use std::ops::Deref; use std::sync::{mpsc::Sender, Arc}; use std::thread; use crate::virtio::{DescriptorChain, Interrupt, Queue, Re...
use num::{Num, NumCast}; use std::ops::{Add, Sub, Mul, Div}; use std::fmt::{Debug, Formatter, Result}; const DEBUG: bool = false; /* d8888b. d888888b d8b db d888b d88888b db d88888b .88b d88. d88888b d8b db d888888b 88 `8D `88' 888o 88 88' Y8b 88' 88 88' 88'YbdP`88 88' 888o 88 ...
extern crate rand; extern crate time; use time::PreciseTime; use std::fmt::Display; use std::fmt; use std::fmt::Write; use rand::Rng; use std::thread; use std::default::Default; use std::sync::mpsc::channel; /* Tile | a | | \ b \ \ / c / / */ #[derive(Default, Debug, Copy, Clone)] ...
// <NAME> -- Proof of concept spectral path tracer in Rust // Copyright (C) 2014-2015 <NAME> // // 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 Free Software Foundation, either version 3 of the License, or // (at your...
mod error; mod factory; #[cfg(test)] mod tests; pub use factory::ServiceExecutorFactory; use std::{ cell::RefCell, collections::HashMap, marker::PhantomData, ops::{Deref, DerefMut}, panic::{self, AssertUnwindSafe}, rc::Rc, sync::Arc, }; use cita_trie::DB as TrieDB; use common_apm::muta_a...
use crate::{ types::w3c::*, collections::team::players, common::points, stains::cyber::{ utils::{ get_race2, get_map } } }; use serenity::{ prelude::* }; use reqwest; use std::collections::HashMap; use tokio::sync::{ Mutex, MutexGuard }; lazy_static! { pub static ref GAMES: Mutex<HashMap<String, T...
use crate::{ field::BaseType, parse::{self, ByteParser}, ClassError, ClassResult, }; /// Represents some type, whether it is a reference type or a primitive type /// like `int`. /// /// ```txt /// type := <primitive_type> | <reference_type> ; /// ``` #[derive(Clone, Debug, Eq, PartialEq, Hash)] pub enum Ty...
#![no_std] extern crate alloc; use crate::{ custom_types::custom_types::{ FundingTrancheSerialized, GovernanceProposalSerialized, GovernanceVoteConfigurationSerialized, MilestoneSerialized, ProposalSerialized, RatiosSerialized, SponsorsSerialized, VoteConfigurationSerialized, }, erro...
use crate::{ material::{ParticleMaterial, ParticleMaterialUniformData}, particles::Particles, }; use bevy::{ app::prelude::*, asset::{Assets, Handle, HandleUntyped}, core_pipeline::Transparent3d, ecs::system::SystemState, ecs::{prelude::*, system::lifetimeless::*}, math::prelude::*, ...
// Copyright 2017 Amagicom AB. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to...
#![windows_subsystem = "windows"] use std::{collections::hash_map::RandomState, collections::HashMap, env, f32, io, mem, path}; use cgmath; use fluent_bundle::{FluentBundle, FluentResource}; use ggez::{ *, audio::SoundSource, event::{self, MouseButton}, graphics::{self, Align, Color, Font, Text}, }; u...
#![deny( trivial_casts, trivial_numeric_casts, unused, unused_qualifications, rust_2018_compatibility, rust_2018_idioms, future_incompatible, nonstandard_style, missing_copy_implementations )] #![allow(missing_debug_implementations, clippy::new_without_default)] mod geometry; pub u...
use std::cmp::min; use std::env; use std::error::Error; use std::fmt; use std::fmt::Display; use std::fs; use std::io::Write; use std::path::PathBuf; use std::time::Instant; use coarse_prof::profile; use global_stash::stash_scope; use log::{error, info, warn}; use structopt::StructOpt; use hamilton::{register_compone...
//! Rusticized interface for the FFI. mod input; mod alignment; pub mod config; pub mod state; use std::char; use colors::Color; use geometry::{Rect, Point, Size}; use self::config::{ConfigPart, Window}; use bear_lib_terminal_sys as ffi; use bear_lib_terminal_sys::ColorT; pub use self::input::{Event, KeyCode}; pub ...
use std::collections::HashMap; use std::fmt; use error_chain::bail; use serde_derive::{Deserialize, Serialize}; use url::Url; use flowcore::input::InputInitializer; use flowcore::output_connection::OutputConnection; use crate::compiler::loader::Validate; use crate::errors::*; use crate::model::io::IOSet; use crate::...
use std::{ borrow::Cow, sync::{ atomic::{AtomicBool, AtomicU64, Ordering}, Arc, }, }; use camino::{Utf8Component, Utf8Path, Utf8PathBuf}; use rclone_crypt::decrypter::Decrypter; use tracing::instrument; use crate::{ cache_handlers::{ crypt_context::CryptContext, crypt_passthrou...
use std::{ error::Error, fs::File, io::{Read, Seek, SeekFrom}, mem, path::{Path, PathBuf}, time::{Duration, SystemTime}, }; use eyre::WrapErr; use hashbrown::HashMap; use treasury_id::AssetId; use url::Url; use crate::{scheme::Scheme, sha256::HashSha256}; const PREFIX_STARTING_LEN: usize = 8;...
use crate::{ game_events::{CompoundEventType, EventBroker}, GameEvent::{ChangeExhaustion, Remove}, *, }; use crate::{ game_events::{EventComposer, EventConsumer}, game_logic::game::Game, matchbox::MatchboxClient, GameEvent::Place, Power::{Blast, TargetedShoot}, }; use macroquad::prelude...
use std::fmt; #[derive(Copy, Clone)] pub enum Instruction { Constbyte, Constshort, Getglobal, Setglobal, Cur, Switch, Branch, Branchif, Branchifnot, Popbranchifnot, Branchifneqtag, Branchifeq, Branchifneq, Branchiflt, Branchifgt, Branchifle, Branchifge, Branchinterval, Ccall1, C...
use serde_derive::{Deserialize, Serialize}; use serde_json::json; use std::sync::Arc; use super::transit; use super::transit::{RelayUrl, Transit}; use super::Wormhole; use anyhow::{bail, ensure, format_err, Context, Result}; use async_std::fs::File; use async_std::io::prelude::WriteExt; use async_std::io::BufReader; u...
//! Asuran `FlatFile`'s are structured as an initial header, followed by an append //! only log of 'entries'. //! //! # Initial Header //! //! The initial header contains three components: //! //! 1. Magic Number //! //! The magic number identifying asuran `FlatFile`s is the 8-byte string //! `b"ASURAN_F"`. //!...
//! Functionalities to build quotient graphs from //! a set of generators and manage the orbits. use custom_debug_derive::Debug; use itertools::{Either, Itertools, MinMaxResult}; use libffi::high::{ClosureMut2, ClosureMut3, ClosureMut6}; use nauty_Traces_sys::{ allgroup, densenauty, groupautomproc, grouplevelproc,...
#![allow(non_snake_case)] use core::iter; use curve25519_dalek::constants::RISTRETTO_BASEPOINT_POINT; use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint}; use curve25519_dalek::scalar::Scalar; use curve25519_dalek::traits::{VartimeMultiscalarMul, MultiscalarMul}; use merlin::Transcript; use rayon::pr...
use super::{blocks::*, f64x2}; use num::traits::FloatConst; use num::{One, Zero}; use num_traits::AsPrimitive; #[inline] const fn pow2(n: i32) -> f64 { f64::from_bits(((0x3ff + n) as u64) << 52) } impl f64x2 { #[inline] pub const fn new(hi: f64, lo: f64) -> Self { Self { hi, lo } } #[inline] pub cons...
// Copyright 2019-2020 Alibaba Cloud. All rights reserved. // Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // // Portions Copyright 2017 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license ...
use super::{ lsp_receiver::LspReceiver, lsp_sender::LspSender, LspMessageOpaque, LspNotification, LspRequest, }; use crate::docs::{DocChange, Docs}; use jl_compiler::rust_api::{Content, Doc, LangService}; use log::trace; use lsp_types::request::*; use lsp_types::*; use std::{ collections::HashSet, io::{Read...
use chrono::{DateTime, TimeZone, Utc}; use ethabi::{Address, Hash}; use std::{ convert::TryFrom, ops::Sub, time::{Duration, Instant}, }; use std::{convert::TryInto, fmt::Debug}; use tokio::task::JoinHandle; use tokio::time; use web3::{ contract::Contract, transports::Http, types::{BlockNumber, F...
use std::collections::{BTreeMap, HashMap}; use std::env; use std::sync::Arc; use std::time::Duration; use crate::config::{Config, ProviderDetails}; use crate::manager::deployment::Deployment; use crate::manager::PanicSubscriptionManager; use crate::store_builder::StoreBuilder; use crate::MetricsContext; use ethereum::...
//! Listening server for receiving client connections which speak SrvProtocol. //! //! The server runs in a separate thread and dispatches operational commands to the main thread //! over an unbounded mpsc channel, `MgrSender`, to `MgrReceiver`. These commands are wrapped in //! a [`ctl_gateway.CtlRequest`] if they are...
//! # RTWins TUI library //! `RTWins` is a Rust library designed for easy creation of visual terminal applications. //! //! *Future goal: make it run on non-os platforms, like bare Cortex-M3.* //! //! It provides basic facilities required by interactive applications such as screen and cursor management, keyboard input,...
mod config; mod decoder; mod encoder; mod input; mod merger; mod output; mod record; mod splitter; mod utils; #[cfg(feature = "capnp-recompile")] extern crate capnp; extern crate chrono; extern crate chrono_tz; extern crate clap; extern crate flate2; #[cfg(feature = "file")] extern crate glob; #[cfg(feature = "kafka-o...
// Copyright 2020-2021 <NAME> under the terms of the MIT License as detailed // in the accompanying file README.md or <https://opensource.org/licenses/MIT>. //! Lighting algorithms for `Space`. This module is closely tied to `Space` //! and separated out for readability, not modularity. use std::convert::TryInto as _...
// Copyright 2016 The RLS Project Developers. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // exce...
/* Copyright (C) 2017 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free * Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARR...
// Copyright 2014 Google Inc. 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 crate::utils::{DiscSynchronized, JsonDiscSynchronized}; use crate::{collection, Cache}; use itertools::Itertools; use log::{info, warn}; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; use std::cmp::Ordering::Equal; use std::collections::hash_map::DefaultHasher; use std::collections::{BTreeMap, BTre...
/* Copyright (C) 2018 <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, copy, modify, merge, publish, distribute...
// Copyright Rivtower Technologies 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 ...
// Copyright 2019 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::{format_err, Context as _, Error}, fidl_fuchsia_test as ftest, ftest::{Invocation, Result_ as TestResult, RunListenerProxy, Statu...
// Copyright 2019-2021 Parity Technologies (UK) Ltd. // // Permission is hereby granted, free of charge, to any // person obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the // Software without restriction, including without // limitation the rights to use, copy, mod...
// SPDX-License-Identifier: MIT // Copyright (C) 2018-present iced project and contributors use crate::encoder::op_code::OpCodeInfo; #[cfg(feature = "mvex")] use crate::mvex::get_mvex_info; use crate::*; use alloc::string::String; use core::fmt; use core::fmt::Write; // GENERATOR-BEGIN: LKind // ⚠️This was generated ...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{ cfgir::{ ast::{BasicBlock, BasicBlocks, BlockInfo, LoopEnd, LoopInfo}, remove_no_ops, }, errors::*, hlir::ast::{Command, Command_, Exp, ExpListItem, Label, UnannotatedExp_, UnitCase}, sha...
//! Utilities related to displaying/formatting the edits computed as the difference between two //! ASTs use crate::diff::{Hunk, Hunks, Line}; use anyhow::Result; use console::{Color, Style, Term}; use log::{debug, info}; use serde::{Deserialize, Serialize}; use std::{ cmp::{max, Ordering}, io::{BufWriter, Wri...
use std::error::Error; use std::{env, fs, process}; use object::read::elf::{FileHeader, Rel, Rela, SectionHeader}; use object::Endianness; use object::{elf, pe, ReadRef, SectionIndex}; fn main() { let mut args = env::args(); if args.len() != 3 { eprintln!("Usage: {} <infile> <outfile>", args.next().un...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 02/01/2018 Last Modified: 12/10/2018 License: MIT */ use whitebox_raster::*; use whitebox_common::rendering::html::*; use whitebox_common::rendering::Histogram; use crate::tools::*; use rand::prelude::*; use std::env; u...
// //! Copyright 2020 Alibaba Group Holding Limited. //! //! 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 appl...
use super::{ super::{Emitter, Typifier}, constants::ConstantSolver, error::ErrorKind, SourceMetadata, }; use crate::{ proc::ResolveContext, Arena, BinaryOperator, Binding, Block, Constant, Expression, FastHashMap, Function, FunctionArgument, GlobalVariable, Handle, Interpolation, LocalVariable, ...
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 //! Cerberus manifest containers. //! //! A "manifest container" is a frame around a Cerberus manifest that provides //! certain security properties: //! - Containers ar...
use super::{BlankIdBuf, StringLiteral}; use iref::IriBuf; use langtag::LanguageTagBuf; use locspan::{Loc, Location, Span}; use std::fmt; use std::iter::Peekable; /// Changes a `char` iterator into a `DecodedChar` iterator using each character /// UTF-8 encoded length. pub struct Utf8Decoded<C>(C); impl<C> Utf8Decoded...
use crate::netflow::models::general::SerialId; use crate::message::proto; use std::collections::{BTreeMap, VecDeque}; use crate::netflow::connection::Connection; use std::sync::{Arc, Mutex}; use tokio::sync::oneshot; use tokio::time; use crate::entity::errors::ProducerError; use crate::discovery::response::BrokerLoc; u...
use crate::conn::AmConnCore; use crate::protocol::parts::{Parts, ResultSetMetadata, Row, StatementContext}; use crate::protocol::{ util, Part, PartAttributes, PartKind, ReplyType, Request, RequestType, ServerUsage, }; use crate::sync_prepared_statement::AmPsCore; use crate::{HdbError, HdbResult}; use serde_db::de::...
use crate::{ error::{RispError, RispResult}, lenv::Lenv, lval::{ lval_add, lval_join, lval_lambda, lval_num, lval_pop, lval_qexpr, lval_sexpr, Lval, LvalFun, }, }; use log::debug; use std::{ collections::HashMap, ops::{Add, Div, Mul, Rem, Sub}, }; // macro to shorten code for applying a...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 27/01/2019 Last Modified: 27/01/2019 License: MIT */ use crate::raster::*; use crate::structures::Array2D; use crate::tools::*; use num_cpus; use std::env; use std::f64; use std::io::{Error, ErrorKind}; use std::ops::Ad...
use std::io::Write; use std; use chrono::*; use utility::string::*; use model::IconItem; use model::ShowReplyItem; use model::ShowItem; use reply_model::*; use screen::common::*; const title: &'static str = "連登"; const replier_max_width: usize = 14; const time_max_width: usize = 5; const icon_width: usize = 2; const ...
#![allow(clippy::type_complexity)] use darling::util::{Flag, Override, SpannedValue}; use darling::{ast, FromDeriveInput, FromField, FromMeta, ToTokens}; use proc_macro2::TokenStream; use quote::quote; use syn::spanned::Spanned; use syn::{parse_macro_input, DeriveInput}; #[derive(FromMeta)] struct SliderOptions { ...
use sha2::{ Digest, Sha256 }; use rand::AsByteSliceMut; type Hash = [u8; 32]; pub fn hash_value(value: usize) -> Hash { let mut hash = [0u8; 32]; let mut hasher = Sha256::new(); hasher.update(value.to_le_bytes()); hash.copy_from_slice(&hasher.finalize()); hash } pub fn hash_pair(left: Has...
use alloc_crate::sync::Arc; use alloc_crate::vec::Vec; use core::fmt; use core::fmt::Display; use core::sync::atomic::{AtomicU32, AtomicU8, Ordering}; use super::device; use super::{PCIAddress, PCIDevice}; use crate::acpica::resource::{ExtendedIrq, Polarity, TriggerMode}; use crate::acpica::{AcpiDevice, AcpiResult, PC...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Flash Status Register"] pub fstat: FSTAT, #[doc = "0x01 - Flash Configuration Register"] pub fcnfg: FCNFG, #[doc = "0x02 - Flash Security Register"] pub fsec: FSEC, _reserved3: [u8; 1usize], #[doc = "0x04 - Flash Common Com...
#![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] #![allow(clippy::string_lit_as_bytes)] use frame_support::{ decl_error, decl_event, decl_module, decl_storage, dispatch::Vec, ensure, traits::Time, StorageMap, StorageValue, }; use frame_system::ensure_signed; use sp_runtime::DispatchResult...
// BS1770 -- Loudness analysis library conforming to ITU-R BS.1770 // Copyright 2020 <NAME> // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // A copy of the License has been included in the root of the repository. extern crate bs17...
#[macro_use] extern crate enum_primitive_derive; #[macro_use] extern crate log; extern crate base64; pub mod configuration; use crate::configuration::Configuration; use base64::{decode, encode}; use http::StatusCode; use num_traits::{FromPrimitive, ToPrimitive}; use serde_json::json; use serde_json::value::Value as J...
use array_macro::array; use alloc::boxed::Box; use alloc::sync::Arc; use core::mem; use core::sync::atomic::{AtomicBool, Ordering}; use core::option::Option; use core::ptr; use core::cell::UnsafeCell; use crate::consts::{PGSIZE, fs::{NFILE, ROOTIPATH}}; use crate::mm::{PageTable, RawPage, RawSinglePage}; use crate::r...
use bevy::prelude::*; use crate::{ game::{ components::{ AbilityDataId, AbilityEffect, AbilityInstance, AbilityType, CardInstance, EffectTarget, PlayerController, PlayerInstance, Position, PositionType, TriggerCondition, UnitInstance, UnitInstanceRef, UnitVar, },...
use std::ffi::{CStr, CString}; use std::os::raw::c_char; extern crate log; #[no_mangle] pub extern "C" fn rust_greeting(to: *const c_char) -> *mut c_char { let c_str = unsafe { CStr::from_ptr(to) }; let recipient = match c_str.to_str() { Err(_) => "there", Ok(string) => string, }; CSt...
use alloc::{boxed::Box, collections::BTreeMap, string::String, sync::Arc, vec::Vec, sync::Weak}; use core::fmt; use log::*; use spin::{Mutex, RwLock}; use xmas_elf::{ElfFile, header, program::{Flags, Type, SegmentData}}; use rcore_memory::PAGE_SIZE; use rcore_thread::Tid; use core::str; use crate::arch::interrupt::{C...
/// Main message for a rate limit request. The rate limit service is designed to be fully generic /// in the sense that it can operate on arbitrary hierarchical key/value pairs. The loaded /// configuration will parse the request and find the most specific limit to apply. In addition, /// a RateLimitRequest can contain...
// // Central Processing Unit // #![allow(dead_code)] pub mod instructions; use std::str; use std::fmt; use std::io::prelude::*; use std::fs::{OpenOptions, File}; use colored::*; use mmu::Memory; // CPU Clock speed // TODO: Disable if log level > TRACE pub const INSTR_DEBUG: bool = false; // very laggy, n...
//! # FreeSWITCH inbound socket. //! //! ADR: //! Initially we thought about creating a design that polls the events and the commands at the same //! time, but it turned out that select! not simple to use on futures that are not cancellation safe //! (which our event reader isn't, because of the intermediate buffers). ...
#[cfg(test)] #[path = "../../tests/unit/population/rosomaxa_test.rs"] mod rosomaxa_test; use super::*; use crate::algorithms::gsom::*; use crate::algorithms::math::relative_distance; use crate::population::elitism::{DominanceOrdered, Shuffled}; use crate::utils::{Environment, Random}; use rand::prelude::SliceRandom; u...
use crate::renderer::{FluidRenderingMode, SceneRenderer, VolumeVisualizationMode}; use crate::simulation_controller::{SimulationController, SimulationControllerStatus}; use crate::{ render_output::screen::Screen, scene::Scene, simulation::{HybridFluid, SolverConfig, SolverStatisticSample}, ApplicationEv...
extern crate uds; extern crate libc; use std::os::unix::net::{UnixListener, UnixStream, UnixDatagram}; use std::io::ErrorKind::*; use std::io::{IoSlice, IoSliceMut}; use std::fs::remove_file; use std::path::Path; use std::mem::size_of; use libc::{sockaddr, sockaddr_un, socklen_t}; use uds::{UnixSocketAddr, UnixSocke...
use axum::extract::ws::{Message, WebSocket}; use axum::extract::{Extension, WebSocketUpgrade}; use axum::http::StatusCode; use axum::response::IntoResponse; use axum::routing::{get, get_service}; use axum::Router; use dashmap::DashMap; use ndoors::*; use serde::{Deserialize, Serialize}; use std::net::SocketAddr; use st...
use std::{ borrow::Cow, collections::HashMap, fmt::{self, Display, Formatter}, ops::{BitXor, Range}, str, sync::RwLock, }; use bson::{doc, spec::BinarySubtype, Bson, Document}; use hmac::{Hmac, Mac}; use lazy_static::lazy_static; use md5::Md5; use sha1::{Digest, Sha1}; use sha2::Sha256; use cr...
// External deps use zksync_crypto::franklin_crypto::{ bellman::{pairing::ff::PrimeField, ConstraintSystem, SynthesisError}, circuit::{ baby_eddsa::EddsaSignature, boolean::{le_bits_into_le_bytes, AllocatedBit, Boolean}, ecc, expression::Expression, multipack, rescue, ...
use std::cell::RefCell; use geom::{Angle, ArrowCap, Distance, Line, PolyLine, Polygon, Pt2D, Ring, Time, EPSILON_DIST}; use map_model::{ Direction, DrivingSide, Intersection, IntersectionID, IntersectionType, LaneType, Map, Road, RoadWithStopSign, Turn, TurnType, SIDEWALK_THICKNESS, }; use widgetry::{Color, Dr...
#![feature(proc_macro_hygiene, decl_macro)] extern crate chrono; extern crate dotenv; extern crate uuid; #[macro_use] extern crate rocket; extern crate base64; extern crate rocket_contrib; extern crate serde; #[macro_use] extern crate serde_derive; extern crate r2d2; extern crate r2d2_diesel; #[macro_use] extern crate...
use crate::{ device::{Device, PhysicalDevice}, internal::Channel, native, Backend, QueueFamily, }; use hal::{format, image, window as w}; use core_graphics::base::CGFloat; use core_graphics::geometry::{CGRect, CGSize}; use foreign_types::{ForeignType, ForeignTypeRef}; use metal; use objc::rc::auto...
//! Convenience module responsible for translating between rust-analyzer's types and LSP types. use lsp_types::{ self, CreateFile, DiagnosticSeverity, DocumentChangeOperation, DocumentChanges, Documentation, Location, LocationLink, MarkupContent, MarkupKind, Position, Range, RenameFile, ResourceOp, SymbolK...