text
stringlengths
7.05k
33.9k
use std::mem::MaybeUninit; use crate::sound::organya::Song as Organya; use crate::sound::stuff::*; use crate::sound::wav::*; use crate::sound::wave_bank::SoundBank; pub struct PlaybackEngine { song: Organya, lengths: [u8; 8], swaps: [usize; 8], keys: [u8; 8], track_buffers: [RenderBuffer; 136], ...
use object::Object; use std::{borrow, collections::BTreeMap, collections::HashMap, fs, marker::PhantomData, rc::Rc}; use crate::utils; // ========================================================================================= /// # Dwarf Interface /// An interface for reading DWARF debugging information. /// For ...
//! Provides functionality that allows an Amethyst game to communicate with an editor. //! //! [`SyncEditorSystem`] is the root system that will send your game's state data to an editor. //! In order to visualize your game's state in an editor, you'll also need to create a //! [`SyncComponentSystem`] or [`ReadResourceS...
//! Pressure on the hardware execution units. use crate::device::Device; use crate::ir; use crate::model::{CodePoint, Level}; use crate::search_space::{DimKind, Domain}; use itertools::Itertools; use serde::{Deserialize, Serialize}; use std::borrow::Cow; use std::rc::Rc; use std::{cmp, fmt, iter}; use utils::*; /// A ...
use arc_swap::ArcSwap; use fxhash::FxHashMap; use itertools::Itertools; use serde_json::{Map, Value as JsonValue}; use std::convert::TryInto; use std::net::{IpAddr, SocketAddr}; use std::str::FromStr; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use tokio::sync::broadcast::error::RecvError; use to...
//use std::mem::{self}; use std::any::Any; use std::mem; use std::slice; use std::sync::Arc; use core::arch::x86_64::*; use merand48::*; use std::io; use std::io::Cursor; use std::error::Error; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use std::cmp::min; use crate::model_instance; use crate::feature_...
pub mod opcodes; use std::io; use std::process; use crate::opcodes::OpCode as opc; const NUM_OF_MEMORY_CELLS: usize = 65536; const NUM_OF_REGISTERS: usize = 10; const PRINTER_ADDR: usize = NUM_OF_MEMORY_CELLS - 3; // Double width registers const REG_A: u8 = 0xA; const REG_B: u8 = 0xB; const REG_C: u8 = 0xC; const R...
// Port from Go's std time package use std::fmt::{Display, Formatter}; use std::time::Duration; const NANOSECOND: u64 = 1; const MICROSECOND: u64 = 1000 * NANOSECOND; const MILLISECOND: u64 = 1000 * MICROSECOND; const SECOND: u64 = 1000 * MILLISECOND; const MINUTE: u64 = 60 * SECOND; const HOUR: u64 = 60 * MINUTE; co...
extern crate rand; use super::camera::Camera; use base::gen::world::biome; use base::math::*; use base::world::PillarIndex; use glium::draw_parameters::{BlendingFunction, DepthTest}; use glium::{self, DrawParameters, LinearBlendingFactor, Program, VertexBuffer}; use std::f32; use std::f32::consts::PI; use std::rc::Rc;...
use std::time::Duration; use std::io::Error as IoError; use std::sync::Arc; use tracing::info; use tracing::trace; use tracing::error; use tracing::debug; use tracing::warn; use tracing::instrument; use flv_util::print_cli_err; use async_channel::Receiver; use async_channel::Sender; use async_channel::bounded; use to...
use std::convert::TryFrom; use crate::{ffi, script, CodePoint, Buffer, Tag, Script, Font}; use crate::buffer::BufferClusterLevel; use crate::map::Map; use crate::unicode::GeneralCategory; #[derive(Clone, Copy, PartialEq)] enum Consonant { NC = 0, AC, RC, DC, NotConsonant, } fn get_consonant_type(...
/// Handle clients by pretending to be a PostgreSQL server. use bytes::{Buf, BufMut, BytesMut}; use log::{debug, error, trace}; use std::collections::HashMap; use tokio::io::{AsyncReadExt, BufReader}; use tokio::net::{ tcp::{OwnedReadHalf, OwnedWriteHalf}, TcpStream, }; use crate::admin::handle_admin; use crat...
use std::collections::HashMap; use std::fmt; use std::io; use std::io::Write; use std::num::ParseFloatError; use std::rc::Rc; use serde_json; trait RispValueString { fn lisp_val(&self) -> String; } #[derive(Clone)] pub enum RispExp { Bool(bool), Symbol(String), Number(f64), Str(String), List(Vec<RispExp>)...
//! A proc-macro to derive a focus chain for Iced applications //! Take a look at the readme for more informations. #![deny(missing_docs)] #![deny(missing_debug_implementations)] #![deny(unused_results)] #![forbid(unsafe_code)] #![warn( clippy::pedantic, clippy::nursery, // Restriction lints clippy::cl...
#![no_std] // See https://github.com/JitterCompany/adxl355-rs/blob/master/src/lib.rs for an SPI example //! Manages an MCP23S17, a 16-Bit SPI I/O Expander with Serial Interface module. //! //! This operates the chip in `IOCON.BANK=0` mode, i.e. the registers are mapped sequentially. //! This driver does not set `IOC...
/* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use thi...
//! A library for doing SAML things, terribly, in rust. //! //! My main aim at the moment is to provide IdP capabilities for the [Kanidm](https://github.com/kanidm/kanidm) project. //! //! `#![deny(unsafe_code)]` is used everywhere to avoid unsafe code tricks. This is why we're using rust, after all! 🦀 //! //! //! If ...
#[derive(Debug)] pub struct CPU { pub register_a: u8, pub register_x: u8, pub register_y: u8, pub status: u8, pub program_counter: u16, memory: [u8; 0xffff], } #[derive(Debug, Clone, Copy)] pub enum AddressingMode { Immediate, ZeroPage, ZeroPageX, ZeroPageY, Absolute, A...
mod alloc; mod dropper; mod trigger; use std::cmp; use std::hash::{Hash, Hasher}; use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; use std::sync::Arc; use std::thread::spawn; use crossbeam::queue::SegQueue; use crossbeam::Sender; use dashmap::DashMap; use dynqueue::DynQueue; use once_cell::sync::Lazy; use pa...
use ast::*; use namespace::Namespace; use super::internal::*; use line_info::LineInfo; pub fn eval_program<'a>(stack: &mut Stack, program: &Program) -> Result<Option<RcValue>, ExecErr> { for stmt in program.iter() { match eval_stmt(stack, stmt)? { ExecSignal::Return(ret) => return Ok(ret), ...
use self::auth::{AuthResult, Authenticator}; use self::search::Search; use self::subs::{ collections_list, get_folder, recent, search, send_file, send_file_simple, transcodings_list, ResponseFuture, }; use self::transcode::QualityLevel; use crate::config::get_config; use crate::util::ResponseBuilderExt; use cra...
#![allow(dead_code)] /* FLASH(up to 2 MB) base address in the alias region */ pub const FLASH_BASE :u32 = 0x08000000; /* CCM(core coupled memory) data RAM(64 KB) base address in the alias region */ pub const CCMDATARAM_BASE :u32 = 0x10000000; /* SRAM1(112 KB) base address in the alias...
//! Parser for [TSPLIB](http://comopt.ifi.uni-heidelberg.de/software/TSPLIB95/) instances. //! //! # Example //! //! ``` //! use tsplib::{EdgeWeightType, NodeCoord, Type}; //! use std::io::Cursor; //! //! let data = br#" //! NAME : example //! COMMENT : this is //! COMMENT : a simple example //! TYPE : TSP //! DIMENSIO...
//! Assorted functionality relating to blocks, including: //! * The block notify system, where a block update "notifies" //! adjacent blocks of the update. This is used for spawning //! falling blocks, for example. //! //! The block notify system works as follows: when a block //! is updated, `on_block_update_notify_ad...
use super::{CpuAddressBus, CpuAddressBusBase, PpuAddressBus}; use crate::{apu, controller as ctrl, cpu, parse, ppu, serialize}; #[macro_use] use derive_serialize::Serialize; use std::cell::Cell; use std::{fs, io}; pub struct NromCpuAddressBus<'a> { base: CpuAddressBusBase<'a>, ppu_bus: NromPpuAddressBus, ...
//! [A0 EXTI0^v input with internall pullup] Switch d (pull down once in each main period if closed) //! [A1 EXTI1^v input with internall pullup] Switch c (pull down once in each main period if closed) //! [A2 EXTI2^v input with internall pullup] Switch a (pull down once in each main period if closed) //! [A3 EXTI3^v i...
/*! Code generation for prefix-types. */ use abi_stable_shared::const_utils::low_bit_mask_u64; use core_extensions::{ prelude::*, matches, }; use syn::{ punctuated::Punctuated, Ident, WherePredicate, TypeParamBound, Visibility, }; use quote::{ToTokens,quote_spanned}; use crate::*; ...
use crate::lang::errors::{CrushResult, argument_error, error, mandate}; use crate::lang::argument::{Argument, ArgumentDefinition, ArgumentType}; use crate::lang::command::{Parameter, CrushCommand, BoundCommand}; use crate::lang::scope::Scope; use std::collections::HashMap; use crate::lang::value::{Value, ValueType, Val...
use crate::{ crypt::{encrypt, maru}, definitions::*, loader, utils::*, }; use goblin::pe::utils::get_data; use goblin::pe::PE; use std::{fs, io::prelude::*, path::Path}; pub fn donut_from_file(target: String, config: &mut DonutConfig) -> Result<Vec<u8>, String> { let file = Path::new(&target); ...
use gettextrs::gettext; use gstreamer as gst; use gstreamer::prelude::*; use gstreamer::{BinExt, ClockTime, GstObjectExt, PadExt}; use glib; use glib::{Cast, ObjectExt}; use std::error::Error; use std::path::Path; use std::sync::mpsc::Sender; use std::sync::{Arc, Mutex, RwLock}; use application::CONFIG; use metada...
use crate::iter::{IntoPeekableNth, PeekableNth}; use crate::str::NonEmptyString; use enumerate::EnumerateStr; use error::ErrorKind::{ DigitFollowingNumericLiteral, IdentifierFollowingNumericLiteral, UnclosedComment, }; use std::io; use std::iter::{FilterMap, Map}; use std::str::{Chars, FromStr}; pub use error::*; ...
use super::{error::*, DevPath}; use backend::graphics::{ egl::{ error::Result as EGLResult, native::{Gbm, GbmSurfaceArguments}, wayland::{EGLDisplay, EGLWaylandExtensions}, EGLContext, EGLGraphicsBackend, EGLSurface, PixelFormat, SwapBuffersError, }, GraphicsBackend, }; use d...
use chrono::Utc; use core::ops::Range; use rand::seq::SliceRandom; use rand::Rng; use serde::{Deserialize, Serialize}; use socketcan::*; use std::error::Error; use std::fs::OpenOptions; use std::io::Write; use std::path::Path; use std::{error, fs, io}; /// SubSection used to define bits within a section definition #[d...
// // Copyright (c) Dell Inc., or its subsidiaries. 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 // use crate::tr...
use rustris_core::game::Game; use rustris_core::model::Tetromino; use rustris_core::model::{Board, CellVal, Stats, UserInput}; use std::time::{Duration, Instant}; const ONE_SECOND: Duration = Duration::from_secs(1); #[derive(Debug)] pub struct UI { screen: pancurses::Window, app_win: pancurses::Window, pa...
use std::path::PathBuf; use std::collections::HashMap; use std::io::{prelude::*, self}; use std::fs::File; use std::boxed::Box; use structopt::StructOpt; use anyhow::{Error, Result, Context}; use sha2::{Sha256, Digest}; use static_init::{dynamic}; #[macro_use] extern crate anyhow; const ALPHA: &[u8] = b"ybndrfg8ejkm...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{ backend::k8s::node::K8sNode, query_sequence_numbers, ChainInfo, FullNode, Node, Result, Swarm, Validator, Version, }; use anyhow::{bail, format_err}; use diem_logger::*; use diem_sdk::{ crypto::ed25519::Ed25519P...
// // genetic - genetic programming experiments // Copyright (c) 2019 <NAME> <<EMAIL>> // // This project is licensed under the terms of the MIT license // (see the LICENSE file for details). // // // File description: // Module: linear genetic programming utilities. // use rand::prelude::*; use vm; /// Represents ...
//! # Updates //! //! Changes derived are stored in an `Updates` struct. Not all derived information will necessarily //! be returned, as e.g. redundant variable bounds don't make the problem simpler. use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; use crate::data::linear_algebra::traits::SparseEleme...
// Allow `unreachable_pub` warnings when sync is not enabled // due to the usage of `Notify` within the `rt` feature set. // When this module is compiled with `sync` enabled we will warn on // this lint. When `rt` is enabled we use `pub(crate)` which // triggers this warning but it is safe to ignore in this case. #![cf...
use std::marker; use fixedbitset::FixedBitSet; use super::{ EdgeType, Incoming, }; use super::graph::{ Graph, IndexType, NodeIndex, }; use super::visit::GetAdjacencyMatrix; #[derive(Debug)] struct Vf2State<Ty, Ix> { /// The current mapping M(s) of nodes from G0 → G1 and G1 → G0, /// NodeI...
// 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 { failure::{format_err, Error, ResultExt}, fidl_fuchsia_test as ftest, ftest::RunListenerProxy, fuchsia_async as fasync, fuchsia_sy...
//! Query context. use std::any::{Any, TypeId}; use std::collections::{BTreeMap, HashMap}; use std::convert::TryFrom; use std::fmt::{self, Debug, Display, Formatter}; use std::ops::Deref; use std::sync::atomic::AtomicUsize; use std::sync::Arc; use fnv::FnvHashMap; use serde::de::{Deserialize, Deserializer}; use serde...
//! Provides userspace with access to the screen. //! //! Usage //! ----- //! //! You need a screen that provides the `hil::screen::Screen` trait. //! //! ```rust //! let screen = //! components::screen::ScreenComponent::new(board_kernel, tft).finalize(); //! ``` use core::cell::Cell; use core::convert::From; use...
// Copyright 2018 The Grin Developers // 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...
#![recursion_limit = "128"] use std::process; use std::path::PathBuf; use std::thread; use std::time::{Duration, Instant}; use std::collections::HashMap; use std::iter; use std::env; extern crate clap; use clap::Arg; #[macro_use] extern crate error_chain; extern crate futures; use futures::{stream, Future, Stream};...
use std::time::Duration; use std::{io, thread}; use actix_rt::{ time::{sleep, Instant}, System, }; use log::{error, info}; use mio::{Interest, Poll, Token as MioToken}; use crate::server::Server; use crate::socket::MioListener; use crate::waker_queue::{WakerInterest, WakerQueue, WAKER_TOKEN}; use crate::worke...
use crate::{ resource::{ResourceTypeId, Resources}, system::SystemId, }; use bit_set::BitSet; use legion_core::{ borrow::RefMut, command::CommandBuffer, storage::ComponentTypeId, world::{World, WorldId}, }; use std::cell::UnsafeCell; #[cfg(feature = "par-schedule")] use tracing::{span, trace, L...
#![deny(unused_mut)] #![doc(html_favicon_url = "https://wasmer.io/images/icons/favicon-32x32.png")] #![doc(html_logo_url = "https://github.com/wasmerio.png?size=200")] //! Wasmer's WASI implementation //! //! Use `generate_import_object` to create an [`ImportObject`]. This [`ImportObject`] //! can be combined with a ...
//! Common mathematical operations use libm; //// use arrayvec::ArrayVec; /// Find real roots of cubic equation. /// /// The implementation is not (yet) fully robust, but it does handle the case /// where `c3` is zero (in that case, solving the quadratic equation). /// /// See: <http://mathworld.wolfram.com/CubicForm...
use std::io::Read; // Trait providing read_to_string() use std; use url; use hyper; use serde; use serde_json; use regex; // use Groups; use Lister; use ::errors::*; pub const API_VERSION: u16 = 3; pub struct GitLab { url: url::Url, private_token: String, client: hyper::Client, } // Explicitly...
use std::pin::Pin; use std::sync::Arc; use std::time::Duration; use futures::{ task::{Context, Poll, Waker}, Future, Stream, StreamExt, }; use linked_hash_map::LinkedHashMap; use parking_lot::RwLock; use tokio_stream::wrappers::{BroadcastStream, UnboundedReceiverStream}; use block::{Block, BlockType, SignedTe...
use crate::utils; use crate::{ BareItem, Decimal, Dictionary, FromStr, InnerList, Item, List, ListEntry, Num, Parameters, SFVResult, }; use std::iter::Peekable; use std::str::{from_utf8, Chars}; /// Implements parsing logic for each structured field value type. pub trait ParseValue { /// This method should...
// SPDX-License-Identifier: Apache-2.0 // This file is part of Frontier. // // Copyright (c) 2020 Parity Technologies (UK) Ltd. // // 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...
// Copyright 2019 Authors of Red Sift // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://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 t...
use crate::{ views::{column_view, page_view, ColumnView, FieldView, PageView, RowView}, widgets::selector_box, ColumnDef, DataValue, Error, Table, }; use restq::{bytes_to_chars, table_def, CsvRows}; use sauron::{ html::{ attributes::{class, key, styles}, events::*, units::*, ...
pub mod display; pub mod exec; use super::alu::*; use crate::arm7tdmi::{Addr, InstructionDecoder, InstructionDecoderError}; use crate::bit::BitIndex; use crate::byteorder::{LittleEndian, ReadBytesExt}; use crate::num::FromPrimitive; use std::io; #[derive(Debug, PartialEq)] pub enum ArmDecodeErrorKind { UnknownI...
//! Adaptation of the V8 ftoa algorithm with a custom radix. //! //! This algorithm is adapted from the V8 codebase, //! and may be found [here](https://github.com/v8/v8). //! //! # Unsupported Features //! //! This does not support a few features from the format packed struct, //! most notably, it will never write num...
//! Clone type for recursive or duplicating data types. //! use crate::{idl::{JS_AST, JS_Schema}, schema::{NP_Schema_Addr, NP_Value_Kind}}; use crate::NP_Schema; use crate::{memory::NP_Memory, schema::{NP_Parsed_Schema}}; use alloc::vec::Vec; use crate::json_flex::{JSMAP, NP_JSON}; use crate::schema::{NP_TypeKeys}; ...
use poi::*; use levenshtein::levenshtein; use std::collections::{BinaryHeap, HashSet}; const DEFAULT_GOAL_DEPTH: u64 = 2; fn main() { println!("=== Poi Reduce 0.23 ==="); println!("Type `help` for more information."); let ref mut std = std(); let mut prev_expr: Option<Expr> = None; let mut goal: ...
use crate::config::Whitelist; use crate::rewards::caching::{PubkeyVoterApyMapping, RewardsCache}; use crate::rpc_extra::with_first_block; use anyhow::anyhow; use log::debug; use prometheus_exporter::prometheus::{GaugeVec, IntGaugeVec}; use serde::{Deserialize, Serialize}; use solana_client::rpc_client::RpcClient; use s...
use std::convert::TryInto; use super::super::{EccPoint, EccScalarFixedShort, FixedPoints, L_SCALAR_SHORT, NUM_WINDOWS_SHORT}; use crate::{ecc::chip::MagnitudeSign, utilities::bool_check}; use halo2_proofs::{ circuit::{Layouter, Region}, plonk::{ConstraintSystem, Constraints, Error, Expression, Selector}, ...
#[macro_use] extern crate diesel; extern crate dotenv; use actix_files::Files; use actix_web::{web, App, Error, HttpResponse, HttpServer, ResponseError}; use handlebars::{ Context, Handlebars, Helper, HelperResult, JsonRender, Output, RenderContext, RenderError, }; use serde::{Deserialize, Serialize}; use serde_js...
//! Various math helper functions to work with bezier curves. //! //! All of these functions use the power basis form. use crate::{ error::ERROR_MARGIN, polynomial::{solve_cubic, solve_linear, solve_quadratic, solve_quartic, Root}, utils::rotate_90_degree_clockwise, }; use geometric_algebra::{epga1d, ppga2...
// Copyright (c) 2021 Google LLC // // 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. This file may not be copied, modified, or distributed // except accordin...
//! Connect to a server as initiator and print the connection info. #[macro_use] extern crate log; mod chat_task; use std::fs::File; use std::io::Read; use std::path::Path; use std::process; use std::sync::mpsc as std_mpsc; use std::sync::{Arc, RwLock}; use std::thread; use std::time::Duration; use clap::{App, Arg,...
//! Binary packing/ unpacking implementations. //! //! Encoding types: //! * `()`: untyped //! * `C`: C type //! * `V1`: version 1 //! * `V2`: version 2 //! * `V3`: version 3 //! //! To maintain flexibility we do not implement additional `V*` traits where the underlying binary //! encoding has not changed. We delegate ...
/*! # VCard A pure Rust implementation of vCard based on RFC 6350. ## Example ```rust,ignore extern crate vcard; use std::collections::HashSet; use vcard::{Set, VCard, XPropertyName, IanaToken}; use vcard::properties::*; use vcard::values::text::{Text, Component}; use vcard::values::language_tag::LanguageTag; use ...
use clap::{App, Arg, SubCommand}; use std::collections::HashMap; use std::io::Write; use wows_replays::{parse_scripts, ErrorKind, ReplayFile}; mod built_info { // The file has been placed there by the build script. include!(concat!(env!("OUT_DIR"), "/built.rs")); } struct InvestigativePrinter { filter_pa...
use { std::{ fmt, fs::{ self, File }, io::{ self }, os::{ unix::{ io::{ AsRawFd } } }, iter::{ FusedIterator }, ...
use prost::Message; use std::collections::BTreeMap; use crate::netcode::sequence_buffer::SequenceBuffer; use crate::proto::messages::game_message_payload::Payload; use crate::proto::messages::{ClientAckRequestMessage, GameMessage, GameMessagePayload}; // NOTE(tec27): This is higher than the IPv4 spec, but in practice...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 0x04], #[doc = "0x04 - Channel Configuration Register"] pub ccfg: crate::Reg<ccfg::CCFG_SPEC>, _reserved1: [u8; 0x04], #[doc = "0x0c - Kernel State Configuration Register"] pub kscfg: crate::Reg<kscfg::KSCFG_SPEC>,...
#![allow(clippy::useless_vec)] use std::collections::HashMap; use std::ffi::OsStr; use std::fs; use std::ops::{Add, AddAssign}; use std::path::{Path, PathBuf}; use std::sync::mpsc::{sync_channel, Receiver, SyncSender}; use lazy_static::lazy_static; use crate::executor::ThreadPoolExecutor; use crate::Result; pub stru...
#[cfg(not(windows))] extern crate cc; extern crate http_req; #[cfg(target_env = "msvc")] extern crate libc; #[cfg(not(target_env = "msvc"))] extern crate libflate; extern crate pkg_config; extern crate sha2; #[cfg(not(target_env = "msvc"))] extern crate tar; #[cfg(target_env = "msvc")] extern crate vcpkg; #[cfg(target_...
#![cfg_attr(not(feature = "std"), no_std)] pub use pallet::*; ///Kazu:Importing needed types from the NFT pallet type ClassData<T> = <T as orml_nft::Config>::ClassData; type TokenData<T> = <T as orml_nft::Config>::TokenData; type TokenId<T> = <T as orml_nft::Config>::TokenId; type ClassId<T> = <T as orml_nft::Config>:...
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). extern crate tempdir; use bazel_protos; use boxfuture::{Boxable, BoxFuture}; use bytes::Bytes; use futures::Future; use futures::future::join_all; use hashing::{Digest, Fingerprint}; us...
// This file is part of Substrate. // Copyright (C) 2019-2020 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // 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 // // ht...
use anyhow::format_err; use futures::prelude::*; use rand::{seq::IteratorRandom, thread_rng}; use shiplift::{builder::ExecContainerOptions, PullOptions}; use subprocess::{Exec, ExitStatus, Redirection}; use std::env; use std::io::{BufRead, BufReader}; use std::sync::{Arc, Mutex}; use std::time::Duration; use crate::d...
use std::io; use std::fmt; use std::collections::HashMap; fn main() { test_rig(); } enum Test { Hash, Array, VectorEnum, Stats, PigLatin, Korero, Unknown, Stop } fn accept_string(p_prompt: String) -> String { // Keeping the IO away from the code let mut which_test_in ...
use rand::Rng; use std::fs; pub struct Chip8 { registers: [u8; 16], memory: Vec<u8>, stack: Vec<u16>, i: u16, pub dt: u8, pub st: u8, pc: u16, display: [[u8; 64]; 32], keys_pressed: [bool; 16], } impl Chip8 { pub fn new() -> Chip8 { let mut x = Chip8 { regis...
mod ctx; mod search_table; use ctx::CgCtx; use super::simplify::Trans; use super::{State, StateIdx, DFA}; use crate::ast::{RuleKind, RuleRhs}; use crate::range_map::RangeMap; use std::convert::TryFrom; use fxhash::FxHashMap; use proc_macro2::{Span, TokenStream}; use quote::{quote, ToTokens}; // Max. size for guar...
use super::{rom::Rom}; pub struct Ppu { pub ppu_ram: [u8; 0x4000], // TODO: 今は容量適当 pub ppu_oam: [u8; 0x100], pub ppu_reg: [u8; 8], pub ppu_addr_count: u8, //TODO: 直せたら直す pub ppu_addr: u16, pub ppu_scroll_count: u8, //TODO: 直せたら直す pub scroll_x: u8, pub scroll_y: u8, pub attribute_tab...
use crate::core::prelude::*; use crate::widgets::prelude::*; use std::time::Duration; #[derive(Copy, Clone, PartialEq, Debug, LogicState)] enum AD7193State { Init, Ready, GettingCmd, ReadCmd, WaitSlaveIdle, WriteCmd, DoWrite, SingleConversion, SingleConversionCommit, } #[derive(Log...
//# serde = { version = "1.0", features = ["derive"] } //# serde_json = "1.0" //# walkdir = "*" #![feature(drain_filter)] #![feature(slice_internals)] #![allow(non_snake_case)] extern crate core; extern crate serde; extern crate serde_json; extern crate walkdir; use std::collections::HashMap; use std::env; use std::f...
extern crate reqwest; extern crate serde; #[cfg(test)] use mockito; use reqwest::blocking::{Client as NetworkClient, RequestBuilder, Response}; use reqwest::header::CONNECTION; use reqwest::{Method, StatusCode}; use serde::Serialize; use std::fmt; use std::io::Read; use std::str; use crate::error::MMCError; use cra...
// This file is part of Substrate. // Copyright (C) 2019-2020 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // 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 // // ht...
use std::ops::{Add, Mul}; use im::Vector; use itertools::Itertools; use serde::{Deserialize, Serialize}; use crate::evaluate::shared::{DataType, Entry, Env, Schema, VL}; use crate::evaluate::syntax::UExpr; use crate::evaluate::{shared, syntax}; use crate::solver::Payload; #[derive(Serialize, Deserialize)] pub struct...
//! This module implements some validity checks for attributes. //! In particular it verifies that `#[inline]` and `#[repr]` attributes are //! attached to items that actually support them and if there are //! conflicts between multiple such attributes attached to the same //! item. use crate::hir::map::Map; use crate...
// Copyright 2017 Databricks, 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 writi...
// Copyright 2015-2020 Parity Technologies (UK) Ltd. // This file is part of Open Ethereum. // Open 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 your o...
// Copyright 2016 <NAME> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writi...
//! Running test scripts use crate::core::{analyse::testplan::TestPlan, target::Target}; use crate::driver::error::EucalyptError; use crate::driver::eval; use crate::driver::options::EucalyptOptions; use crate::driver::prepare; use crate::driver::source::SourceLoader; use crate::syntax::input::{Input, Locator}; use std...
//! This module consists of all structures describing Execution Context. pub mod plain; pub mod synchronized; use crate::prelude::*; use crate::model::module::QualifiedName as ModuleQualifiedName; use crate::notification::Publisher; use engine_protocol::language_server; use engine_protocol::language_server::Express...
//! Functions to go back and forth between WASI types in host and wasm32 representations. //! //! This module is an adaptation of the `wasmtime-wasi` module //! [`translate.rs`](https://github.com/CraneStation/wasmtime-wasi/blob/1a6ecf3a0378d71f3fc1ba25ce76a2b43e4166b8/lib/wasi/src/translate.rs); //! its license file `...
// 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 that can be // found in the THIRD-PARTY file. use std::{ fmt::{...
//! Install tools and build the `esp-idf` using native tooling. use std::convert::TryFrom; use std::env; use std::ffi::OsString; use std::path::{Path, PathBuf}; use std::str::FromStr; use anyhow::*; use embuild::cmake::file_api::codemodel::Language; use embuild::cmake::file_api::ObjKind; use embuild::espidf::InstallO...
mod presets; use std::{ fs, path::PathBuf, convert::TryFrom, io::{self, Read}, time::Instant, process::Command, }; use structopt::StructOpt; use bugsalot::debugger; use rustc_hash::FxHashSet; use log::LevelFilter; use seedgen::{self, lexer, inventory, world, headers, util}; use inventory::I...
#![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] #![allow(non_snake_case)] use std::{ cmp::Ordering, convert::TryFrom, fmt::{Display, Formatter, Result}, ops::{Add, Sub}, result, }; include!(concat!( env!("OUT_DIR"), "/gdb_register_bindings_generated.rs" )); /// The inner...
/*! Model structures common across all shape types. The concept of a _shape_ in Smithy is abstract, the ABNF contains productions `shape_statements` and `shape_body` but they are not concrete. Shapes are then classified as _simple_, _aggregate_, and _service_. The model here introduces `Shape` as a common concrete str...
//! This module implements simple request and response objects. use std::fmt; use std::collections::HashMap; use std::net::SocketAddr; use std::io; use std::fs::File; use std::io::{Read, Write}; use std::convert; use hyper; use hyper::server::request::Request as HttpRequest; use hyper::uri::RequestUri::{AbsolutePath,...