text stringlengths 7.05k 33.9k |
|---|
use std::cell::RefCell;
use std::path::PathBuf;
use std::rc::{Rc, Weak};
use crate::shaders;
use crate::playback_manager::*;
use gelatin::cgmath::{Matrix4, Vector3};
use gelatin::glium::glutin::event::{ElementState, MouseButton};
use gelatin::glium::{program, texture::SrgbTexture2d, uniform, Display, Frame, Program,... |
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::collections::LookupMap;
use near_sdk::json_types::{Base58PublicKey, U128, U64};
use near_sdk::serde::{Deserialize, Serialize};
use near_sdk::wee_alloc;
use near_sdk::{
env, ext_contract, near_bindgen, AccountId, Balance, BlockHeight, Gas, ... |
/*!
DHCPv6 definitions and parser.
This module is incomplete, unstable and exempt from semantic versioning.
See:
* [RFC8415]: Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
[RFC8415]: https://datatracker.ietf.org/doc/html/rfc8415
*/
use byteorder::{ByteOrder, NetworkEndian};
use core::convert::{TryFrom, Tr... |
use std::f32;
use crate::vec::f32x3;
use crate::math;
pub fn lambertian() -> f32 {
f32::consts::FRAC_1_PI
}
pub fn oren_nayar(wo: f32x3, normal: f32x3, wi: f32x3, sigma: f32) -> f32 {
let n_dot_v = normal.dot(wo);
let n_dot_l = normal.dot(wi);
let theta_v = n_dot_v.acos();
let theta_l = n_dot... |
#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
//! USB on the go high speed
//!
//! Used by: stm32f745, stm32f750, stm32f765, stm32f7x6, stm32f7x7, stm32f7x9
#[cfg(not(feature = "nosync"))]
pub use crate::stm32f7::peripherals::otg_hs_host_v2::Instance;
pub use crate::stm32f7::periphe... |
#![windows_subsystem = "windows"]
use fltk::{app, prelude::*, *};
use fltk_theme::{ThemeType, WidgetTheme};
use serde::{Deserialize, Serialize};
use std::cmp;
use std::collections::HashMap;
use std::os::windows::process::CommandExt;
use version_compare::Version;
use winapi::um::winbase::{CREATE_NO_WINDOW, DETACHED_PRO... |
#![ allow (unused_parens) ]
use std::error::Error;
use std::hash::Hash;
use std::io::Read;
use std::io::Write;
use std::fs;
use std::fs::File;
use std::ops::DerefMut;
use std::path::Path;
use std::path::PathBuf;
use std::sync::Arc;
use std::sync::Mutex;
use futures;
use futures::BoxFuture;
use futures::Future;
use f... |
use std::i32;
use std::iter::Peekable;
use std::slice::Iter;
use itertools::Itertools;
use regex::Regex;
use crate::attribute::AttributeList;
use crate::attribute_pool::AttributePool;
use crate::component::{ComponentList, Operation, OperationCode};
use crate::util::to36String;
/// A changeset represents a change to ... |
use crate::{
common::{container::Container, non_nul_string::NonNulString},
debug, info,
npk::manifest::{Capability, RLimitResource, RLimitValue},
runtime::{
fork::util::{self, fork, set_child_subreaper, set_log_target, set_process_name},
ipc::{owned_fd::OwnedFd, Message as IpcMessage},
... |
use std::ops::Range;
/// The lowest possible event value.
pub const MIN: i32 = 0x00000001;
/// The lowest system event value.
pub const SYSTEM_START: i32 = 0x0001;
/// A sound has been played.
/// The system sends this event when a system sound, such as one for a menu, is played even if no sound is audible (for exam... |
#[doc = "Reader of register EPDMAST"]
pub type R = crate::R<u32, super::EPDMAST>;
#[doc = "Reader of field `EP_DMA_ST0`"]
pub type EP_DMA_ST0_R = crate::R<bool, bool>;
#[doc = "Reader of field `EP_DMA_ST1`"]
pub type EP_DMA_ST1_R = crate::R<bool, bool>;
#[doc = "Reader of field `EP_DMA_ST2`"]
pub type EP_DMA_ST2_R = cr... |
/*
* Copyright 2018 <NAME>, 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... |
//
//
// This file is a part of Aleph
//
// https://github.com/nathanvoglsam/aleph
//
// MIT License
//
// Copyright (c) 2020 Aleph Engine
//
// 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 Softwar... |
use anyhow::{bail, ensure, Result};
use common::color_text::*;
use common::point::*;
use pathfinding::prelude::*;
use std::collections::HashMap;
use std::fmt;
use std::io::Write;
use std::{thread, time};
use termion;
enum NeighborStatus {
Void,
Blocked,
Free(PointU),
}
#[derive(Clone, Debug, PartialEq)]
e... |
//! Nelder-mead (simplex) optimization method.
//!
//! [Nelder-Mead](https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method)
//! simplex-reflection method is a popular derivative-free optimization
//! algorithm. It keeps a [simplex](https://en.wikipedia.org/wiki/Simplex) of *n
//! + 1* points and the simplex is refle... |
pub use winit::{
event::{Event, VirtualKeyCode, WindowEvent, ModifiersState},
event_loop::ControlFlow,
};
use glium::{
index::PrimitiveType,
DrawParameters,
Blend,
texture::{CompressedSrgbTexture2d, RawImage2d, Texture2d},
uniform, Display, Frame, IndexBuffer, Program, Surface, VertexBuffer... |
// 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, ... |
use super::{Event, EventChange, EventId};
use anyhow::Result;
use chrono::{DateTime, Duration as SignedDuration, TimeZone, Utc};
use chrono_tz::Tz;
use futures::future::{abortable, AbortHandle};
use serenity::async_trait;
use std::{
collections::BTreeSet,
sync::{Arc, Weak},
time::Duration,
};
use tokio::{sy... |
use super::*;
mod background;
mod circle_renderer;
mod model;
mod texture_renderer;
use background::Background;
use circle_renderer::CircleRenderer;
use model::*;
use texture_renderer::TextureRenderer;
#[derive(geng::Assets)]
pub struct Assets {
#[asset(path = "aim.wav")]
aim_sound: geng::Sound,
#[asset(... |
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the "hack" directory of this source tree.
use super::{subst::Substitution, Result};
use crate::dependency_registrar::{DeclName, DependencyName, DependencyRegistrar};
use indexmap... |
use ::std::collections::HashMap;
#[derive(Eq, PartialEq, Debug, Clone)]
pub enum Object<'s> {
/// literal may be empty
StringLiteral(&'s str),
Compound(Compound<'s>)
}
/// only the result of parsing. does not do any smart stuff. only holds string results.
#[derive(Eq, PartialEq, Debug, Clone)]
pub struct... |
use crate::{util, Krate};
use anyhow::{Context, Error};
use serde::{Deserialize, Serialize};
use std::{
convert::TryFrom,
hash::{Hash, Hasher},
path::{Path, PathBuf},
sync::Arc,
};
use url::Url;
pub const CRATES_IO_URL: &str = "https://github.com/rust-lang/crates.io-index";
/// The normal crates.io DL ... |
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// https://rust-lang.org/COPYRIGHT.
//
// 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 o... |
//! Interpreter backend for CO can run the code right after it is compiled.
//!
//! Interpreter is meant to be the preferred option for development and quick iteration: it is
//! slower that the C target, but provides better error diagnostics and more safety checks.
mod cin;
mod errors;
mod internal;
mod values;
use ... |
use borsh::{BorshSerialize, BorshDeserialize};
use crate::{
error::CTokenError,
proof::{
BorshRangeProof, BorshRistretto, BorshScalar, PedersenComm, ProofKnowledge,
PedersenBase, commit_pedersen,
}
};
use sha3::Sha3_512;
use curve25519_dalek::{
ristretto::{CompressedRistretto, Ristrett... |
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// 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 ... |
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MI... |
use crate::algorithms::{chabad_holidays, israeli_holidays, shabbos_mevarchim};
use crate::args::types::{
AppError, CustomHoliday, Daf, DailyStudy, DailyStudyOutput, DayVal, Event, Language, ListArgs,
MainArgs, MinorHoliday, Name, OutputType, RambamChapter, RambamChapters, RambamThreeChapter,
YearType, Yeru... |
//! SorteryLib is a fast, cross-platform file-sorting library based on the Sortery command-line file sorter.
//!
//! Basic usage example:
//!
//! ```
//! use sorterylib::prelude::*; // Import all the stuff needed for basic operation
//!
//! fn main() {
//! // The fields for initializing the Sorter struct
//! ... |
#![feature(core_intrinsics)]
/// Provides the public Embedding interface
/// Note: the API does not take a Store and returns the new Store as stated in
/// the spec but takes a (possibly mutable) reference when needed
extern crate core;
#[macro_use]
mod interpreter;
mod ops;
mod valid;
mod binary;
mod runtime;
pub mo... |
// Copyright 2016 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 agree... |
// Copyright 2015-2017 <NAME>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL... |
//! Types and functionalities to declare and initialize gdnative classes.
//!
//! ## API endpoints
//!
//! Three endpoints are automatically invoked by the engine during startup and shutdown:
//!
//! - [`godot_gdnative_init`](macro.godot_gdnative_init.html),
//! - [`godot_nativescript_init`](macro.godot_nativescript_in... |
use std::borrow::*;
use std::collections::*;
use std::fmt::*;
use std::hash::*;
use std::hash::Hash;
use serde::{Serialize, Deserialize};
use differential_datalog::record::*;
// use ddlog_derive::*;
use crate::term::TermTraversal;
use crate::expression::*;
use crate::module::Env;
use super::generic::*;
use crate::typ... |
#![deny(warnings)]
#![allow(non_camel_case_types)]
#![allow(clippy::all)]
#![no_std]
mod generic;
pub use generic::*;
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - PWM Submodule"]
pub sm0: SM,
_reserved1: [u8; 8usize],
#[doc = "0x60 - PWM Submodule"]
pub sm1: SM,... |
use crate::agent_store::AgentInfoSigned;
use crate::event::MetricQuery;
use crate::event::MetricQueryAnswer;
use crate::types::event::*;
use crate::types::gossip::*;
use crate::types::*;
use ghost_actor::dependencies::tracing;
use kitsune_p2p_types::config::*;
use kitsune_p2p_types::metrics::*;
use kitsune_p2p_types::t... |
//! winapi-rs does not implements richedit.h, so here's the low level stuff
//! implemented here instead of in rich_text_box because it's kind of messy
use crate::controls::{
CharEffects, CharFormat, ParaAlignment, ParaFormat, ParaLineSpacing, ParaNumbering,
ParaNumberingStyle, UnderlineType,
};
use crate::win3... |
use super::WindowContext;
use crate::dataflow::{
api::Assigner,
conf::{StreamKind, WindowConf},
};
use crate::index::WindowIndex;
use crate::{
data::{ArconElement, ArconType},
error::*,
index::{EagerHashTable, IndexOps},
reportable_error,
stream::operator::{Operator, OperatorContext},
};
use... |
use crate::*;
use winit::event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent};
use winit::event_loop::{ControlFlow, EventLoop};
use winit::platform::desktop::EventLoopExtDesktop;
const ENABLE_DEBUG_MESSENGER_CALLBACK: bool = true;
#[derive(Copy, Clone, Debug, Hash, PartialEq)]
pub struct BufferHa... |
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
mod command;
mod status;
use crate::{
cr50::{
command::{
ccd::{
CcdCommand, CcdGetInfoResponse, CcdOpenResponse, C... |
/// Most of the code for this module comes from `rust-libp2p`.
///
/// Some panic logic has been removed, some error handling has been removed, and an error has been added.
///
use futures::{future, prelude::*, Future};
use log::{debug, trace};
use std::{
cmp::Ordering,
io::{self, Write},
};
use tokio::codec::l... |
//! This module contains a solver for Sparse Conditional Constant Propagation.
//!
//! The algorithm is based on <NAME>., <NAME> <NAME>.: Constant propagation with conditional branches:
//! ACM Transactions on Programming Languages and Systems Volume 13 Issue 2 April 1991 pp 181–210:
//! <https://doi.org/10.1145/10... |
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// Copyright 2017 The Chromium OS Authors. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
//
use libc::siginfo_t;
use std::cell::RefCell;
use std::ffi::c_void;
use std::io::{self, stdin};
use std::os::raw::c_int;
use... |
use std::{
collections::HashMap,
convert::TryInto,
fmt,
io::{self, Read, Write},
};
use slice_deque::SliceDeque;
use crate::{errors::VpkError, format::VpkMethod};
use super::{count_needed_bits, BitSize, Frequency, LzssBackend, TwoSample};
/// Configure the LZSS encoding that underlies `vpk0` compres... |
use super::*;
use log::info;
// TODO: probably move out proc gen
#[derive(Default)]
pub struct GamePlaySystem;
impl<'a> System<'a> for GamePlaySystem {
type SystemData = (
(
Entities<'a>,
WriteStorage<'a, Isometry>,
WriteStorage<'a, Blast>,
WriteStorage<'a, ... |
// 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.
//! Parses ELF files. For documentation on the format, see the ELF specification or
//! /usr/include/elf.h
#![allow(missing_docs)]
use {
crate::util,... |
// Symphonia
// Copyright (c) 2020 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/.
use std::cmp;
use crate::io::Monitor;
fn t... |
use std::borrow::Borrow;
use std::io::Read;
use crate::{cipherstring, Keys};
use crate::prelude::*;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum TwoFactorProviderType {
Authenticator = 0,
Email = 1,
Duo = 2,
Yubikey = 3,
U2f = 4,
Remember = 5,
OrganizationDuo = 6,
}
impl<'de> serd... |
use futures::FutureExt;
use std::path::PathBuf;
use std::str::FromStr;
use anyhow::{anyhow, Context};
use bstr::{BString, ByteSlice};
use clap::Clap;
use futures::TryFutureExt;
use humantime::format_rfc3339;
use tako::messages::common::WorkerConfiguration;
use tako::messages::common::{ProgramDefinition, StdioDef};
use... |
// Copyright 2018 The Exonum Team
//
// 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... |
use std::borrow::Borrow;
use std::convert::{self, TryFrom};
use std::io::{self, Write};
use std::str;
use atty::Stream;
use encoding_rs::{Encoding, MACINTOSH, UTF_16BE};
use allsorts::binary::read::ReadScope;
use allsorts::cff::{self, CFFVariant, Charset, FontDict, Operator, CFF};
use allsorts::error::ParseError;
use... |
// Copyright (c) SimpleStaking and Tezedge Contributors
// SPDX-License-Identifier: MIT
//! Contains various validation functions:
//! - to support to validate different parts of the chain
//! - to ensure consistency of chain
//! - to support multipass validation
use std::time::Duration;
use chrono::TimeZone;
use fa... |
// Copyright 2015-2018 <NAME> <<EMAIL>>
//
// 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... |
//! Read or write URIs start with `otpauth://totp/`.
//!
//! This module requires `oathuri` feature gate:
//! ```toml
//! # Cargo.toml
//! [dependencies]
//! totp_rfc6238 = { version = "0.4", features = [ "oathuri" ]}
//! ```
//!
//! The functions and methods in this module will automatically try to
//! overwrite the k... |
//! Event persistence and querying
use crate::error::Result;
use crate::event::Event;
use crate::subscription::Subscription;
use governor::clock::Clock;
use governor::{Quota, RateLimiter};
use hex;
use log::*;
use rusqlite::params;
use rusqlite::Connection;
use rusqlite::OpenFlags;
//use std::num::NonZeroU32;
use crate... |
use crate::pb::v1::governance_error::ErrorType;
use crate::pb::v1::neuron::DissolveState;
use crate::pb::v1::proposal::Action;
use crate::pb::v1::{
manage_neuron, Ballot, Empty, GovernanceError, Neuron, NeuronId, NeuronPermissionType, Vote,
};
use ic_base_types::PrincipalId;
use ledger_canister::Subaccount;
use std... |
pub mod checks_pins;
pub mod init_magic;
pub mod moves;
mod piece_attacks;
pub use self::checks_pins::*;
pub use self::moves::*;
pub use self::piece_attacks::*;
use board::*;
use std::convert::From;
use std::ops::{Index, IndexMut};
use types::*;
// Perft tests for move generation, see move_generation/perft_tests.rs
... |
use crate::ui::widgets::download_manager::docker::Docker;
use adw::prelude::ActionRowExt;
use gtk4::glib::clone;
use gtk4::subclass::prelude::*;
use gtk4::{self, gio, prelude::*};
use gtk4::{glib, CompositeTemplate};
use gtk_macros::{action, get_action};
use regex::Regex;
use std::collections::HashMap;
use std::ffi::Os... |
use serde::Deserialize;
use crate::client::Client;
use crate::error::ApiError;
use crate::attributes::Attribute;
use crate::utils::Rarity;
const ENDPOINT_URL: &str = "/v1/item_details";
/// This endpoint is quite silly, since all numerical values are encoded as strings, meaning when
/// a number is the expected resu... |
//! # Vesting Module
//!
//! ## Overview
//!
//! Vesting module provides a means of scheduled balance lock on an account. It
//! uses the *graded vesting* way, which unlocks a specific amount of balance
//! every period of time, until all balance unlocked.
//!
//! ### Vesting Schedule
//!
//! The schedule of a vesting ... |
use std::ptr::{read, write};
use std::rc::Rc;
use std::cell::RefCell;
use std::sync::{Arc, RwLock};
use libc::malloc;
use ::utils::pointer::{read_string, write_string, pointer_offset};
use ::utils::config::Config;
use ::store::file::{TableFile, FilePage, BitMap, PageHeader, TableFileManager};
use ::store::buffe... |
//! Comparison functions.
use inkwell::values::{IntValue, VectorValue};
use inkwell::IntPredicate;
use std::fmt;
use super::{FuncConstructor, FuncResult};
use crate::ast::{FuncCallInfo, FuncCallInfoMut, Function};
use crate::compiler::{self, const_uint, Compiler, Value};
use crate::errors::*;
use crate::lexer::Compar... |
// stm32f3-oscilloscope - src/main.rs
// A low-bandwidth, digital storage oscilloscope for the STM32F3 Discovery
// development board.
// Copyright © 2017 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"... |
// © 2019 3D Robotics. License: Apache-2.0
use bytes::{Bytes, BytesMut, BufMut};
use crate::stream_range::{ self, StreamRange };
use chrono::{DateTime, Utc, Datelike, Timelike};
/// A file to be included in a zip archive.
pub struct ZipEntry {
/// Filename within the archive.
pub archive_path: String,
///... |
mod config;
use config::*;
// For appending text to a PersonName field
macro_rules! append_part {
($part:expr, $ex:expr) => {{
if !$part.is_empty() {
$part.push(' ');
}
$part.push_str($ex);
}};
}
#[derive(Debug, PartialEq)]
pub struct PersonName {
pub title: String,
... |
use super::{Column, DataStore, PinModeRequirement};
use crate::error::Error;
use crate::repo::{PinKind, PinMode, PinStore, References};
use async_trait::async_trait;
use cid::{self, Cid};
use futures::stream::{StreamExt, TryStreamExt};
use once_cell::sync::OnceCell;
use sled::{
self,
transaction::{
Conf... |
//! A Rust library to find the nearest AWS region to a given location.
//!
//! Especially useful when you run code at the edge and want fast access to
//! regional AWS services, e.g. Cloudflare Workers accessing DynamoDB global
//! tables.
#![deny(clippy::all, clippy::nursery)]
#![deny(nonstandard_style, rust_2018_idi... |
use w5500_hl::{
io::{Read, Seek, SeekFrom, Write},
ll::{Registers, Sn},
net::{Eui48Addr, Ipv4Addr, SocketAddrV4},
Error, Hostname, Udp, UdpReader, UdpWriter,
};
/// DHCP options.
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[allow(dead_code)]
enum Options {
Pad = 0,
SubnetMask = 1,... |
//! Dynamixel Protocol 2
//!
//! Documentation can be found in: http://support.robotis.com/en/product/actuator/dynamixel_pro/communication.html
pub(crate) mod instruction;
#[macro_use]
mod control_table;
mod crc;
mod bit_stuffer;
use Interface;
use BaudRate;
use CommunicationError;
use bit_field::BitField;
use self... |
// Copyright (c) Microsoft. All rights reserved.
use std::collections::BTreeMap;
use std::default::Default;
use std::fmt;
use std::result::Result;
use std::str::FromStr;
use std::string::ToString;
use std::time::Duration;
use anyhow::Context;
use chrono::prelude::*;
use serde::{Deserialize, Serialize};
use serde_with... |
use std::option::Option::Some;
use carbide_core::color::{BLUE, RED};
use carbide_core::draw::Dimension;
use carbide_core::event::event_handler::{KeyboardEvent, MouseEvent};
use carbide_core::prelude::{StateSync, Uuid};
use carbide_core::state::state::State;
use carbide_core::widget::*;
use carbide_core::widget::primit... |
use crate::UnalignedBuffer;
use core::{cmp, hash::Hasher};
#[cfg(feature = "serialize")]
use serde::{Deserialize, Serialize};
const CHUNK_SIZE: usize = 16;
pub const PRIME_1: u32 = 2_654_435_761;
pub const PRIME_2: u32 = 2_246_822_519;
pub const PRIME_3: u32 = 3_266_489_917;
pub const PRIME_4: u32 = 668_265_263;
pub... |
use crate::{
archetype::{Archetype, ArchetypeComponentId, ArchetypeGeneration, ArchetypeId},
component::ComponentId,
query::{Access, FilteredAccessSet},
system::{
check_system_change_tick, ReadOnlySystemParamFetch, System, SystemId, SystemParam,
SystemParamFetch, SystemParamState,
},... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
//! This module provides algorithms for accessing and updating a Merkle Accumulator structure
//! persisted in a key-value store. Note that this doesn't write to the storage directly, rather,
//! it reads from ... |
//! A tokenizer for use in LALRPOP itself.
use std::borrow::Cow;
use std::str::CharIndices;
use unicode_xid::UnicodeXID;
use self::ErrorCode::*;
use self::Tok::*;
#[cfg(test)]
mod test;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Error {
pub location: usize,
pub code: ErrorCode,
}
#[derive(Clone, Deb... |
use super::{conv, HResult as _};
use std::{mem, sync::Arc, thread};
use winapi::{
shared::{dxgi, dxgi1_2, dxgi1_5, minwindef, windef, winerror},
um::{d3d12, d3d12sdklayers, winuser},
};
impl Drop for super::Adapter {
fn drop(&mut self) {
// Debug tracking alive objects
if !thread::panicking... |
// Copyright 2020 The Matrix.org Foundation C.I.C.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... |
use crate::{
common::non_null_string::NonNullString,
seccomp::{
bpf::{builder_from_rules, Builder},
SyscallArgRule, SyscallRule,
},
};
use std::{collections::HashMap, convert::TryInto};
// Filter lists that mimic docker's default list
// (https://github.com/moby/moby/blob/master/profiles/se... |
use crate::utils::Dbg;
use std::sync::Mutex;
use std::sync::Arc;
use dbus::channel::Sender;
use std::collections::HashMap;
use crate::{IfaceToken, Crossroads, Context, MethodErr};
use dbus::arg::{Variant, RefArg, Arg, Append, PropMap};
use std::marker::PhantomData;
use crate::ifacedesc::EMITS_CHANGED;
fn introspect(cr... |
use chrono::{DateTime, FixedOffset, SecondsFormat, Utc};
use lazy_static::lazy_static;
use serde::{de::DeserializeOwned, Deserialize};
use std::{
ffi::OsStr,
fmt::{self, Display, Formatter},
fs::File,
io::{self, Write},
path::{Path, PathBuf},
process::Command,
sync::Mutex,
time::{Duratio... |
//! Attention! This filesystem does not work
//! in a multi-threaded environment!
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate bitflags;
extern crate failure;
#[macro_use]
extern crate failure_derive;
extern crate bincode;
#[macro_use]
extern crate nix;
extern crate byteorder;
e... |
use crate::{
settings,
buffer::TextPosition,
editor::TextDocument,
editor::TextView,
theme::Theme,
language_support::SemanticTokenTypes,
util::pwstr_from_str
};
use std::{
collections::HashMap,
ptr::null_mut
};
use bindings::{
Windows::Win32::WindowsAndMessaging... |
//! Helpers for common ast manipulations required across different crates,
//! such as collating multi-event elements.
use crate::{BookEvent, EventHelper, NumberFormat, SemanticRole};
use bookbinder_common::MimeTypeHelper;
use extended_pulldown::CowStr;
use extended_pulldown::{Event, Tag};
use std::borrow::Cow;
use std... |
// Copyright 2020 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// 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... |
use crate::parser::{self, Node};
use cilk;
use cilk::ir::module;
use std::collections::HashMap;
pub struct CodeGenerator {
pub module: module::Module,
types: Types,
}
pub struct CodeGeneratorForFunction<'a> {
builder: cilk::builder::Builder<cilk::builder::FunctionIdWithModule<'a>>,
types: &'a Types,
... |
/* ************************************************************************ **
** This file is part of rsp2, and is licensed under EITHER the MIT license **
** or the Apache 2.0 license, at your option. **
** **
** ... |
use alloc::{boxed::Box, vec::Vec};
use core::{convert::TryInto, iter::repeat_with, marker::PhantomData};
use curve25519_dalek::{
constants::{RISTRETTO_BASEPOINT_POINT, RISTRETTO_BASEPOINT_TABLE},
ristretto::RistrettoPoint,
scalar::Scalar,
traits::Identity,
};
use rand::{prelude::StdRng, SeedableRng};
//... |
mod file_log;
mod formatter;
pub mod log_macro;
use std::env;
use std::fmt;
use std::io::{self, BufWriter};
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Mutex;
use std::thread;
use log::{self, SetLoggerError};
use slog::{self, slog_o, Drain, FnValue, Key, OwnedKVList,... |
use crate::{keyword, path_matches};
use once_cell::unsync::OnceCell;
use proc_macro2::{Span, TokenStream};
use quote::{format_ident, quote, IdentFragment, ToTokens, TokenStreamExt};
use std::{
collections::hash_map::DefaultHasher,
fmt::{self, Debug, Display, Formatter},
hash::{Hash, Hasher},
};
use syn::{
... |
use crate::pixels::PixelsMut;
use crate::view::layer::LayerCoords;
use crate::view::{ViewCoords, ViewExtent};
use rgx::kit::shape2d::{Fill, Rotation, Shape, Stroke};
use rgx::kit::{Rgba8, ZDepth};
use rgx::math::{Point2, Vector2};
use rgx::rect::Rect;
use std::collections::BTreeSet;
use std::fmt;
/// Input state of ... |
// This file is part of Sulis, a turn based RPG written in Rust.
// Copyright 2018 <NAME>
//
// Sulis 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 opt... |
use fraction::ToPrimitive;
use crate::rse::*;
use crate::io::*;
use crate::gp::*;
/// A mix table item describes a mix parameter, e.g. volume or reverb
#[derive(Debug,Clone,PartialEq,Default)]
pub struct MixTableItem {
pub value: u8,
pub duration: u8,
pub all_tracks: bool,
}
//impl Default for MixTableIte... |
// Copyright (c) Microsoft. All rights reserved.
#![deny(warnings)]
extern crate azure_sdk_for_rust;
extern crate backtrace;
extern crate byteorder;
extern crate bytes;
extern crate chrono;
extern crate futures;
extern crate hex;
extern crate http;
extern crate humantime;
extern crate hyper;
extern crate hyper_tls;
ex... |
#[derive(Debug, PartialEq, Clone)]
pub struct Wildcards {
pub in_port: bool,
pub dl_vlan: bool,
pub dl_src: bool,
pub dl_dst: bool,
pub dl_type: bool,
pub nw_proto: bool,
pub tp_src: bool,
pub tp_dst: bool,
pub nw_src: u32,
pub nw_dst: u32,
pub dl_vlan_pcp: bool,
pub nw_t... |
//! The audio graph topology and render algorithm
use std::collections::HashMap;
use super::{Alloc, AudioParamValues, AudioProcessor, AudioRenderQuantum, NodeIndex};
use crate::node::{ChannelConfig, ChannelCountMode};
use crate::render::RenderScope;
use smallvec::{smallvec, SmallVec};
/// Connection between two aud... |
use std::io::Write;
use std::net::SocketAddr;
use std::net::TcpStream;
use std::os::unix::fs::PermissionsExt;
use std::process::Command;
use std::sync::Arc;
use std::time::Duration;
use std::{collections::BTreeMap, path::PathBuf};
use std::{
fs::{self, File, OpenOptions},
io::Read,
};
use anyhow::{Context, Res... |
use geom::prim;
use geom::util;
use core;
use std;
use std::ops::Index;
use rand;
use rand::distributions::IndependentSample;
use rand::distributions::range::Range;
/// Note: the implementation of a bounding-volume hierarchy in this file is taken from
/// PBRT, 3rd edition, section 4.3 (starting around page 256).
s... |
use rand::Rng;
use ya6502::memory::Inspect;
use ya6502::memory::Read;
use ya6502::memory::Write;
use ya6502::memory::{Memory, ReadError, ReadResult, WriteError, WriteResult};
/// A MOS Technology 6532 RIOT chip. Note that originally, this chip also
/// included 128 bytes of RAM, but for the sake of single-responsibili... |
use std::ops::Not;
use std::sync::atomic::AtomicBool;
use strum::IntoEnumIterator;
use failure::_core::sync::atomic::Ordering;
use parking_lot::lock_api::RawReentrantMutex;
use parking_lot::{RawMutex, RawThreadId};
use eee::Crypto;
use mav::ma::{BeforeSave, Dao, Db, DbCreateType, DbName, MAddress, MBtcChainToken, MEe... |
use anyhow::{anyhow, Context as _};
use geekytray_shell::event::{ControlFlow, Event, EventLoop, EventLoopContext, KeyState, Modifiers};
use geekytray_shell::geometrics::Size;
use geekytray_shell::window::Window;
use geekytray_shell::xkb;
use std::mem::ManuallyDrop;
use std::process;
use std::rc::Rc;
use x11rb::connecti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.