text stringlengths 7.05k 33.9k |
|---|
//! The [glyf (Glyph Data)](https://docs.microsoft.com/en-us/typography/opentype/spec/glyf) table
use font_types::{BigEndian, FontRead, Offset32, OffsetHost, Tag};
/// 'glyf'
pub const TAG: Tag = Tag::new(b"glyf");
font_types::tables! {
/// The [glyf (Glyph Data)](https://docs.microsoft.com/en-us/typography/open... |
//! Data strutures for storing the rules of sudoku
use std::fmt;
use std::error;
use std::iter;
use std::ops;
use std::slice;
use grid::CellId;
/// Clique index.
///
/// This is used to address a particular clique.
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CliqueId(pub usize);
/... |
use crate::core::types::{GameCfg, HedgehogInfo, ServerVar, TeamInfo, VoteType};
use std::{convert::From, iter::once, ops};
#[derive(PartialEq, Eq, Clone, Debug)]
pub enum HwProtocolMessage {
// common messages
Ping,
Pong,
Quit(Option<String>),
Global(String),
Watch(u32),
ToggleServerRegiste... |
use super::Header;
use fnv::FnvHasher;
use http::header;
use http::method::Method;
use std::collections::VecDeque;
use std::hash::{Hash, Hasher};
use std::{cmp, mem, usize};
/// HPACK encoder table
#[derive(Debug)]
pub struct Table {
mask: usize,
indices: Vec<Option<Pos>>,
slots: VecDeque<Slot>,
inse... |
use comrak::{markdown_to_html, ComrakOptions};
use regex::Regex;
use std::collections::HashMap;
use std::lazy::SyncLazy;
use syntect::{
easy::HighlightLines,
highlighting::ThemeSet,
html::{append_highlighted_html_for_styled_line, IncludeBackground},
parsing::SyntaxSet,
util::LinesWithEndings,
};
... |
/*
* 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 ... |
// Copyright 2020 ETH Zurich and University of Bologna.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//! Utilities
/// Convenient SI-prefixed unit formatting.
pub trait SiUnit {
fn si_unit<'a>(&'a self, unit: &'a str) -> SiUnitDisplay<'a, Self>... |
use plotters::prelude::*;
use rand_distr::{Distribution, Exp, Normal, Uniform};
use std::f32::consts::PI;
use crate::base::*;
// Robot
#[derive(Clone)]
pub struct Robot<'a, AT: AgentTrait, OS: OpticalSensor, C: Color> {
pub pose: (f32, f32, f32),
pub color: &'a C,
pub agent: AT,
pub sensor: OS,
pu... |
// Symphonia
// Copyright (c) 2019 The Project Symphonia Developers.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! The `codec` module provides the traits a... |
//! Drives the state machine for a single task.
use std::collections::{HashMap, HashSet};
use std::fs::OpenOptions;
use std::io::{BufRead, BufReader};
use std::os::unix::process::CommandExt;
use std::process::Stdio;
use std::sync::{Arc, Mutex};
use chrono::offset::Utc;
use expjobserver::{cmd_replace_machine, cmd_rep... |
use cpu;
use mem;
const SCREEN_WIDTH: u8 = 160;
const SCREEN_HEIGHT: u8 = 144;
const TILE_SIZE: u16 = 16;
const LY_CYCLES: u16 = 456;
pub type FrameBuffer = [[[u8; 3]; SCREEN_WIDTH as usize]; SCREEN_HEIGHT as usize];
#[derive(Copy, Clone)]
enum TileMapSelect {
A9800 = 0x9800,
A9c00 = 0x9c00,
}
#[derive(Copy... |
use core::convert::TryInto;
use core::ptr;
use core::slice;
use core::time;
extern crate alloc;
use alloc::{borrow::Cow, sync::Arc};
use embedded_svc::{mqtt::client, service};
use esp_idf_hal::mutex::{Condvar, Mutex};
use esp_idf_sys::*;
use crate::private::{common::Newtype, cstr::*};
#[derive(Copy, Clone, Debug,... |
// Copyright © 2019 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
use acpi_tables::{
rsdp::RSDP,
sdt::{GenericAddress, SDT},
};
use vm_memory::{GuestAddress, GuestMemoryMmap};
use vm_memory::{Address, ByteValued, Bytes};
#[repr(packed)]
struct LocalAPIC {
pub r#type: u8,
pub length: u... |
//! RPC response support.
use http;
use hyper;
use prost;
use futures::prelude::*;
use super::frame;
use futures::{future, stream, task};
use super::future::*;
use super::metadata::*;
use super::status::*;
use futures::task::Task;
use hyper::body::Payload;
use parking_lot::Mutex;
use std::io::Cursor;
use std::sync:... |
use crate::constants;
use crate::metric;
use crate::metric::Metadata;
use crate::source::nonblocking::{write_all, BufferedPayload, PayloadErr};
use crate::source::{TCPStreamHandler, TCP};
use crate::util;
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use mio;
use serde_avro;
use std::io::{Cursor, Read};
use ... |
use crate::feature_writer::{prop_type, FeatureWriter};
use crate::header_generated::{ColumnType, Crs, CrsArgs, GeometryType};
use crate::packed_r_tree::{calc_extent, hilbert_sort, NodeItem, PackedRTree};
use crate::{Column, ColumnArgs, Header, HeaderArgs, MAGIC_BYTES};
use flatbuffers::FlatBufferBuilder;
use geozero::e... |
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use num::Zero;
use crate::Decimal;
use postgres::{to_sql_checked, types::*};
#[cfg(not(feature = "const_fn"))]
use lazy_static::lazy_static;
use std::{error, fmt, io::Cursor, result::*};
use crate::decimal::{div_by_u32, is_all_zero, mul_by_u32};
#[cfg(feat... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - DCH0CON register"]
pub cont: crate::Reg<cont::CONT_SPEC>,
#[doc = "0x04 - DCH0CONCLR register"]
pub contclr: crate::Reg<contclr::CONTCLR_SPEC>,
#[doc = "0x08 - DCH0CONSET register"]
pub contset: crate::Reg<contset::... |
#[macro_use]
extern crate abomonation;
extern crate timely;
extern crate arrayvec;
extern crate regex;
extern crate wpinq;
use std::rc::Rc;
use std::cell::RefCell;
use std::io::BufRead;
use regex::Regex;
use timely::dataflow::ProbeHandle;
use wpinq::DatasetHandle;
use types::*;
fn main() {
timely::execute_fro... |
use std::f64::INFINITY;
use std::ops::Div;
use std::panic::resume_unwind;
use crate::mesh::{Mesh, MeshBuilder, MeshFace, MeshFaceIter};
use crate::scalar::FloatRange;
use crate::threed::{Basis3, Frame3, Pt3, Ray3, Vec3};
pub trait Shape {
fn raycast(&self, ray: &Ray3) -> Option<RaycastHit>;
fn signed_distance... |
#![cfg_attr(not(feature = "std"), no_std)]
/// Edit this file to define custom logic or remove it if it is not needed.
/// Learn more about FRAME and the core library of Substrate FRAME pallets:
/// <https://substrate.dev/docs/en/knowledgebase/runtime/frame>
pub use pallet::*;
use sp_std::convert::TryInto;
use sp_run... |
use crate::{
announcer::Announcer,
federator::{self, Context, Id},
message::{CoreAnn, FederatedPub, MeshMembAnn, Message, PubId, RoutedPub},
};
use lru::LruCache;
use paho_mqtt as mqtt;
use std::{cmp::Ordering::*, collections::HashMap, sync::Arc, time::Duration};
use tokio::{
select,
sync::{
... |
mod bet;
mod config;
mod oracle;
mod setup;
mod wallet;
pub use bet::*;
pub use config::*;
pub use oracle::*;
pub use setup::*;
pub use wallet::*;
use crate::{
config::GunSigner,
database::{ProtocolKind, StringDescriptor},
elog,
keychain::ProtocolSecret,
signers::{PsbtDirSigner, PwSeedSigner, XKeyS... |
// Copyright 2021-2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
//! The Executable and Linkable Format (ELF) is a format of executable files commonly used in UNIX
//! systems. This module implements a parser allowing to handle this format, including the kernel
//! image itself.
pub mod parser;
pub mod relocation;
use core::cmp::max;
use core::cmp::min;
use core::ffi::c_void;
use ... |
//! Driver for the [AnyLeaf ph module](https://anyleaf.org/ph-module).
//! Allows you to measure pH using high-level code. See the
//! [Github repository](https://github.com/anyleaf/ph-rust) for
//! complete examples on the Rasperry Pi and stm32f3.
//!
//! Example for Rasperry Pi, and other ph_linux systems:
//! Cargo.... |
// Copyright 2021 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use arch::{self, LinuxArch};
use base::TubeError;
use devices::virtio;
use devices::virtio::vhost::user::vmm::Error as VhostUserVmmError;
use std::erro... |
//! `kurobako report` command.
use self::rankings::{Borda, Firsts};
use crate::markdown as md;
use crate::markdown::MarkdownWriter;
use crate::record::{ProblemRecord, SolverRecord, StudyRecord};
use kurobako_core::num::OrderedFloat;
use kurobako_core::{Error, ErrorKind, Result};
use rustats::fundamental::{average, stdd... |
extern crate human_size;
use std::mem;
use human_size::*;
/// Assert that type `T` has the `expected` size.
fn assert_size<T>(expected: usize) {
assert_eq!(mem::size_of::<T>(), expected);
}
#[test]
fn assertions() {
const F64_SIZE: usize = mem::size_of::<f64>();
assert_size::<Byte>(0);
assert_size:... |
use core::sync::atomic::{AtomicBool, Ordering};
use cortex_m::singleton;
use stm32f1::stm32f103;
use stm32f1xx_hal::gpio::{
gpioa::{PA0, PA1, PA2, PA3, PA4, PA5},
gpiob::{PB10, PB11, PB12, PB13, PB14, PB15, PB3, PB4, PB5, PB6, PB7, PB8, PB9},
Input, Output, PullDown, PushPull,
};
use stm32f1xx_hal::prelude:... |
#![feature(assoc_char_funcs, let_chains)]
extern crate log;
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum PointType {
Undefined,
Move,
Curve,
QCurve,
QClose,
Line,
OffCurve,
} // Undefined used by new(), shouldn't appear in Point<T> structs
#[derive(Debug, Copy, Clone)]
pub enum Anchor... |
use crate::cartprod;
use crate::move_table::MoveTable;
use crate::small::SmallBattleSnake;
use crate::small::SmallMove;
use crate::small::Status;
use serde::Deserialize;
use std::num::ParseIntError;
use std::ops;
use std::str::FromStr;
use std::time::Instant;
use std::u128;
use tinyvec::ArrayVec;
pub const TABLE_SIZE:... |
#![cfg_attr(not(feature = "SGX_MODE_HW"), allow(unused))]
use bit_vec::BitVec;
use chrono::Utc as TzUtc;
use chrono::{Duration, TimeZone};
#[cfg(feature = "SGX_MODE_HW")]
use log::*;
use num_bigint::BigUint;
use sgx_tcrypto::SgxEccHandle;
use sgx_types::{
sgx_ec256_private_t, sgx_ec256_public_t, sgx_platform_info... |
use anyhow::{anyhow, Context, Result};
use glyph_brush_layout::{
ab_glyph::{Font, FontRef, PxScale},
FontId, GlyphPositioner, Layout, LineBreaker, SectionGeometry, SectionGlyph, SectionText,
};
use image::{GenericImageView, ImageBuffer, Rgba};
use serde_derive::Deserialize;
use std::borrow::Cow;
use std::conver... |
use crate::cfsock;
use super::config::NtpServerConfig;
use crate::cookie::{eat_cookie, get_keyid, make_cookie, NTSKeys, COOKIE_SIZE};
use crate::metrics;
use crate::key_rotator::{periodic_rotate, KeyRotator};
use lazy_static::lazy_static;
use prometheus::{opts, register_counter, register_int_counter, IntCounter};
use ... |
use super::{EdgeEndBuilder, IntersectionMatrix};
use crate::algorithm::coordinate_position::CoordinatePosition;
use crate::algorithm::dimensions::{Dimensions, HasDimensions};
use crate::algorithm::relate::geomgraph::{
index::SegmentIntersector,
node_map::{NodeFactory, NodeMap},
CoordNode, CoordPos, Edge, Ed... |
pub use self::os_impl::*;
use crate::core::types::pid_t;
/*
* Operating-system specific code for getting
* a) the address of the current thread, and
* b) the address of the Ruby version of a PID
*
* from a running Ruby process. Involves a lot of reading memory maps and symbols.
*/
#[derive(Fail, Debug)]
pub enu... |
// surfman/surfman/src/platform/macos/cgl/context.rs
//
//! Wrapper for Core OpenGL contexts.
use crate::context::{CREATE_CONTEXT_MUTEX, ContextID};
use crate::gl_utils;
use crate::surface::Framebuffer;
use crate::{ContextAttributeFlags, ContextAttributes, Error, GLVersion, Gl, SurfaceInfo};
use super::device::Device;... |
use crate::native_types::{Arithmetic, Witness};
use indexmap::IndexMap;
use noir_field::FieldElement;
use super::general_optimiser::GeneralOpt;
// Optimiser struct with all of the related optimisations to the arithmetic gate
// Is this more of a Reducer than an optimiser?
// Should we give it all of the gates?
// Hav... |
use nom::{
branch::*, bytes::complete::*, character::complete::*, combinator::*, multi::*, sequence::*, *,
};
#[derive(Debug)]
enum Exposing<'a> {
All,
Many(Vec<&'a str>),
}
/// Returns potential tests in the module.
/// Warning: does not support effect modules and definition of operators.
pub fn potentia... |
use crate::{Error, Signal};
use std::{mem, ptr};
// std::cmp::max is not const :(
const fn get_stack_size() -> usize {
if libc::SIGSTKSZ > 16 * 1024 {
libc::SIGSTKSZ
} else {
16 * 1024
}
}
/// The size of the alternate stack that is mapped for every thread.
///
/// This has a minimum size ... |
//! PikeVM regex execution engine
use crate::api::Match;
use crate::bytesearch::charset_contains;
use crate::cursor;
use crate::cursor::{Backward, Direction, Forward};
use crate::exec;
use crate::indexing::{AsciiInput, ElementType, InputIndexer, Utf8Input};
use crate::insn::{CompiledRegex, Insn, LoopFields};
use crate... |
use bitcoin::blockdata::transaction::Transaction;
use bitcoin::consensus::encode::deserialize;
use bitcoin::hash_types::{BlockHash, TxMerkleNode, Txid};
use bitcoin::hashes::sha256d::Hash as Sha256dHash;
use bitcoin_hashes::hex::ToHex;
use bitcoin_hashes::Hash;
use crypto::digest::Digest;
use crypto::sha2::Sha256;
use ... |
// 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 ... |
// Copyright © 2016-2017 winapi-rs developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files in the project carrying such notice may not be copied,... |
use super::utils::{Update, *};
use crate::bot::command::*;
use crate::database::Gallery;
use crate::utils::get_message_url;
use crate::*;
use anyhow::{Context, Result};
use chrono::{Duration, Utc};
use futures::{FutureExt, TryFutureExt};
use std::convert::TryInto;
use std::future::Future;
use teloxide::types::*;
use te... |
// 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 epoll;
use libc::... |
//! Virtual registers.
//!
//! A virtual register is a set of related SSA values whose live ranges don't interfere. If all the
//! values in a virtual register are assigned to the same location, fewer copies will result in the
//! output.
//!
//! A virtual register is typically built by merging together SSA values that... |
// 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 crate::{
container::ComponentIdentity,
logs::{
budget::BudgetHandle,
buffer::{ArcList, LazyItem},
error::StreamError,
... |
//! Virtio network device driver.
use alloc::rc::Rc;
use alloc::vec::Vec;
use core::cell::RefCell;
use core::mem;
use kernel::errno::Result;
use kernel::device::{ConfigOption, Device, DeviceOps, CONFIG_ETHERNET_MAC_ADDRESS, CONFIG_IO_QUEUE};
use kernel::event::{Event, EventListener, EventNotifier};
use kernel::ioport:... |
#[macro_use]
extern crate structopt;
extern crate regex;
extern crate nix_install_matrix_tools;
use nix_install_matrix_tools::filetree::FileTree;
use nix_install_matrix_tools::resulttree::TestEnvironments;
use nix_install_matrix_tools::resulttree::read_file_string;
use nix_install_matrix_tools::resulttree::parse_resul... |
use std::fmt::Debug;
use std::time::Duration;
use async_trait::async_trait;
use proctor::error::PlanError;
use proctor::graph::Outlet;
use proctor::phases::plan::Planning;
use crate::phases::decision::DecisionResult;
use crate::phases::plan::forecast::{ForecastCalculator, WorkloadForecastBuilder};
use crate::phases::... |
use crate::hal::timer::{CountDown, Periodic};
use crate::BorrowUnchecked;
use core::marker::PhantomData;
use cortex_m::{interrupt, peripheral::DWT};
use fugit::{
HertzU32 as Hertz, RateExtU32, TimerDurationU32 as TimerDuration, TimerRateU32 as TimerRate,
};
use void::Void;
use crate::pac::TC0;
#[cfg(any(feature = ... |
#[macro_use]
extern crate glium;
use font_kit::font::Font;
use glium::{glutin, Surface};
use lyon_path::math::{Angle, Point, Vector};
use lyon_path::Segment;
use msdfgen::{compute_msdf, recolor_contours, Contour, PathCollector};
const SDF_DIMENSION: usize = 24;
fn get_font() -> Font {
use font_kit::family_name::... |
use crate::{printer::YankStatus, Theme};
use pico_args::Arguments;
use std::path::{Path, PathBuf};
#[allow(missing_docs)]
#[derive(Debug)]
pub enum Error {
PkgIdIsLocal,
FlagRequiresRemote {
provided_short: String,
provided_long: String,
},
NameRequired,
Exclusive {
bad: ... |
use std::io::{BufReader, Read};
use std::fs::File;
use std::path::Path;
use std::rc::Rc;
use {Character, EngineContext};
use shader::{FragmentShaderType, VertexShaderType};
use camera::Camera;
use freetype as ft;
use genmesh;
use glium::{BlendingFunction, DepthTest, Display, DrawParameters, LinearBlendingFactor,
... |
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(clippy::upper_case_acronyms)]
use enum_primitive_derive::Primitive;
/// Values for
/// [`MINIDUMP_EXCEPTION::exception_code`](crate::format::MINIDUMP_EXCEPTION::exception_code)
/// for crashes on macOS.
///
/// Based on Darwin/macOS'... |
// Copyright (c) The Dijets Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! Data flow analysis computing borrow information for preparation of memory_instrumentation.
use crate::{
dataflow_analysis::{DataflowAnalysis, TransferFunctions},
dataflow_domains::{AbstractDomain, JoinResult, MapDomain, S... |
//! Provides functions for authentication and authorization.
use crate::{
error::Error,
storage::{self, Storage},
};
use anyhow::anyhow;
use argon2::password_hash::{PasswordHash, PasswordHasher, PasswordVerifier, SaltString};
use argon2::Argon2;
use chacha20poly1305::aead::{AeadInPlace, NewAead};
use chacha20p... |
use super::{
config::Config,
error::Error,
pipe::{self, ConditionNotify, ConditionWait},
ContainerEvent, Event, EventTx, ExitStatus, NotificationTx, Pid, ENV_NAME, ENV_VERSION,
};
use crate::{
common::{container::Container, non_null_string::NonNullString},
npk::manifest::{Manifest, RLimitResourc... |
use crate::block_utils::RefBlockChoice;
use crate::cli_utils::setup_ctrlc_handler;
use crate::data_block_buffer::{
BlockArrangement, DataBlockBuffer, InputType, OutputType, Slot, SlotView,
};
use crate::file_reader::{FileReader, FileReaderParam};
use crate::file_utils;
use crate::file_writer::{FileWriter, FileWrite... |
use inkwell::{
builder::Builder,
context::Context,
module::Module,
types::{BasicType, BasicTypeEnum},
values::{BasicValue, BasicValueEnum, FunctionValue, PointerValue},
FloatPredicate, IntPredicate,
};
use crate::{
environment::Environment,
error::Error,
interner::Interner,
pars... |
use std::io::Write;
use std::process::Command;
use cfg_if::cfg_if;
use futures::io::{AsyncReadExt, AsyncWriteExt};
use futures::{FutureExt, StreamExt};
use futures_tokio_compat::Compat;
use tls_async::{Identity, TlsAcceptor, TlsConnector};
use tokio::net::{TcpListener, TcpStream};
macro_rules! t {
($e:expr) => {
... |
//! <p align="center">
//! <a href="https://github.com/nvzqz/aloxide">
//! <img width="800" src="https://github.com/nvzqz/aloxide/raw/assets/aloxide_banner.svg?sanitize=true" alt="aloxide banner">
//! </a>
//! </a>
//! <a href="https://travis-ci.com/nvzqz/aloxide">
//! <img src="https://travis-ci.com/nv... |
//! `libwmctl` implements the [Extended Window Manager Hints (EWMH) specification](https://specifications.freedesktop.org/wm-spec/latest/)
//! as a way to integrate with EWMH compatible window managers. The EWHM spec builds on the lower
//! level Inter Client Communication Conventions Manual (ICCCM) to define interacti... |
use std::sync::Arc;
use anyhow::anyhow;
use futures::future::TryFutureExt;
use futures::stream::{FuturesUnordered, StreamExt};
use tokio::sync::oneshot;
use tokio::time::{timeout, Duration};
use crate::core::{LeaderState, State};
use crate::error::{ClientReadError, ClientWriteError, RaftError, RaftResult};
use crate:... |
// Copyright 2016-2020 mime-multipart Developers
//
// 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 ... |
use core::convert::TryFrom;
use crate::{aat, ot, fallback, normalize, Direction, Face, Feature, GlyphBuffer, UnicodeBuffer};
use crate::buffer::{
glyph_flag, Buffer, BufferClusterLevel, BufferFlags, BufferScratchFlags, GlyphInfo,
GlyphPropsFlags,
};
use crate::complex::ZeroWidthMarksMode;
use crate::plan::Shap... |
use rand::Rng;
use std::f32::consts::PI;
use std::sync::Arc;
use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer};
use vulkano::command_buffer::{AutoCommandBuffer, AutoCommandBufferBuilder};
use vulkano::descriptor::descriptor_set::{
PersistentDescriptorSet, PersistentDescriptorSetBuf, PersistentDescriptorSetImg... |
#[path="utils.rs"]
mod utils;
use utils::{b64str, b64int, partition, extract_section_ref, has_others};
use std::collections::HashMap;
use pyo3::prelude::*;
use std::path::{ Path};
pub type LevGnx = u32;
pub trait LevGnxOps {
/// returns level of this object
fn level(&self) -> u8;
/// returns ignx of this object
... |
//! A pass over Cranelift IR which implements the Blade algorithm
use crate::entity::{EntityRef, SecondaryMap};
use crate::flowgraph::ControlFlowGraph;
use crate::ir::{Function, Inst, InstructionData, Opcode, Value, ValueDef};
use rs_graph::linkedlistgraph::{Edge, LinkedListGraph, Node};
use rs_graph::maxflow::pushrel... |
// Copyright (C) 2017 <NAME>
extern crate syntex_syntax as syntax;
use std::ops::AddAssign;
use std::rc::Rc;
use syntax::codemap::{CodeMap, FilePathMapping};
use syntax::errors::Handler;
use syntax::errors::emitter::ColorConfig;
use syntax::parse::{self, ParseSess};
use syntax::ast::{Crate, FunctionRetTy, Ident, Ite... |
//! Displays a [`TabBar`](TabBar) to select the content to be displayed.
//!
//! You have to manage the logic to show the contend by yourself or you may want
//! to use the [`Tabs`](super::tabs::Tabs) widget instead.
//!
//! *This API requires the following crate features to be activated: `tab_bar`*
use iced_native::{
... |
extern crate glfw;
extern crate cglinalg;
extern crate cgperspective;
extern crate image;
extern crate log;
extern crate file_logger;
extern crate wavefront_obj;
mod gl {
include!(concat!(env!("OUT_DIR"), "/gl_bindings.rs"));
}
mod backend;
mod camera;
mod light;
mod model;
use cglinalg::{
Angle,
Degre... |
use crate::parser::{ParsedSyntax, ParserProgress};
use crate::state::{EnterFunction, EnterParameters, SignatureFlags};
use crate::syntax::binding::{parse_binding, parse_binding_pattern};
use crate::syntax::class::parse_initializer_clause;
use crate::syntax::expr::{parse_assignment_expression_or_higher, ExpressionContex... |
//! See the [`Parser`] type.
use std::collections::HashMap;
use std::convert::Infallible;
use std::fmt;
use std::io::{self, Read};
use std::str::{self, FromStr};
use std::time::{Duration, SystemTime};
use log::Level;
/// Create a new [`Parser`].
pub fn parse<R>(reader: R) -> Parser<R>
where
R: Read,
{
Parser... |
extern crate image;
use image::{Pixel, Rgb};
pub struct XTermColor(u8, u8, u8, u8);
impl XTermColor {
pub fn to_rgb(&self) -> Rgb<u8> {
Rgb::from_channels(self.0, self.1, self.2, 255)
}
pub fn id(&self) -> u8 {
self.3
}
}
pub const XTERM_COLORS: [XTermColor; 256] = [
XTermColor(... |
//! Internal-only runtime module used for the `wasm_bindgen_test` crate.
//!
//! No API contained in this module will respect semver, these should all be
//! considered private APIs.
// # Architecture of `wasm_bindgen_test`
//
// This module can seem a bit funky, but it's intended to be the runtime support
// of the `... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::chained_bft::{
epoch_manager::EpochManager,
network::{BlockRetrievalResponse, ConsensusNetworkImpl, NetworkReceivers},
test_utils::{self, consensus_runtime, placeholder_ledger_info},
};
use channel;
use consensus... |
//! Anchor ⚓ is a framework for Solana's Sealevel runtime providing several
//! convenient developer tools.
//!
//! - Rust eDSL for writing safe, secure, and high level Solana programs
//! - [IDL](https://en.wikipedia.org/wiki/Interface_description_language) specification
//! - TypeScript package for generating clients... |
use sanskrit_common::errors::*;
use sanskrit_common::encoding::ParserAllocator;
use model::{Transaction, ParamRef, RetType, ParamMode, SectionType};
use sanskrit_common::model::{Hash, Ptr, SlicePtr};
use sanskrit_common::arena::*;
use sanskrit_interpreter::model::{TransactionDescriptor, TxTReturn, RuntimeType, TxTPara... |
// Copyright 2020 The Evcxr Authors.
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
//! Shape records
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use std::fmt;
use std::io::{Read, Write};
pub mod bbox;
pub(crate) mod io;
pub mod macros;
pub mod multipatch;
pub mod multipoint;
pub mod point;
pub mod polygon;
pub mod polyline;
pub mod traits;
use super::{Error, ShapeType};
pub use record:... |
//! Naive box selector, collects inputs until target balance is reached
use std::cmp::min;
use std::collections::HashMap;
use std::convert::TryInto;
use ergotree_ir::chain::ergo_box::box_value::BoxValue;
use ergotree_ir::chain::ergo_box::BoxTokens;
use ergotree_ir::chain::token::Token;
use ergotree_ir::chain::token::... |
use std::{
collections::HashMap,
time::Duration,
fmt,
};
use amethyst_assets::Handle;
use amethyst_core::{
ecs::{
ParallelRunnable,
System,
SystemBuilder,
},
shrev::ReaderId,
EventChannel,
Time,
};
use amethyst_input::{
ScrollDirection,
VirtualKeyCode,
};... |
//! Hubcaps provides a set of building blocks for interacting with the Github API
//!
//! # Examples
//!
//! Typical use will require instantiation of a Github client. Which requires
//! a user agent string and set of `hubcaps::Credentials`.
//!
//! ```no_run
//! extern crate hubcaps;
//! extern crate hyper;
//!
//! u... |
extern crate piston;
extern crate graphics;
extern crate glutin_window;
extern crate opengl_graphics;
extern crate sprite;
extern crate find_folder;
mod cat;
mod hud;
use piston::window::WindowSettings;
use piston::event_loop::*;
use piston::input::*;
use glutin_window::GlutinWindow as Window;
use opengl_graphics::{ ... |
use inflector::Inflector;
use super::{generate_field_name, mutate_type_name};
use crate::botocore::{Member, Operation, Shape, ShapeType};
use crate::Service;
pub fn generate_deserializer(name: &str, ty: &str, shape: &Shape, service: &Service<'_>) -> String {
format!(
"struct {name}Deserializer;
... |
use crate::imports::Imports;
use crate::instance::{Instance, InstanceHandle, ResourceLimiter, RuntimeMemoryCreator};
use crate::memory::{DefaultMemoryCreator, Memory};
use crate::table::Table;
use crate::traphandlers::Trap;
use crate::vmcontext::{
VMBuiltinFunctionsArray, VMCallerCheckedAnyfunc, VMContext, VMFuncti... |
//! This module defines different [Solver]s related to strategies, in
//! particular the partial [StrategicSolver] and the perfect
//! [StrategicBacktrackingSolver]. All of them are re-exported in
//! [crate::solver::strategy], so you should not have to `use` anything from
//! this module directly.
use crate::Sudoku;
... |
// SPDX-License-Identifier: MIT
// Copyright (C) 2018-present iced project and contributors
mod block;
mod enums;
mod instr;
#[cfg(test)]
mod tests;
use crate::block_enc::block::*;
pub use crate::block_enc::enums::*;
use crate::block_enc::instr::*;
use crate::iced_constants::IcedConstants;
use crate::iced_error::Iced... |
use actix_web::{
web, App, HttpRequest, HttpServer, HttpResponse,
get, post, Scope, dev::{ServiceRequest, ServiceResponse},
error::Error as ActixError, FromRequest
};
use serde::Deserialize;
use http::StatusCode;
use actix_files::Files;
use listenfd::ListenFd;
use futures::stream::{self, StreamExt};
use fut... |
use super::lir_unary::{ConcreteMatMulGeometry, LirMatMulUnary, MatMulGeometry, ProtoFusedSpec};
use super::*;
use crate::internal::*;
use tract_ndarray::prelude::*;
/// The pseudo Unary matrix multiplier. A is constant, B is the input
#[derive(Debug, Clone, new, Hash)]
pub struct MatMulUnary {
pub a: Arc<Tensor>,
... |
// 2.5. The Poly1305 Algorithm
// https://tools.ietf.org/html/rfc8439#section-2.5
//
// Poly1305 is a one-time authenticator designed by <NAME>.
// Poly1305 takes a 32-byte one-time key and a message and produces a
// 16-byte tag. This tag is used to authenticate the message.
//
// The Poly1305-AES message... |
// 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 {
crate::constants::{EVENT_TIMEOUT, SOCKET},
crate::discovery::{TargetFinder, TargetFinderConfig},
crate::events::{self, DaemonEvent, Event... |
use super::{ResourceScheme, ResourceType};
use crate::{
archive,
error::AkaibuError,
util::{image::bitmap_to_png_with_padding, mt::Mt19937},
};
use anyhow::Context;
use image::{buffer::ConvertBuffer, ImageBuffer};
use once_cell::sync::Lazy;
use scroll::{Pread, BE, LE};
use std::{collections::HashMap, fs::Fi... |
//! Decodes Reed Solomon and BCH codes using the Berlekamp-Massey, Chien Search, and
//! Forney algorithms.
//!
//! # Decoding Procedure
//!
//! The standard [1]-[11] procedure for Reed Solomon/BCH error correction has the
//! following steps:
//!
//! 1. Generate the syndrome polynomial s(x) = s<sub>1</sub> + s<sub>2</... |
//! Smithay Client Toolkit
//!
//! Provides various utilities and abstractions for comunicating with various
//! Wayland compositors.
//!
//! ## `Environment`
//!
//! The crate is structured around the [`Environment`](environment/struct.Environment.html) type,
//! which binds the wayland globals for you using a set of ... |
//! Peer connection manager.
use std::marker::PhantomData;
use std::net;
use bitcoin::network::constants::ServiceFlags;
use nakamoto_common::block::time::{LocalDuration, LocalTime};
use nakamoto_common::collections::{HashMap, HashSet};
use nakamoto_common::p2p::peer::{AddressSource, Source};
use nakamoto_common::p2p... |
use super::exchange_rate_providers::*;
use futures::{
future::{err, Either},
Future, Stream,
};
use interledger_packet::{ErrorCode, Fulfill, Reject, RejectBuilder};
use interledger_service::*;
// TODO remove the dependency on interledger_settlement, that doesn't really make sense for this minor import
use inter... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.