text
stringlengths
7.05k
33.9k
use super::channel::direct_tcpip::DirectTcpIp; use super::channel::session; use super::channel::session::*; use super::channel::OpenFailure; use super::channel::{Channel, ChannelState}; use super::config::ConnectionConfig; use super::error::ConnectionError; use super::global::*; use super::handler::ConnectionHandler; u...
// Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License in the LICENSE-APACHE file or at: // https://www.apache.org/licenses/LICENSE-2.0 //! Mandlebrot example //! //! Demonstrates use of a custom...
#[doc = "Reader of register STATR2"] pub type R = crate::R<u32, super::STATR2>; #[doc = "Reader of field `P2_0REI`"] pub type P2_0REI_R = crate::R<bool, bool>; #[doc = "Reader of field `P2_1REI`"] pub type P2_1REI_R = crate::R<bool, bool>; #[doc = "Reader of field `P2_2REI`"] pub type P2_2REI_R = crate::R<bool, bool>; ...
pub const ADDOP_NOP : u8 = 0b00000; pub const ADDOP_FADD : u8 = 0b00001; pub const ADDOP_FSUB : u8 = 0b00010; pub const ADDOP_FMIN : u8 = 0b00011; pub const ADDOP_FMAX : u8 = 000100; pub const ADDOP_FMINABS : u8 = 0b00101; pub const ADDOP_FMAXABS : u8 = 0b00110; pub const ADDOP_FTOI : u8 = 0b00111; pub const ADDOP_IT...
use colored::Colorize; use crate::bus::Bus; use std::fmt; use rand::prelude::*; use log::{info, warn}; pub const PROGRAM_START: u16 = 0x200; pub struct Cpu { v: [u8; 16], i: u16, pc: u16, lc: u16, stack: Vec<u16>, block: bool } impl Cpu { pub fn new() -> Cpu { Cpu{ v: ...
use csv; use log::*; use std::collections::HashMap; use std::collections::HashSet; use std::fs; use std::fs::{File, Metadata}; use std::io; use std::io::prelude::*; use std::path::Path; use std::path::PathBuf; use std::process; use std::str::FromStr; use toml; use crate::util::*; use perfcnt::linux::perf_file::PerfFi...
// Copyright 2013 <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::{ convert::TryFrom, sync::{Arc, Mutex}, }; use crate::{ database::sled::SledEventDatabase, derivation::basic::Basic, derivation::self_addressing::SelfAddressing, derivation::self_signing::SelfSigning, error::Error, event::sections::seal::{DigestSeal, Seal}, event::{event_da...
use crate::{ pipeline::shader_module, renderer::device::Dev, Buffer, BufferError, ImmediateFrameInfo, IndexBuffer, IndirectBuffer, Input, Module, MultiWriteBuffer, Output, RenderPass, RenderRecordInfo, UInt, Uniform, UniformBuffer, UpdateRecordInfo, VertexBuffer, WriteBuffer, WriteType, Yes, }; use ash:...
//! The types modules describes all the structures to express FITS files. use std::str::FromStr; use std::fmt::{Display, Formatter, Error}; /// Representation of a FITS file. #[derive(Debug, PartialEq)] pub struct Fits<'a> { /// The primary HDU pub primary_hdu: HDU<'a>, /// The extention HDUs pub exte...
//! System for the navigation tree and default input systems to get started. use crate::{ events::{Direction, NavRequest, ScopeDirection}, resolve::{max_by_in_iter, ScreenBoundaries}, Focusable, Focused, }; use bevy::{ecs::system::SystemParam, prelude::*}; /// Control default ui navigation input buttons pu...
#![recursion_limit = "128"] #[macro_use] extern crate log; #[macro_use] extern crate failure; #[macro_use] extern crate serde_derive; extern crate static_assertions as sa; pub mod config; use async_trait::async_trait; use bb8_cypher::CypherConnectionManager; use cid::{Cid, ToCid}; use failure::Error; use futures::fu...
// Copyright 2018 Google LLC // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. //! The RSA public-key cryptosystem. mod bits; pub use public::rsa::bits::{RsaKeyBits, B2048, B3072, B4096, B6144, B8192}; use std::co...
#![forbid(unsafe_code)] #![allow(dead_code)] #![allow(unused_imports)] // Main library 'btu_scheduler' // These modules are located in adjacent files. use mysql::PooledConn; use mysql::prelude::Queryable; use serde::Deserialize; pub mod btu_cron; pub mod config; pub mod errors; pub mod logging; pub mod rq; pub mod sc...
use aws_sdk_ec2::client::fluent_builders::RunInstances; use aws_sdk_ec2::error::RunInstancesError; use aws_sdk_ec2::model::{ ArchitectureValues, Filter, IamInstanceProfileSpecification, InstanceType, ResourceType, Tag, TagSpecification, }; use aws_sdk_ec2::output::RunInstancesOutput; use aws_sdk_ec2::types::Sdk...
/* * Copyright (c) 2021 Arm Limited. * * SPDX-License-Identifier: MIT * * 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 ...
//! Singleton für Zugriffsrechte auf Anschlüsse. #[cfg(not(raspi))] use std::collections::HashSet; use std::sync::{ mpsc::{channel, Receiver, Sender}, Arc, Mutex, PoisonError, }; use std::thread; use cfg_if::cfg_if; use log::{debug, error}; use num_x::u3; use once_cell::sync::Lazy; use paste::paste; use supe...
use crate::println; pub const SIGBLOCK_SIZE: usize = 0x1000; const VERSION_STR: &'static str = "Xous OS Loader v0.9.1\n\r"; // v0.9.0 -- initial version // v0.9.1 -- booting with hw acceleration, and "simplest signature" check on the entire xous.img blob pub const STACK_LEN: u32 = 8192 - (7 * 4); // 7 words for back...
//! 直線の集合。 use std::cmp::Reverse; use std::collections::BTreeMap; use std::fmt::{self, Debug}; type Line = (i128, i128); type Interval = (i128, i128); const MIN: i128 = std::i128::MIN; const MAX: i128 = std::i128::MAX; /// 直線の集合。 /// /// 以下のクエリを処理する。 /// - 集合 $S = \\emptyset$ で初期化する。 /// - 集合 $S$ に直線 $y = ax+b$ を追加...
extern crate minifb; extern crate rand; extern crate rodio; use std::convert::TryInto; use std::env; use std::error::Error; use std::fs; use std::io::prelude::*; use minifb::{Key, Scale, Window, WindowOptions}; use rand::prelude::*; use rodio::Sink; const MEMSIZE: usize = 4096; const REG_COUNT: usize = 16; const KEY...
use std::cell::RefCell; use std::rc::Rc; use crate::code::{parse_term, run_code, type_code, Code}; use crate::env::{Consts, Env, OldBinding}; use crate::error::LfscError; use crate::expr::{Expr, Program, Ref}; use crate::token::{Lexer, Token}; fn consume_new_ref<'a, L: Lexer<'a>>(ts: &mut L) -> Result<Rc<Ref>, LfscEr...
use std::collections::HashMap; use std::panic; use chrono::Local; use serenity::{ async_trait, client::{Client, Context, EventHandler}, model::{ channel::Message, gateway::{Activity, Ready}, voice::VoiceState, id::{GuildId, ChannelId, UserId} }, framework::standard::...
// Copyright (c) 2016 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 ...
//! Rust library for interfacing with illumos kernel statistics, `libkstat`. //! //! The illumos `kstat` system is a kernel module for exporting data about the system to user //! processes. Users create a control handle to the system with [`Ctl::new`], which gives them //! access to the statistics exported by their sys...
//! This example allows queries inspired by //! [DataScript](https://github.com/tonsky/datascript) to be run on arbitrary //! JSON objects. //! //! Note that the syntax of the clauses is inspired but not compatible with //! [DataScript](https://github.com/tonsky/datascript), which is itself //! inspired by [Datomic](ht...
use super::*; use crate::{ query_ast::*, query_graph::{Node, NodeRef, QueryGraph, QueryGraphDependency}, ParsedInputValue, }; use connector::{Filter, ScalarCompare}; use prisma_models::{ModelRef, RelationFieldRef}; use std::{convert::TryInto, sync::Arc}; /// Handles nested create cases. /// The resulting g...
#![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, Encode}; use frame_support::ensure; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; use sp_core::Bytes; use sp_runtime::RuntimeString; use sp_std::boxed::Box; use sp_std::vec; use sp_std::vec::Vec; #[cfg(feature = "no_std")] use sp_runtime::R...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - PIO control register"] pub ctrl: CTRL, #[doc = "0x04 - FIFO status register"] pub fstat: FSTAT, #[doc = "0x08 - FIFO debug register"] pub fdebug: FDEBUG, #[doc = "0x0c - FIFO levels"] pub flevel: FLEVEL, ...
// Copyright 2020 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...
//MIT License // //Copyright (c) 2019 basusamit // //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, ...
use super::{ExtractedLexicalGrammar, ExtractedSyntaxGrammar, InternedGrammar}; use crate::error::{Error, Result}; use crate::generate::grammars::{ExternalToken, Variable, VariableType}; use crate::generate::rules::{MetadataParams, Rule, Symbol, SymbolType}; use std::collections::HashMap; use std::mem; pub(super) fn ex...
//! Functions for managing FreeSurfer brain surface parcellations in annot files. //! //! These files assign each vertex of a brain surface mesh to exactly one brain region //! or label. A so-called colortable contains data on the regions, including the region's //! name, an RGB display color, and a unique identifier. ...
use std::{ fmt::{self, Write}, hash::{Hash, Hasher}, }; use codemap::Span; use crate::{common::unvendor, error::SassResult}; use super::{ Attribute, ComplexSelector, ComplexSelectorComponent, CompoundSelector, Namespace, QualifiedName, SelectorList, Specificity, }; const SUBSELECTOR_PSEUDOS: [&str; ...
use anyhow::{anyhow, bail, Context, Result}; use nix::sched::CloneFlags; use nix::NixPath; use passfd::FdPassingExt; use std::ffi::{OsStr, OsString}; use std::fs::{self, File}; use std::ops::{Deref, DerefMut}; use std::os::unix::io::AsRawFd; use std::os::unix::net::UnixStream; use std::path::{Path, PathBuf}; use std::p...
use std::collections::{HashMap, HashSet, VecDeque}; use std::fmt; use std::io::{self, Error, ErrorKind, Write}; use std::mem; use std::pin::Pin; use std::sync::{Arc, Mutex}; use std::thread; use std::time::Duration; use crate::asynk::connector::Connector; use crate::asynk::message::Message; use crate::asynk::proto::{s...
use crate::atomic_mutex::AtomicMutex; use bare_metal::CriticalSection; use core::{mem, slice}; use cortex_m::interrupt; use stm32f3xx_hal::stm32::USB_FS; use usb_device::{endpoint::EndpointType, Result, UsbError}; use vcell::VolatileCell; type EndpointBuffer = &'static mut [VolatileCell<u32>]; pub const NUM_ENDPOINTS...
// Copyright 2021 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { anyhow::{anyhow, Context, Result}, async_lock::Mutex as AsyncMutex, bytes::Bytes, camino::Utf8PathBuf, fidl_fuchsia_developer_bri...
// Copyright 2019 <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 agreed t...
mod templates; use crate::{ config::Config, service::{station::ChannelRemapEntry, stationprovider::StationProvider}, utils::Or, }; use actix_web::middleware::Logger; use actix_web::{dev::Server, web, App, HttpRequest, HttpResponse, HttpServer, Responder}; use actix_web::{middleware::Compat, Error}; use acti...
use std::io::{BufRead, Write}; use itertools::Itertools; use ndarray::{s, Array2}; use crate::chunks::storage::NdArray; use crate::compat::floret::FloretIndexer; use crate::embeddings::Embeddings; use crate::error::{Error, Result}; use crate::storage::StorageView; use crate::util::{read_number, read_string}; use crat...
// Copyright 2017 <NAME>. See the COPYRIGHT // file at the top-level directory of this distribution. // // 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 f...
use crate::Action; use crate::Error; use crate::Interpreter; use crate::Value; use crate::library; fn try_remove_first_item<S>( list: &mut Vec<Value>, msg: S, ) -> Result<Value, Error> where S: Into<String>, { if list.len() == 0 { return Error::invalid_argument_error(msg).into(); } re...
// Copyright 2018 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, modify, mer...
// -*- mode: rust; -*- // // This file is part of curve25519-dalek. // Copyright (c) 2016-2018 <NAME>, <NAME> // See LICENSE for licensing information. // // Authors: // - <NAME> <<EMAIL>> // - <NAME> <<EMAIL>> //! Parallel Edwards Arithmetic for Curve25519. //! //! This module currently has two point types: //! //! *...
//! Helpful methods and structs for operating on the [`Flags`](Flag) of a //! polytope. use std::{ cmp::Ordering, collections::{hash_map::Entry, HashMap, HashSet, VecDeque}, hash::{Hash, Hasher}, iter, ops::Range, }; use crate::{ abs::{ranked::Ranked, Abstract}, float::Float, Polytope,...
/*! # fltk-table A smart table widget for fltk-rs. It aims to reduce the amount of boilerplate required to create a table. ## Usage ```toml,ignored [dependencies] fltk = "1.2" fltk-table = "0.1" ``` ## Example ```rust,no_run use fltk::{ app, enums, prelude::{GroupExt, WidgetExt}, window, }; use fltk_tab...
// FIPS-180-2 compliant SHA-384/512 implementation // // The SHA-512 Secure Hash Standard was published by NIST in 2002. // http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf use core::convert::TryFrom; // NOTE: // 1. AArch64 架构在 ARMv8.4-A 版本里面增加了对 SHA2-512 的支持。 // 2. X86/X86_64 架构的 SHA-NI 目前并不...
use crate::geometry::{LineSegment, Point, Trapezoid}; use crate::internal_iter::InternalIterator; use crate::path::{LinePathCommand, LinePathIterator}; use std::cmp::Ordering; use std::collections::BinaryHeap; use std::mem; use std::ops::Range; /// Converts a sequence of line path commands to a sequence of trapezoids....
mod logging; use structopt; use colored::*; use failure::format_err; use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; use std::{ env, error::Error, fmt, io::Write, path::{Path, PathBuf}, process::{self, Command, Stdio}, sync::{Arc, Mutex}, time::Instant, }; use structopt::St...
use std::fmt; #[derive(Debug, Serialize, Deserialize)] pub enum Category { Ammunition, Attachment, Equipment, Use, Weapon, } #[derive(Debug, Serialize, Deserialize)] pub enum SubCategory { Backpack, Boost, Fuel, Handgun, Headgear, Heal, Jacket, Main, Melee, ...
// Copyright 2017 <NAME> and original developers: // https://github.com/google/highwayhash // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> // // Unless required by applicable law or agreed to in writing, software // distributed under the License is...
use array_init::array_init; use std::{cell::RefCell, collections::BTreeMap as Map, rc::Rc}; mod cell; pub mod dice; mod goti; mod rang; use self::{ cell::{LudoCell as Box, LudoCellType}, goti::LudoGoti, }; pub use rang::Rang; // 'Colour' use krne se confusion hota h kyunki crossterm::Color me bhi h #[derive(...
#[cfg(test)] pub mod tests; use algebra::{Field, PrimeField, ToBits}; use primitives::signature::schnorr::field_based_schnorr::{ FieldBasedSchnorrPk, FieldBasedSchnorrSignature, }; use r1cs_crypto::{ crh::{FieldBasedHashGadget, TweedleFrPoseidonHashGadget as PoseidonHashGadget}, signature::{ schno...
mod bsdf; mod cli_options; mod directlighting; mod pathintegrator; use io::Write; use itertools::Itertools; use log::*; use std::fs::File; use std::io::{self, BufWriter}; use std::time::Instant; use crate::directlighting::*; use geometry::ray; use light::EnvLight; use material as mtl; use math::{assert_le, hcm, hcm::...
mod backup_tree; mod change_encoder; mod chunk_key; mod meta_tree; mod version_change_tree; mod version_graph_tree; mod working_tree; pub use change_encoder::*; pub use chunk_key::ChunkDbKey; pub use version_change_tree::VersionChanges; use backup_tree::{ clear_backup, commit_backup, open_backup_tree, write_chang...
// This is used to figure out which cells are visible by a character. // There are lots of ways to do this (see http://www.roguebasin.com/index.php?title=Category:FOV) // but here we are using the Precise Permissive Field of View algorithm based on the Python // code at http://www.roguebasin.com/index.php?title=Permiss...
#[cfg(target_arch = "x86")] use std::arch::x86::*; #[cfg(target_arch = "x86_64")] use std::arch::x86_64::*; #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] #[target_feature(enable = "ssse3")] unsafe fn idct8(data: &mut [__m128i; 8]) { // The fixed-point constants here are obtained by taking the fractional...
use std::io::{self, Read}; use std::collections::VecDeque; type Error = Box<dyn std::error::Error + Send + Sync>; type Result<T, E = Error> = std::result::Result<T, E>; const TRACE: bool = false; macro_rules! trace { ($($arg:tt)+) => { if TRACE { println!($($arg)+); } } } fn main() -> Result<()> { let mut...
#![windows_subsystem = "windows"] use ::image as image_crate; use clap::{App, Arg}; use image_crate::Pixel; use log::info; use nalgebra::Vector2; use piston_window::*; use splines::{Interpolation, Spline}; use std::path::PathBuf; use std::sync::mpsc; use std::sync::mpsc::{Receiver, Sender}; mod utils; use utils::*; /...
//! Utility and debugging functions. //! //! ## Stability //! //! Printing functions may be moved/renamed/removed at any time. use std::ops::Range; use std::mem; use std::ptr; use std::iter; use std::string::FromUtf8Error; use num_traits::PrimInt; use ::{OclPrm, OclScl}; //=============================================...
//! The `dealer` module contains the API for the dealer state while the dealer is //! engaging in an aggregated multiparty computation protocol. //! //! For more explanation of how the `dealer`, `party`, and `messages` modules orchestrate the protocol execution, see //! [the API for the aggregated multiparty computatio...
/// API Bindings for the MLB Boxscore API hosted at http://statsapi.mlb.com/api/v1/game/{game_pk}/boxscore.<br/> /// All data are subject to MLB Advanced Media copyright /// /// These data are important for setting the intitial defense, as well as specific metadata for the game such as weather, umpires and attendance....
//! This module contains the `PcapHeader` struct which represents a global pcap header. use std::io::Read; use byteorder::*; use errors::*; /// Struct that represents the global Pcap header of a Pcap file #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct PcapHeader { /// Magic number pub magic_number...
use crate::bucket::*; use crate::utils::{cpu_relax, make_elem}; use std::ops::Add; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::thread; use std::time::{Duration, Instant}; const POOL_SIZE: usize = 8; const EXPANSION_CAP: usize = 512; const SPIN_PERIOD: usize = 4; /// Configuration flag (@ bit ...
use std::sync::{Arc, RwLock}; use std::{ mem::MaybeUninit, sync::atomic::{AtomicBool, Ordering}, thread, }; use thread::JoinHandle; #[repr(C, align(64))] #[derive(Clone, Copy)] struct CachePad<T> { _pre: MaybeUninit<[u8; 64]>, value: T, _post: MaybeUninit<[u8; 64]>, } impl<T> CachePad<T> { ...
use std::cell::RefCell; use std::rc::Rc; use gfx::traits::FactoryExt; use gfx::Factory; use gfx_glyph::{GlyphBrush, GlyphBrushBuilder}; use glutin; use winit::{self, dpi}; use conf::{FullscreenType, WindowMode, WindowSetup}; use context::DebugId; use graphics::*; use GameResult; /// A structure that contains graphi...
use std::env::args_os; use std::error::Error; use std::io::stdin; use std::io::Read; use std::io::Write; use std::slice::Iter; use env_logger; use log::LevelFilter; use crate::client::Client; use crate::commands::clusters; use crate::commands::costs; use crate::commands::dns; use crate::commands::domains; use crate::...
use super::*; #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum GRBLState { Idle, Run, Hold(bool), Jog, Alarm, Door(u8), Check, Home, Sleep, } impl Default for GRBLState { fn default() -> Self { Self::Idle } } #[derive(Debug, Default, Copy, Clone)] pub struct G...
extern crate inflector; extern crate linked_hash_map; extern crate reproto_ast as ast; extern crate reproto_core as core; extern crate serde; extern crate serde_json; extern crate serde_yaml; mod format; mod json; mod sir; mod utils; mod yaml; pub use self::format::Format; pub use self::json::Json; pub use self::yaml...
use std::cmp; use std::f32; use std::fmt::{self, Debug}; use std::ops::{AddAssign, Div, Mul}; use lazy_static::lazy_static; use log::{debug, info, trace}; use ndarray::parallel::prelude::*; use ndarray::prelude::*; use ndarray::Zip; use num::{zero, Zero}; use crate::blockedarray::BlockedArray; use crate::{clamp, is_p...
//! Callbacks for Git hooks. //! //! Git uses "hooks" to run user-defined scripts after certain events. We //! extensively use these hooks to track user activity and e.g. decide if a //! commit should be considered obsolete. //! //! The hooks are installed by the `branchless init` command. This module //! contains the ...
use crate::prelude::*; use lazy_static::lazy_static; use rayon::prelude::*; use regex::Regex; use serde::{de, Deserialize, Deserializer}; use html5ever::tendril::TendrilSink; use html5ever::*; use markup5ever_rcdom::{Handle, NodeData, RcDom}; lazy_static! { /// a regex that matches a search match in the response ...
use { crate::{ client_error::ClientError, pubsub_client::{PubsubClient, PubsubClientError, PubsubClientSubscription}, rpc_client::RpcClient, rpc_request::MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS, rpc_response::SlotUpdate, spinner, }, bincode::serialize, log:...
#[macro_use] extern crate thiserror; #[macro_use] extern crate bitflags; #[macro_use] extern crate lazy_static; #[cfg(feature = "raw-bindings")] pub use steamworks_sys as sys; #[cfg(not(feature = "raw-bindings"))] use steamworks_sys as sys; use core::ffi::c_void; use std::collections::HashMap; use std::ffi::{CStr, CS...
// 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 ...
use { crate::{draw, geom::*}, reclutch::{ display::{Color, CommandGroup, DisplayClip, DisplayCommand, GraphicsDisplay, Rect, Size}, event::RcEventQueue, prelude::*, verbgraph, widget::Widget, }, std::{ cell::RefCell, collections::{HashMap, HashSet}...
// Copyright 2021. The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following // disclai...
//! SPDX-License-Identifier: Apache-2.0 //! Copyright (C) 2021 Arm Limited or its affiliates and Contributors. All rights reserved. //! Contains types and function for parsing `.pack.idx` files created by //! elfshaker. use crate::entrypool::{EntryPool, Handle}; use crate::repo::{ fs::{create_file, open_file}, ...
use crate::common::{navigate, shortcuts, Overlays, Warping}; use crate::game::{Transition, WizardState}; use crate::managed::WrappedComposite; use crate::render::{AgentColorScheme, MIN_ZOOM_FOR_DETAIL}; use crate::ui::UI; use abstutil::clamp; use ezgui::{ hotkey, Button, Choice, Color, Composite, DrawBoth, EventCtx...
//! Windows specific definitions use std::io::{self, Write}; use std::mem; use std::sync::atomic; use log::debug; use unicode_width::UnicodeWidthChar; use winapi::shared::minwindef::{DWORD, WORD}; use winapi::um::winnt::{CHAR, HANDLE}; use winapi::um::{consoleapi, handleapi, processenv, winbase, wincon, winuser}; use...
//! This module contains a platform specific implementation of the window shell. use std::{cell::RefCell, rc::Rc}; use stdweb::{ js, traits::*, unstable::TryInto, web::{document, event, html_element::CanvasElement, window, CanvasRenderingContext2d}, }; use lazy_static; use crate::{prelude::*, render...
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 use std::cell::RefCell; use std::collections::hash_map::Entry; use std::collections::HashMap; use std::fs; use std::io::ErrorKind; use std::io::Read; use std::io::Write;...
use intcode_computer::Computer; use std::collections::HashSet; const MAX_PATTERN_LENGTH: usize = 20; fn main() { let env = challenge_1(); challenge_2(env); } fn challenge_1() -> Environment { let mut computer = Computer::load_from_file("input"); let env = Environment::load(computer.run(vec![]).0); ...
// Copyright 2020, The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following // di...
use color_eyre::Result; use ethers::core::types::H256; use nomad_core::db::{DbError, TypedDB, DB}; use nomad_core::{ accumulator::NomadProof, utils, CommittedMessage, Decode, NomadMessage, RawCommittedMessage, SignedUpdate, SignedUpdateWithMeta, UpdateMeta, }; use tokio::time::sleep; use tracing::{debug, info};...
// Copyright 2016 Google 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 in...
use failure::Error; use serde_json::{self, Value}; pub trait FromJson { fn from_json(raw: &Value) -> Result<Self, Error> where Self: std::marker::Sized; } /** * * This manifest format is a straight conversion from JSON to Rust for manipulation purposes. * * It should only be used for input/output;...
//! This library provides both high level readers and writers for the BGZF format as well as lower level //! compressor and decompressor functions. //! //! Bgzf is a multi-gzip format that adds an extra field to the header indicating how large the //! complete block (with header and footer) is. //! //! # Examples //! /...
// Copyright 2013 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // 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 ...
// This file is Copyright its original authors, visible in version control // history. // // This file is 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. // You may...
use std::{collections::HashMap, convert::TryFrom, io::BufRead, result::Result}; use enumflags2::BitFlags; use serde::{Deserialize, Serialize}; use serde_repr::{Deserialize_repr, Serialize_repr}; use static_assertions::assert_impl_all; use zbus::{dbus_proxy, fdo}; use zvariant::{derive::Type, OwnedValue, Value}; use c...
// Copyright 2021 <NAME>. // // 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 thos...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #![allow(clippy::match_like_matches_macro)] #![allow(clippy::single_component_path_imports)] #![allow(clippy::option_map_or_none)] #![allow(clippy::ptr_arg)] #![allow(clippy::bind_instead_of_map)] #![allow(clippy::len_zero)] //! This module ru...
use std::collections::HashMap; use im::Vector; use itertools::{Either, Itertools}; use scopeguard::defer; use z3::ast::{exists_const, Ast, Bool, Dynamic, Int, Real, String as Str}; use z3::*; use crate::evaluate::shared::{Application, DataType, Entry, Env}; use crate::evaluate::stable; use crate::evaluate::stable::{E...
//! Our "interchange" format for database table schemas. //! //! To convert table schemas between different databases, we have a choice: //! //! 1. We can convert between each pair of schema formats directly, which would //! require `2*n*(n-1)` conversions for `n` databases. //! 2. We can define an "interchange" for...
use crate::SqlIntrospectionResult; use datamodel::{ common::{names::NameNormalizer, ScalarType, ScalarValue}, dml, Datamodel, Field, FieldArity, FieldType, IdInfo, IdStrategy, IndexDefinition, Model, OnDeleteStrategy, RelationInfo, WithDatabaseName, }; use log::debug; use prisma_inflector; use regex::Regex;...
//! Contract Runtime component. pub(crate) mod announcements; mod config; mod error; mod metrics; mod operations; mod types; use once_cell::sync::Lazy; use std::{ collections::BTreeMap, fmt::{self, Debug, Formatter}, path::Path, sync::{Arc, Mutex}, time::Instant, }; use datasize::DataSize; use lmd...
//! Module for parsing surface data in a bufkit file. use crate::error::*; use chrono::{NaiveDate, NaiveDateTime}; use metfor::{Celsius, HectoPascal, Kelvin, Km, Knots, MetersPSec, Mm, WindSpdDir, WindUV}; use optional::{none, some, Optioned}; use std::error::Error; /// Surface data. #[derive(Debug, PartialEq)] pub s...
// Copyright 2017 <NAME>. See the COPYRIGHT file at the top-level // directory of this distribution. // // Licensed under: // the MIT license // <LICENSE-MIT or https://opensource.org/licenses/MIT> // or the Apache License, Version 2.0 // <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, // a...
use simple_error::{SimpleResult, bail}; use serde::{Serialize, Deserialize}; use std::fmt; use crate::{Transformation, TransformerTrait}; /// When performing an XorByConstant transformation, this represents the size #[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Copy, Serialize, Deserialize)] pub enum XorSett...