text
stringlengths
3.35k
22.8k
use { crate::{ error::MetaplexError, state::{CommonWinningIndexChecks, CommonWinningIndexReturn, WinningConfigType, PREFIX}, utils::{ assert_derivation, common_redeem_checks, common_redeem_finish, get_amount_from_token_account, transfer_safety_deposit_box_items, ...
//! Octree implementation to store voxel maps use std::collections::HashMap; use dotrix_math::Vec3i; const LEFT_TOP_BACK: usize = 0; const RIGHT_TOP_BACK: usize = 1; const RIGHT_TOP_FRONT: usize = 2; const LEFT_TOP_FRONT: usize = 3; const LEFT_BOTTOM_BACK: usize = 4; const RIGHT_BOTTOM_BACK: usize = 5; const RIGHT_BO...
use std::fmt; use serde::{Deserialize, Serialize}; use geom::{Angle, PolyLine}; use crate::raw::RestrictionType; use crate::{ DirectedRoadID, Direction, Intersection, IntersectionID, LaneID, Map, MovementID, PathConstraints, }; /// Turns are uniquely identified by their (src, dst) lanes and their parent int...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 //! This file defines event store APIs that are related to the event accumulator and events //! themselves. #![allow(unused)] use super::LibraDB; use crate::{ change_set::ChangeSet, errors::LibraDbError, ledger_counters::L...
// SPDX-License-Identifier: Apache-2.0 OR MIT // // Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // See GitHub history for details. use std::fs::File; use std::io::prelude::*; use std::io::BufReader; use std::path::Path; use tracing::*; use crate::common::{Config, KaniFailStep, Mo...
//! AEAD packet I/O facilities //! //! AEAD protocol is defined in <https://shadowsocks.org/en/spec/AEAD.html>. //! //! ```plain //! TCP request (before encryption) //! +------+---------------------+------------------+ //! | ATYP | Destination Address | Destination Port | //! +------+---------------------+-------------...
use std::convert::TryFrom; use std::io::Read; use std::path; #[rustfmt::skip] use ::image; use crate::context::{Context, DebugId}; use crate::error::GameError; use crate::error::GameResult; use crate::filesystem; use crate::graphics; use crate::graphics::shader::*; use crate::graphics::*; /// Generic in-GPU-memory i...
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
use crate::{AlphaMode, PbrPipeline, StandardMaterialFlags}; use bevy_app::{App, Plugin}; use bevy_asset::{AddAsset, Handle}; use bevy_ecs::system::{lifetimeless::SRes, SystemParamItem}; use bevy_math::Vec4; use bevy_reflect::TypeUuid; use bevy_render2::{ color::Color, render_asset::{PrepareAssetError, RenderAss...
/// Unique participant identifier #[derive( Clone, Default, Debug, Eq, Ord, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize, )] pub struct ParticipantId(pub String); /// A participant type enumeration. #[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize)] #[serde...
// Copyright 2015-2020 Parity Technologies (UK) Ltd. // This file is part of Parity Ethereum. // Parity Ethereum 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 yo...
use super::dialog_helpers; use super::server_database_add_edit_dlg; use super::server_database_add_edit_dlg::Msg as MsgServerDatabaseAddEditDialog; use super::server_database_add_edit_dlg::ServerDatabaseAddEditDialog; use super::server_extra_user_add_edit_dlg; use super::server_extra_user_add_edit_dlg::Msg as MsgServer...
#![feature(test)] extern crate test; use std::{ env, io::{self, Write}, path::Path, sync::{Arc, RwLock}, }; use swc_common::FileName; use swc_ecma_ast::*; use swc_ecma_codegen::{self, Emitter}; use swc_ecma_parser::{lexer::Lexer, EsConfig, Parser, StringInput, Syntax, TsConfig}; use swc_ecma_transforms...
use miniquad::*; use glam::{vec3, Mat4}; struct Stage { display_pipeline: Pipeline, display_bind: Bindings, offscreen_pipeline: Pipeline, offscreen_bind: Bindings, offscreen_pass: RenderPass, rx: f32, ry: f32, } impl Stage { pub fn new(ctx: &mut Context) -> Stage { let color_i...
// Copyright (c) Aptos // SPDX-License-Identifier: Apache-2.0 use crate::*; use rand::{Rng, SeedableRng}; use std::{ io::{self, Write}, num::NonZeroUsize, process, }; use structopt::{clap::arg_enum, StructOpt}; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; use tokio::runtime::...
// This file is part of the uutils coreutils package. // // (c) <NAME> <<EMAIL>> // (c) kwantam <<EMAIL>> // * 2015-04-28 ~ updated to work with both UTF-8 and non-UTF-8 encodings // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. // sp...
use chrono::prelude::*; use std::error::Error; use std::{ io::Write, path::Path, time::{Instant, SystemTime}, }; use distance::damerau_levenshtein; use divvunspell::archive::{SpellerArchive, ZipSpellerArchive}; use divvunspell::speller::suggestion::Suggestion; use divvunspell::speller::{CaseHandlingConfig,...
//! This module implements the global `Symbol` object. //! //! The data type symbol is a primitive data type. //! The `Symbol()` function returns a value of type symbol, has static properties that expose //! several members of built-in objects, has static methods that expose the global symbol registry, //! and resemble...
//! Error types use std::num::{ParseFloatError, ParseIntError}; use std::sync::mpsc::{RecvError, RecvTimeoutError, TryRecvError}; use std::{error, fmt, io}; const ALREADY_CONNECTED: (i32, &str) = (501, "Already connected."); const CONNECT_FAIL: (i32, &str) = (502, "Couldn't connect to TWS. Confirm that \"Enable Active...
mod config; mod error; mod models; mod schema; pub use crate::error::Error; use crate::models::{CanGetHash, Hash, ScoreSnapForUpdate, User, UserStatus, UserStatusForInsert}; use anyhow::anyhow; use anyhow::Result; use chrono::{NaiveDateTime, Utc}; use diesel::prelude::*; use diesel::r2d2::{ConnectionManager, PooledCon...
use algebra::fft::EvaluationDomain; use algebra::{Field, PairingEngine}; use crate::gm17::{generator::KeypairAssembly, prover::ProvingAssignment}; use r1cs_core::{Index, SynthesisError}; use rayon::prelude::*; use std::ops::{AddAssign, SubAssign}; pub(crate) struct R1CStoSAP; impl R1CStoSAP { #[inline] pub(...
// Copyright (c) Microsoft. All rights reserved. use std::time::{Duration, Instant}; use failure::Fail; use futures::future::{self, Either, FutureResult}; use futures::Future; use log::Level; use tokio::prelude::*; use tokio::timer::Interval; use edgelet_utils::log_failure; use error::{Error, ErrorKind}; use identi...
use crate::frame::response::event::{Event, StatusChangeEvent}; /// Cluster manages up to date information and connections to database nodes use crate::routing::Token; use crate::transport::connection::{Connection, ConnectionConfig, VerifiedKeyspaceName}; use crate::transport::errors::QueryError; use crate::transport::n...
use crate::tcp_connection::TcpConnection; use std::collections::{HashMap, VecDeque}; use tokio::net::{TcpStream, ToSocketAddrs}; use tokio::sync::RwLock; /// The [`ClientManager`] structure is responsible for managing all TCP client connections that are /// established during the application lifetime. A connection poo...
// -*- 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>> //! Various constants, such as the Ristretto and Ed25519 basepoints. //! //! Most of the constants are given...
use google_drive3::Scope::Full; use google_drive3::{About, DriveHub, File, Permission}; use hyper::client::Response; use hyper::Client; use std::fs; use std::path::Path; use yup_oauth2::{Authenticator, DefaultAuthenticatorDelegate, DiskTokenStorage, FlowType}; pub struct GDriveService { drive_hub: DriveHub...
use {Error, Result}; use self::formats::{ROperands, IOperands, SOperands, BOperands, UOperands, JOperands}; pub mod formats; #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Reg(u8); macro_rules! reg_names { ($( $name:ident => $n:expr, )*) => { $( pub fn $name() ...
// Copyright 2019-2020 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...
use std::iter::Peekable; use std::vec::IntoIter; /// Chomp aribitrary numbers of bits from a Vec<u8> as if it was a u8*len /// /// # Examples /// ``` /// # extern crate bardecoder; /// use bardecoder::util::Chomp; /// use bardecoder::util::qr::QRError; /// /// let mut chomp = Chomp::new(vec![0b11101011, 0b01101101, 0b...
// 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 those terms. // // --- // // The ...
use nix::sys::uio::*; use nix::unistd::*; use rand::{thread_rng, Rng}; use rand::distributions::Alphanumeric; use std::{cmp, iter}; use std::fs::{OpenOptions}; use std::os::unix::io::AsRawFd; #[cfg(not(target_os = "redox"))] use tempfile::tempfile; use tempfile::tempdir; #[test] fn test_writev() { let mut to_writ...
use rustc::ty::{Ty, layout::TyLayout}; use rustc::mir; use crate::*; pub trait EvalContextExt<'tcx> { fn ptr_op( &self, bin_op: mir::BinOp, left: Scalar<Borrow>, left_layout: TyLayout<'tcx>, right: Scalar<Borrow>, right_layout: TyLayout<'tcx>, ) -> EvalResult<'t...
//! structural search replace use crate::source_change::SourceFileEdit; use ra_ide_db::RootDatabase; use ra_syntax::ast::make::expr_from_text; use ra_syntax::ast::{AstToken, Comment}; use ra_syntax::{AstNode, SyntaxElement, SyntaxNode}; use ra_text_edit::{TextEdit, TextEditBuilder}; use rustc_hash::FxHashMap; use std...
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 use anyhow::{bail, Result}; use mio::event::Event; use mio::net::TcpListener; use mio::net::TcpStream; use mio::{Events, Interest, Poll, Token}; use mio_signals::{Signal...
use ckb_core::block::{Block, BlockBuilder}; use ckb_core::extras::EpochExt; use ckb_core::header::Header; use ckb_core::header::HeaderBuilder; use ckb_core::{capacity_bytes, BlockNumber, Capacity, Cycle, Version}; use ckb_pow::{Pow, PowEngine}; use numext_fixed_hash::H256; use numext_fixed_uint::U256; use std::cmp; use...
use std::io; use std::cmp; /* A big thanks for DirtGrubDylan for helping me with this project to learn more about rust and what I can do with it! Link to his github -> https://github.com/DirtGrubDylan/tic_tac_toe/blob/master/src/game.rs Thank you DirtGrubDylan, looking at your code helped me a lot, and I a...
use crate::cli::cloud_json::JSONCloudClusterHealthResponse; use crate::cli::util::cluster_identifiers_from; use crate::client::{CloudRequest, ManagementRequest}; use crate::state::{ClusterTimeouts, RemoteCloudOrganization, RemoteCluster, State}; use log::warn; use nu_engine::CommandArgs; use nu_errors::ShellError; use ...
use std::cmp::{max, min}; use std::fs::File; use std::io::{BufRead, BufReader}; type Point = (i32, i32); type Interval = (i32, i32); // x1/x2 and y1/y2 go in the direction of the wire. enum LineSegment { Vertical { x: i32, y1: i32, y2: i32 }, Horizontal { x1: i32, x2: i32, y: i32 }, } fn point_in_interval(i:...
use crate::Reflect; use bevy_utils::{HashMap, HashSet}; use downcast_rs::{impl_downcast, Downcast}; use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; use serde::Deserialize; use std::{any::TypeId, fmt::Debug, sync::Arc}; #[derive(Default)] pub struct TypeRegistry { registrations: HashMap<TypeId, TypeRe...
//! Types for reading _Service Information_ from a DVB MPEG Transport Stream, formatted according //! to [ETSI standard EN 300 486](http://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf). #![forbid(unsafe_code)] #![deny(rust_2018_idioms, future_incompatible)] pub mod sdt; use mpe...
use crate::{BbsFfiError, ByteArray}; use bbs::prelude::*; use ffi_support::*; use serde::{ de::{Error as DError, Visitor}, Deserialize, Deserializer, Serialize, Serializer, }; use std::{ collections::BTreeSet, convert::TryFrom, }; lazy_static! { pub static ref VERIFY_PROOF_CONTEXT: ConcurrentHandle...
// Copyright 2019-2021 Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common 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, ...
// 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 i...
// Copyright (c) 2018 <NAME> // Copyright (c) 2020 Ant Group // // SPDX-License-Identifier: Apache-2.0 or MIT // //! This module contains the implementation of the `cpu` cgroup subsystem. //! //! See the Kernel's documentation for more information about this subsystem, found at: //! [Documentation/scheduler/sched-des...
//tag::board[] /// structure for a bingo board with ``data`` containing numbers, ``marked`` containing /// flags which numbers have been drawn, ``draws_count`` holding the count af draws /// (including draws that did not match), ``last`` holding the last number drawn, and /// ``bingo`` is a flag indicating whether the ...
#![allow(dead_code)] use std::cell::Cell; /* Using `Cell<T>` to handle interior mutability of next =========================================================================== So we get our Reference Linked Lists and tweak them so we can actually write. Just working by references does not work even with a controller c...
use kernel::utilities::registers::interfaces::{ReadWriteable, Readable, Writeable}; use kernel::utilities::registers::{register_bitfields, register_structs, FieldValue, ReadWrite}; use kernel::utilities::StaticRef; register_structs! { ResetsRegisters { /// Reset control. If a bit is set it means the periph...
//! # Minimal gif encoder use std::cmp::min; use std::io; use std::io::prelude::*; use lzw; use traits::{Parameter, WriteBytesExt}; use common::{Block, Frame, Extension, DisposalMethod}; /// Number of repetitions pub enum Repeat { /// Finite number of repetitions Finite(u16), /// Infinite number of r...
// Copyright (c) 2019-2020, The rav1e contributors. All rights reserved // // This source code is subject to the terms of the BSD 2 Clause License and // the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License // was not distributed with this source code in the LICENSE file, you can // obtain it at ...
extern crate flat_tree; extern crate merkle_tree_stream; extern crate quickcheck; use merkle_tree_stream::{ DefaultNode, HashMethods, MerkleTreeStream, Node, PartialNode, }; extern crate hex; extern crate rust_sodium; use hex::FromHex; use quickcheck::quickcheck; use rust_sodium::crypto::hash::sha256; use std::colle...
use actix_ratelimit::{RateLimiter, MemoryStore, MemoryStoreActor}; use actix_web::{App, FromRequest, HttpRequest, HttpResponse, HttpServer, Result, web::Bytes, web::{self}}; use rust_tls::internal::pemfile::{certs, rsa_private_keys}; use rust_tls::{NoClientAuth, ServerConfig}; use json; use log::{info, warn}; use std:...
// TODO - remove once schemars stops causing warning. #![allow(clippy::field_reassign_with_default)] use std::str::FromStr; use datasize::DataSize; #[cfg(test)] use rand::Rng; use serde::{Deserialize, Serialize}; use tracing::error; use casper_types::{ bytesrepr::{self, FromBytes, ToBytes}, EraId, ProtocolVe...
use crate::colors::{BitDepth, ColorType}; use crate::headers::IhdrData; use crate::png::PngImage; use indexmap::map::{ Entry::{Occupied, Vacant}, IndexMap, }; use rgb::RGBA8; use std::borrow::Cow; pub mod alpha; use crate::alpha::reduced_alpha_channel; pub mod bit_depth; use crate::bit_depth::reduce_bit_depth_...
use clippy_utils::diagnostics::span_lint_and_then; use clippy_utils::path_to_local; use clippy_utils::source::snippet_opt; use clippy_utils::visitors::{expr_visitor, is_local_used}; use rustc_errors::Applicability; use rustc_hir::intravisit::Visitor; use rustc_hir::{Block, Expr, ExprKind, HirId, Local, LocalSource, Mat...
/* Adapted from ncspot's queue implementation found at https://github.com/hrkfdn/ncspot/blob/HEAD/src/queue.rs BSD 2-Clause License Copyright (c) 2019, <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are...
use crate::hal::hal as embedded_hal; use crate::hal::rcc::Clocks; use crate::hal::time::Hertz; use crate::playlist::{Playlist, PLAYLIST_NAME_LEN}; use crate::Spi1Type; use embedded_sdmmc as sdmmc; use log::error; const LOGGING_FILE: &str = "cards.txt"; const END_LINE: &str = "\r\n"; const LOG_LINE_LEN: usize = END_LIN...
use crate::tikv_batch::fsm::{Fsm, FsmScheduler, FsmState}; use std::sync::{Mutex, Arc}; use std::collections::HashMap; use crate::tikv_batch::mailbox::{BasicMailbox, Mailbox}; use std::sync::atomic::{AtomicUsize, AtomicBool, Ordering}; use std::cell::Cell; use crate::tikv_batch::util::lru::LruCache; use crate::tikv_bat...
use super::Encoder; use crate::flowgger::config::Config; use crate::flowgger::record::{Record, SDValue, FACILITY_MISSING, SEVERITY_MISSING}; use crate::record_capnp; use capnp; use capnp::message::{Allocator, Builder}; #[derive(Clone)] pub struct CapnpEncoder { extra: Vec<(String, String)>, } impl CapnpEncoder { ...
use std::time::{Duration, Instant}; /// Limits the amount of time spent on a certain type of work in a cycle /// /// The limiter works dynamically: For a sampled subset of cycles it measures /// the time that is approximately required for fulfilling 1 work item, and /// calculates the amount of allowed work items per ...
use std::alloc; use std::alloc::Layout; use crate::logic::*; use crate::parse::{Lvalue, Rvalue, Register, Instruction}; pub const STACK_SIZE: usize = 0x10000; #[derive(Debug, Clone, Copy)] pub struct Allocvars { pub size: usize } #[derive(Debug, Clone, Copy)] pub struct Var { pub bp_offset: usize, pub size: u8 }...
extern crate bit_set; extern crate lzma_rs; extern crate byteorder; fn or_archive_error<R>(result: Result<R, io::Error>) -> Result<R, ArchiveError> { result.map_err(|e| ArchiveError::new(&e.to_string())) } #[derive(Debug, Clone)] pub struct ArchiveError { pub message: String } impl ArchiveError { fn new(m...
//! Handles the encoding and decoding of pubsub messages. use crate::config::GOSSIP_MAX_SIZE; use crate::types::{GossipEncoding, GossipKind, GossipTopic}; use crate::TopicHash; use snap::raw::{decompress_len, Decoder, Encoder}; use ssz::{Decode, Encode}; use std::boxed::Box; use types::SubnetId; use types::{ Attes...
#[macro_use] extern crate clap; extern crate crossbeam; extern crate num_cpus; extern crate rayon; use clap::{App, Arg}; use rand::{thread_rng, Rng}; use rayon::prelude::*; use std::time::{Duration, Instant}; const MULT_CHUNK: usize = 1 * 1024; const LINEAR_CHUNK: usize = 64 * 1024; macro_rules! RM { ($row:expr,...
/* * Copyright (c) 2016-2018 Boucher, Antoni <<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, mod...
use egui::text::LayoutJob; use hv_gui::egui; /// Memoized Code highlighting pub fn highlight(ctx: &egui::Context, theme: &CodeTheme, code: &str, language: &str) -> LayoutJob { impl egui::util::cache::ComputerMut<(&CodeTheme, &str, &str), LayoutJob> for Highlighter { fn compute(&mut self, (theme, code, lang...
// 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 ...
//! Context for XS subroutine calls. use crate::{AV, SV}; use crate::convert::{FromSV, IntoSV, TryFromSV}; use crate::raw; use std; use std::ffi::CStr; /// XS call context. pub struct Context { perl: raw::Interpreter, stack: raw::Stack, } const EMPTY: &'static [i8] = &[0]; impl Context { /// Invoke clos...
//! Provides examples of using multiple middleware pipelines for different routes. //! //! We'll create an app with a few different routes that need //! different combinations of middleware. //! //! By default, we'll expect users to be logged in, using a session middleware //! to track client cookies. //! On the homepa...
use std::{env, fs, path, thread}; use aya_log::BpfLogger; use clap::Parser; use thiserror::Error; use tokio::{ runtime::Runtime, sync::{mpsc, oneshot}, }; use tracing::{debug, error, Level}; use tracing_log::LogTracer; use tracing_subscriber::FmtSubscriber; mod communication; mod load; mod maps; mod runc; mod...
extern crate build; extern crate config; extern crate failure; extern crate plugin; extern crate simple_logger; #[macro_use] extern crate log; #[macro_use] extern crate serde_derive; mod opt; use std::path::PathBuf; use std::env; use std::fs; pub const PLUGIN_DIR_NAME: &'static str = "plugins"; pub const DEFAULT_BU...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 6712usize], #[doc = "0x1a38 - AES hardware key select"] pub host_cryptokey_sel: HOST_CRYPTOKEY_SEL, _reserved1: [u8; 16usize], #[doc = "0x1a4c - This write-once register is the K_PRTL lock register. When this register ...
use crate::collapse::Collapse; use crate::icon::{Icon, IconName}; use crate::Intent; use id_tree::*; use std::cell::{Ref, RefCell, RefMut}; use std::collections::hash_map::DefaultHasher; use std::collections::HashMap; use std::hash::{Hash, Hasher}; use std::rc::Rc; use yew::prelude::*; #[derive(Clone)] pub struct Tree...
// of course this method is too slow // pub fn reverse_pairs(nums: Vec<i32>) -> i32 { // if nums.len() < 2 { // return 0; // } // let nums: Vec<i64> = nums.iter().map(|&s| s as i64).collect(); // let mut count = 0; // for i in 0..nums.len() { // for j in 0..i { // if nu...
use byteorder::LittleEndian; use core::convert::TryFrom; use core::convert::TryInto; use elf_utils::Elf32; use elf_utils::reloc::RelData; use elf_utils::reloc::Rels; use elf_utils::reloc::x86::X86Reloc; use elf_utils::reloc::x86::X86RelocError; const X86_RELS_SIZE: usize = 208; const X86_RELS: [u8; X86_RELS_SIZE] = [...
use iced::{ pick_list, button, scrollable, Element, Row, PickList, Scrollable, Button, Text, Align, Length, Container, }; use crate::gui::{CustomSelect, CustomButton}; use std::fmt::{Display, Formatter, Result}; #[derive(Debug, Clone)] pub struct DefaultAppPage { scroll: scrollable::State, audio_player: (&'s...
extern crate core; mod etcd; mod pools; mod printer; mod resources; mod volumes; use crate::{ etcd::{Etcd, EtcdSampler}, pools::PoolMgr, printer::{PrettyPrinter, Printer, TabledData}, resources::{ResourceDelete, ResourceMgr, ResourceSamples, ResourceUpdates, Sampler}, volumes::VolMgr, }; use anyho...
//! A platform agnostic driver to interface with LPS22HB pressure sensor module. //! //! This driver allows you to: //! - read atmospheric pressure in hPa, see [`read_pressure()`] //! - read temperature in degrees Celsius, see [`read_temperature()`] //! - enable single-shot data acquisition, see [`enable_one_shot()`] /...
use thoth_api::model::publication::Publication; use thoth_api::model::publication::PublicationProperties; use thoth_api::model::work::WorkType; use uuid::Uuid; use yew::html; use yew::prelude::*; use yew::ComponentLink; use yew_router::agent::RouteAgentDispatcher; use yew_router::agent::RouteRequest; use yew_router::ro...
use std::os::raw::c_uint; use thiserror::Error; #[derive(Error, Debug, Eq, PartialEq)] pub enum JsError { /// Category of errors that relates to incorrect usage of the API itself. #[error("Category of errors that relates to incorrect usage of the API itself.")] CategoryUsage, /// An argument to a host...
//! Schema compilation. //! The main idea is to compile the input JSON Schema to a validators tree that will contain //! everything needed to perform such validation in runtime. pub(crate) mod context; pub(crate) mod options; use crate::{ error::ErrorIterator, keywords, paths::{InstancePath, JSONPointer}, ...
use qiniu_http::{ header::{CONTENT_LENGTH, USER_AGENT}, HeaderName, HeaderValue, HttpCaller, RequestParts, ResponseError, ResponseErrorKind, StatusCode, SyncRequest, SyncResponse, SyncResponseBody, SyncResponseResult, TransferProgressInfo, Version, }; use std::{ error::Error, fmt, io::{Error as ...
//! Functionality relating to the JSON string type use std::alloc::{alloc, dealloc, Layout, LayoutError}; use std::borrow::Borrow; use std::cmp::Ordering; use std::fmt::{self, Debug, Formatter}; use std::hash::Hash; use std::ops::Deref; use std::ptr::{copy_nonoverlapping, NonNull}; use std::sync::atomic::{AtomicUsize,...
use crate::editor::{Action, Breakpoint}; use crate::{align_view, Align, Editor}; use helix_core::Selection; use helix_dap::{self as dap, Client, Payload, Request, ThreadId}; use helix_lsp::block_on; use log::warn; use std::path::PathBuf; #[macro_export] macro_rules! debugger { ($editor:expr) => {{ match &m...
/* ----------------------------------------------------------------------------- MithrilEngine Framework (MEF) Copyright (c) 2021-2022, daigennki (@daigennki) ----------------------------------------------------------------------------- */ mod render; pub mod component; use winit::event::{ Event, WindowEvent }; use...
//! Contains m680x-specific types pub use arch::arch_builder::m680x::*; use arch::DetailsArchInsn; use capstone_sys::{ cs_m680x, cs_m680x_op, m680x_op_ext, m680x_op_idx, m680x_op_rel, m680x_op_type, }; use instruction::{RegId, RegIdInt}; use std::convert::From; use std::{fmt, slice}; // XXX todo(tmfink): create r...
use num_bigint::{BigInt, BigUint}; use std::num::FromPrimitive; use std::num::{Zero, One}; use num_traits::identities::Zero; use num_traits::cast::FromPrimitive; use num_traits::identities::One; use std::env; const NUM_TESTS: usize = 24; const TRIAL_DIVISORS: [u32; 167] = [ 3, 5, 7, 11, 13, 17,...
use super::super::{Grid, D, P}; use super::*; use rand::Rng; #[derive(Clone, Copy, PartialEq, Eq)] pub enum ClueConstraint { Any, Forced, Prohibited, } pub struct GeneratorOption { pub clue_constraint: Grid<ClueConstraint>, pub max_clue: Option<i32>, pub symmetry: bool, pub use_trial_and_...
//! This module is the ideal interface we would have for the conductor (or other store that kitsune uses). //! We should update the conductor to match this interface. use std::ops::ControlFlow; use std::{collections::HashSet, sync::Arc}; use crate::event::{ PutAgentInfoSignedEvt, QueryAgentsEvt, QueryOpHashesEvt,...
//! Ported to Rust from <https://www.shadertoy.com/view/Ms2SD1> //! //! Original comment: //! ```glsl //! /* //! * "Seascape" by <NAME> aka TDM - 2014 //! * License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. //! * Contact: <EMAIL> //! */ //! ``` use shared::*; use spirv_std::glam::{ ...
//! Configuration to create a Consumer or Producer. use log::LogLevel; use rdsys::types::*; use rdsys; use client::Context; use error::{KafkaError, KafkaResult, IsError}; use util::bytes_cstr_to_owned; use std::collections::HashMap; use std::ffi::CString; use std::mem; const ERR_LEN: usize = 256; /// The log level...
use std::os::raw::c_float; use skia_safe::{ BlurStyle, font_style::{Slant, Weight, Width}, FontMetrics, FontMgr, FontStyle, FontStyleSet, MaskFilter, Paint, Point, Size, typeface::Typeface, }; use skia_safe::paint::Style; use crate::common::context::Device; use crate::common::context::text_styles::text_al...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 #![forbid(unsafe_code)] use std::{ collections::{hash_map, HashMap, HashSet}, convert::TryFrom, marker::PhantomData, sync::Arc, }; use anyhow::{bail, ensure, format_err, Result}; use components::speculation_cache::Spec...
//! MPEG-2 TS related constituent elements. use byteorder::{BigEndian, WriteBytesExt}; use mpeg2ts; use mpeg2ts::es::{StreamId, StreamType}; use mpeg2ts::pes::{PesPacketReader, ReadPesPacket}; use mpeg2ts::time::Timestamp; use mpeg2ts::ts::{Pid, ReadTsPacket, TsPacket, TsPayload}; use std::cmp; use std::collections::Ha...
use crate::{ cache::MeshType, gpu_state::{DrawIndexedIndirect, GpuState}, }; use std::{collections::HashMap, ops::Range}; use std::mem; #[repr(C)] #[derive(Copy, Clone)] pub(crate) struct MeshGenerateUniforms { pub(super) slot: u32, pub(super) storage_base_entry: u32, pub(super) mesh_base_entry: u3...
use crate::types::*; use arrayvec::ArrayVec; use auto_impl::auto_impl; use bytes::{BufMut, Bytes, BytesMut}; use core::borrow::Borrow; fn zeroless_view(v: &impl AsRef<[u8]>) -> &[u8] { let v = v.as_ref(); &v[v.iter().take_while(|&&b| b == 0).count()..] } impl Header { pub fn encode(&self, out: &mut dyn Bu...
use holding_solar::PlanetId; use serde::{Deserialize, Serialize}; use uuid::Uuid; #[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq)] pub struct CharacterId(pub Uuid); impl Default for CharacterId { fn default() -> Self { Self(Uuid::new_v4()) } } #[derive(PartialEq, Clone, Copy, Debug, S...
use std::{collections::VecDeque, sync::Arc}; use vm::heap::{Address, DeepCopy, Heap, HeapError, Immediate, OfActivation, OfCons, OfEnvironment, Type, Unpacked as UnpackedWord, Value, Word}; #[derive(Debug, Fail)] pub enum ExecError { #[fail(display = "machine halted by instruction")] Halt, ...
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { anyhow::Error, bt_a2dp::{codec::MediaCodecConfig, media_task::*}, bt_avdtp::MediaStream, fidl_fuchsia_media::{AudioChannelId, AudioPc...
use bindgen::{Builder, RustTarget}; use std::{ env, io::{Read, Write}, path::{Path, PathBuf}, process::Stdio, }; fn main() { env_logger::init(); let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap(); let cross_to_windows = target_os == "windows" && !cfg!(target_os = "windows"); let ...
use async_trait::async_trait; use futures::future::join_all; use rand::{distributions::Alphanumeric, rngs, Rng, SeedableRng}; use std::{collections::HashMap, str::FromStr, sync::Arc, time::Duration}; use tokio::sync::{mpsc, Mutex}; use aws_lock_client::{AwsLockClient, AwsLockClientDynamoDb}; use rusoto_core::Region...