text stringlengths 8 4.13M |
|---|
#[doc = "Register `SR` reader"]
pub type R = crate::R<SR_SPEC>;
#[doc = "Register `SR` writer"]
pub type W = crate::W<SR_SPEC>;
#[doc = "Field `DINIS` reader - Data input interrupt status This bit is set by hardware when the FIFO is ready to get a new block (16 locations are free). It is cleared by writing it to 0 or b... |
use crate::dsp::types::*;
|
extern crate chrono;
extern crate fern;
extern crate hyper;
extern crate log;
extern crate mime;
#[macro_use]
extern crate serde_derive;
extern crate gotham;
extern crate shib_gotham;
use gotham::http::response::create_response;
use gotham::middleware::session::{NewSessionMiddleware, SessionData};
use gotham::pipelin... |
use core::ptr;
const XDMA_BASE: u32 = 0x1000C000u32;
macro_rules! xdmainst_size {
(GO) => (6);
(END) => (1);
(KILL) => (1);
(FLUSHP) => (2);
(WFP) => (2);
(WFE) => ();
(LD) => (1);
(LDPS) => (2);
(LDPB) => (2);
(ST) => (1);
(STP) => (2);
(STZ) => (1);
(LP) => (2);
... |
use sdl2::render::{TextureQuery, TextureCreator, Texture, Canvas};
use sdl2::video::{Window, WindowContext};
use sdl2::surface::Surface;
use std::rc::Rc;
use std::cell::RefCell;
use engine::utils::rectangle::Rectangle;
use engine::components::{Component, Components};
pub struct Sprite<'window> {
sprite: Rc<RefCe... |
use std::fmt;
use std::fmt::{Display, Formatter};
use crate::changelog::{Scope, Section};
use crate::ChangeLog;
impl ChangeLog {
pub fn markdown(&self) -> MarkdownChangelog {
let mut scopes: Vec<&Option<Scope>> = self.scopes().collect();
scopes.sort();
MarkdownChangelog {
brea... |
#[doc = "Reader of register RX_CTRL"]
pub type R = crate::R<u32, super::RX_CTRL>;
#[doc = "Writer for register RX_CTRL"]
pub type W = crate::W<u32, super::RX_CTRL>;
#[doc = "Register RX_CTRL `reset()`'s with value 0x0107"]
impl crate::ResetValue for super::RX_CTRL {
type Type = u32;
#[inline(always)]
fn res... |
//! Indexed collection of values.
//!
//! # Remarks
//!
//! With the ``prelude`` module, we can easily convert a tuple of ``IntoIterator``s
//! into ``Process`` for ease of use. The same can be achieved with the
//! ``new`` method.
//!
//! # Examples
//!
//! Quick plot.
//! ```no_run
//! use preexplorer::prelude::*;
//... |
use std::collections::HashMap;
use crates_io_api::SyncClient;
use failure::{Error, format_err};
use semver::Version;
pub fn check_crates_io(
name: Option<&str>,
current_version: Option<Version>,
) -> Result<Option<Version>, Error> {
let name = match name {
Some(n) => n,
None => env!("C... |
#[doc = "Reader of register SCAN_INTERVAL"]
pub type R = crate::R<u32, super::SCAN_INTERVAL>;
#[doc = "Writer for register SCAN_INTERVAL"]
pub type W = crate::W<u32, super::SCAN_INTERVAL>;
#[doc = "Register SCAN_INTERVAL `reset()`'s with value 0x10"]
impl crate::ResetValue for super::SCAN_INTERVAL {
type Type = u32... |
use std::os::raw::c_char;
use std::ffi::CStr;
use photic::pipeline::shader::{Shader, ShaderSource};
pub struct X3DShader {
pub shader: Shader,
}
impl X3DShader {
pub fn new(vertex_shader: String, geometry_shader: Option<String>, tesselation_shader: Option<String>, fragment_shader: String) -> Self {
l... |
// Copyright (C) 2021 Subspace Labs, Inc.
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unle... |
/*!
```rudra-poc
[target]
crate = "bam"
version = "0.1.2"
indexed_version = "0.1.0"
[test]
cargo_flags = ["--release"]
[report]
issue_url = "https://gitlab.com/tprodanov/bam/-/issues/4"
issue_date = 2021-01-07
rustsec_url = "https://github.com/RustSec/advisory-db/pull/782"
rustsec_id = "RUSTSEC-2021-0027"
[[bugs]]
a... |
#![cfg_attr(feature = "unstable", feature(test))]
// Launch program : cargo run --release < input/input.txt
// Launch benchmark : cargo +nightly bench --features "unstable"
/*
Benchmark results:
running 5 tests
test tests::test_part_1 ... ignored
test tests::test_part_2 ... ignored
test bench::bench_... |
#[cfg(feature = "dll")]
pub extern crate libc;
#[cfg(feature = "dll")]
pub extern crate libloading;
pub extern crate uuid;
#[macro_use]
extern crate error_chain;
mod error;
mod macros;
mod types;
pub use error::*;
pub use types::*;
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4)... |
use serde::{Deserialize, Serialize};
use uuid::Uuid;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub enum PollStatus {
Pending,
Active,
Complete
}
impl std::str::FromStr for PollStatus {
type Err = anyhow::Error;
fn from_str(s: &str) -> anyhow::Result<Self> {
match s {
"Pending" =>... |
use crate::SnailfishNumber::*;
use itertools::Itertools;
use std::cmp::max;
use std::fs;
#[derive(PartialEq, Eq, Debug, Hash)]
enum SnailfishNumber {
Literal(u8),
Pair(Box<SnailfishNumber>, Box<SnailfishNumber>),
}
impl SnailfishNumber {
fn new_pair(left: SnailfishNumber, right: SnailfishNumber) -> Self {... |
// ===============================================================================
// Authors: AFRL/RQQA
// Organization: Air Force Research Laboratory, Aerospace Systems Directorate, Power and Control Division
//
// Copyright (c) 2017 Government of the United State of America, as represented by
// the Secretary of th... |
use std::fs::File;
use std::io::{self, BufWriter, Stdout, Write};
use std::path::PathBuf;
pub enum Output {
Console(BufWriter<Stdout>),
File(BufWriter<File>),
Mem(Vec<u8>),
}
impl Output {
pub fn console() -> Output {
Output::Console(io::BufWriter::new(std::io::stdout()))
}
pub fn fil... |
use std::marker::PhantomData;
use log::{error, warn};
use rodio::OutputStream;
#[cfg(feature = "profiler")]
use thread_profiler::profile_scope;
use amethyst_assets::AssetStorage;
use amethyst_core::ecs::{
DispatcherBuilder, ParallelRunnable, Resources, System, SystemBuilder, SystemBundle, World,
};
use amethyst_e... |
//! Tests auto-converted from "sass-spec/spec/core_functions/color"
#[allow(unused)]
use super::rsass;
mod adjust_color;
// From "sass-spec/spec/core_functions/color/adjust_hue.hrx"
mod adjust_hue {
#[allow(unused)]
use super::rsass;
#[test]
fn above_max() {
assert_eq!(
rsass(
... |
//! This is a generic module to work with side metadata (vs. in-object metadata)
//!
//! This module enables the implementation of a wide range of GC algorithms for VMs which do not provide (any/sufficient) in-object space for GC-specific metadata (e.g. marking bits, logging bit, etc.).
//!
//!
//! # Design
//!
//! MMT... |
use alloc::vec::Vec;
use crate::{buffer::Buffer, Renderer, VertexFormat};
pub struct Mesh {
pub(crate) vertex_buffers: Vec<Buffer>,
pub(crate) strides: Vec<usize>,
pub(crate) index_buffer: Buffer,
pub(crate) vertex_formats: Vec<VertexFormat>,
}
impl Mesh {
pub async fn new(renderer: &Renderer, ve... |
use crate::endpoints::params::Preconditions;
use drogue_cloud_database_common::{
error::ServiceError,
models::{Constraints, Resource},
};
use uuid::Uuid;
/// check if an expected UUID is equal to the actual one.
///
/// Returns `None` if the UUIDs don't match, otherwise `Some` containing the UUID.
fn is_ok_and... |
extern crate crypto;
use crypto::sha2::Sha256;
use crypto::digest::Digest;
use super::primitive::hash::{H256};
pub fn hash(input: &[u8]) -> H256 {
let mut hash = H256::default();
let mut hasher = Sha256::new();
hasher.input(input);
hasher.result(&mut hash.0[..]);
hash
}
|
use shorthand::ShortHand;
#[derive(ShortHand)]
#[shorthand]
struct Example {
value: usize,
}
#[derive(ShortHand)]
#[shorthand = ""]
struct Example2 {
value: usize,
}
fn main() {}
|
use bismit::Cortex;
use bismit::map::{self, LayerTags, LayerMapKind, LayerMapScheme, LayerMapSchemeList,
AreaSchemeList, CellScheme, InputScheme, AxonKind, LayerKind, AreaScheme};
// use bismit::proto::{ProtolayerMap, ProtolayerMaps, ProtoareaMaps, Axonal, Spatial, Horizontal,
// Cortical, Thalamic, Protocell, ... |
fn main() {
let first = String::from("first");
assert_eq!("irst-fay", piggify(&first));
let apple = String::from("apple");
assert_eq!("apple-hay", piggify(&apple));
let hay = String::from("hay");
assert_eq!("ay-hay", piggify(&hay));
let iter = String::from("iter");
assert_eq!("iter-hay",... |
extern crate exact_cover;
use exact_cover::instances::sudoku::{SudokuSolver, sudoku_solver, solution_as_matrix};
use std::io::{stdin};
fn read_sudoku() -> (String, Option<SudokuSolver>) {
let mut line = String::new();
if stdin().read_line(&mut line).is_err() {
return (line, None)
}
let v: Vec... |
use cosmwasm_std::{Binary, Decimal, Uint128};
use cw721::Cw721ReceiveMsg;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
pub name: String,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq,... |
// Copyright © 2015-2017 Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! A simple interface to the Google URL Shortener API.
extern crate hyper;
extern crate hyper_native_tls;
extern crate rustc_serialize;
extern crate url;
use hyper::Client;
use hyper::net::HttpsConnector;
use hyper_native_tls::Nati... |
fn main() {
sudo_rs::su_main();
}
|
use {
http::{header, StatusCode},
tsukuyomi::{
endpoint,
test::{self, loc, TestServer},
App,
},
};
#[test]
fn test_into_response_preset() -> test::Result {
use {
std::fmt,
tsukuyomi::{
future::{Poll, TryFuture},
input::Input,
o... |
use std::sync::Arc;
use apllodb_shared_components::{
ApllodbError, ApllodbResult, ApllodbSessionError, ApllodbSessionResult, Session, SessionWithTx,
};
use apllodb_sql_parser::apllodb_ast::{
AlterTableCommand, Command, CreateTableCommand, TableElement,
};
use apllodb_storage_engine_interface::{
AlterTableA... |
// These are arbitrarily chosen, but with care not to overlap
// processor defined exceptions or interrupt vectors.
pub const T_SYSCALL: u32 = 64; // system call
pub const T_DEFAULT: u32 = 500; // catchall
pub const T_IRQ0: u32 = 32; // IRQ 0 corresponds to int T_IRQ
pub const IRQ_TIMER: u32 = 0;
pub const IRQ_KBD: u32... |
extern crate sdl2;
extern crate chiprs;
use sdl2::pixels::Color;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::render::WindowCanvas;
use sdl2::rect::Rect;
use std::time::{Duration, Instant};
use chiprs::Chip;
use chiprs::display::{Display, DISPLAY_W, DISPLAY_H};
const PIXEL_W: usize = 10;
const PIXE... |
use super::*;
use std::ffi::CString;
use std::fs::File;
use std::io::Read;
use std::error::Error;
pub enum ShaderType
{
Vertex ,
Fragment,
Compute ,
Geometry
}
impl ShaderType{
fn value(&self) -> GLenum{
match *self {
ShaderType::Vertex => gl::VERTEX_SHADER,
Shade... |
use std::cmp::max;
use std::cmp::min;
fn read_line() -> String {
let mut line = String::new();
std::io::stdin().read_line(&mut line).unwrap();
line.trim_end().to_owned()
}
fn main() {
let _n: i64 = read_line().parse().unwrap();
let aa = read_line()
.split_whitespace()
.map(|v| v.pa... |
use crate::shared::tree_node::TreeNode;
use std::cell::RefCell;
use std::rc::Rc;
struct Solution;
/// https://leetcode.com/problems/kth-smallest-element-in-a-bst/
impl Solution {
/// 0 ms 3.1 MB
pub fn kth_smallest(root: Option<Rc<RefCell<TreeNode>>>, k: i32) -> i32 {
fn helper(node: &Rc<RefCell<TreeN... |
use std::cell::Cell;
use std::collections::HashMap;
use std::{time::Instant, fmt::Formatter, error::Error};
use std::fmt::Debug;
#[derive(Debug, Copy, Clone, PartialEq)]
enum ValueKind {
Int,
Float,
Bool,
Object,
}
#[derive(Debug, Copy, Clone, PartialEq)]
enum Value {
Int(i64),
Float(f64),
... |
use regex::Regex;
use std::{
net::IpAddr,
str::FromStr
};
pub fn is_ipv4(value: &str) -> bool {
//! Check to see if a given value corresponds to IPv4 Address.
//!
//! ## Example Usage
//! ```rust
//! use validaten::networks::is_ipv4;
//!
//! fn main() {
//! assert!(is_ipv4("... |
#[cfg(any(target_os = "macos", target_os = "ios"))]
#[path = "darwin.rs"]
pub mod sys;
#[cfg(target_os = "linux")]
#[path = "linux.rs"]
pub mod sys;
pub use sys::{setup_ip, DNSSetup};
|
// implements the surface volume structure
pub struct Surface {
}
impl Surface {
} |
use crossbeam::channel;
use std::thread;
use std::time::Duration;
fn expensive_sum(v: Vec<i32>) -> i32 {
pause_ms(500);
println!("Child thread: just about finished");
v.iter()
.filter(|x| { *x%2 == 0})
.map(|&x| { x * x})
.sum()
}
fn pause_ms(ms: u64) {
thread::sleep(Duratio... |
use crate::types::{Array, Str};
use crate::value::{FromValue, ToValue, Value};
macro_rules! value_i {
($t:ty) => {
impl ToValue for $t {
fn to_value(&self) -> $crate::Value {
$crate::Value::i64(self.clone() as i64)
}
}
impl FromValue for $t {
... |
mod dijk;
use crate::BurrowLocation::{Hallway, Room};
use lazy_static::lazy_static;
use std::cmp::{max, min};
use std::collections::HashMap;
use std::fs;
lazy_static! {
static ref ORGANIZED_SIDE_ROOMS: [Vec<Amphipod>; 4] = [
vec![Amphipod::A, Amphipod::A, Amphipod::A, Amphipod::A],
vec](https://crates.io/crates/extended-collections)
//! [](https://docs.rs/extended-collections)
//! []
mod client;
mod server;
mod common; |
//! This project is used for explaining the DTFSE operation. Here, we have a
//! periodic square signal. The complex form of this signal is represented with
//! s_complex array. DTFSE coefficients are calculated, then, the signal is
//! approximated with the DTFSE function. This function returns its output in
//! real ... |
use specs::Join;
use std::f32::consts::PI;
pub struct UpdateDynamicDrawEraserSystem;
impl<'a> ::specs::System<'a> for UpdateDynamicDrawEraserSystem {
type SystemData = (
::specs::ReadStorage<'a, ::component::Aim>,
::specs::ReadStorage<'a, ::component::PhysicBody>,
::specs::ReadStorage<'a, ... |
//! The module contains a list of helpers for [`IntoRecords`]
//!
//! [`IntoRecords`]: crate::grid::records::IntoRecords
pub mod limit_column_records;
pub mod limit_row_records;
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub mod buf_records;
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(c... |
extern crate bulletrs;
extern crate cgmath;
use cgmath::{Vector3, Vector4};
use bulletrs::*;
#[test()]
fn ray_test() {
let configuration = CollisionConfiguration::new_default();
let mut dynamics_world = DynamicsWorld::new_discrete_world(
CollisionDispatcher::new(&configuration),
Broadphase::... |
// 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::... |
/*!
```rudra-poc
[target]
crate = "pulse-simple"
version = "1.0.1"
[report]
issue_url = "https://github.com/astro/rust-pulse-simple/issues/5"
issue_date = 2021-02-05
[[bugs]]
analyzer = "UnsafeDataflow"
bug_class = "HigherOrderInvariant"
bug_count = 2
rudra_report_locations = [
"src/lib.rs:144:5: 150:6",
"src... |
use super::*;
use stun::message::BINDING_REQUEST;
#[test]
fn test_use_candidate_attr_add_to() -> Result<(), Error> {
let mut m = Message::new();
assert!(!UseCandidateAttr::is_set(&m), "should not be set");
m.build(&[Box::new(BINDING_REQUEST), Box::new(UseCandidateAttr::new())])?;
let mut m1 = Messag... |
use super::prelude::*;
pub fn setup(window: >k::Window) {
let screen: gdk::Screen = match window.get_screen() {
Some(screen) => screen,
None => {
println!("Failed to get the screen for window.");
return;
}
};
let css_provider = gtk::CssProvider::new();
... |
/**
*
To allow future revisions of this specification to add new attributes
if needed, the attribute space is divided into two ranges.
Attributes with type values between 0x0000 and 0x7FFF are
comprehension-required attributes, which means that the STUN agent
cannot successfully process the message unless it ... |
#[derive(Copy, Clone)]
pub enum Direction { Up, Down, Left, Right }
pub struct Wall {
pub x: usize,
pub y: usize,
pub dir: Direction,
}
|
#![recursion_limit = "1024"]
#![feature(match_default_bindings)]
#![feature(nll)]
#![feature(try_trait)]
#![feature(use_nested_groups)]
#[macro_use] extern crate failure;
#[macro_use] extern crate indoc;
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate log;
#[macro_use] extern crate maplit;
#[macro_use... |
use crate::interfaces::*;
use crate::introspect::*;
use crate::*;
use rustbus::wire::unmarshal::Error as UnmarshalError;
use std::cell::Cell;
use std::fmt::Write;
use std::path::{Path, PathBuf};
/// `LocalDescBase` is used to create GATT descriptors to be added to `LocalServiceBase`
pub struct LocalDescBase {
pub(... |
use crate::background::BgEvent;
use crate::utils::spawn;
use crate::{Event, TaskEntity};
use crate::widgets::Task; //because TASK IS NOT FOUND anywhere
use async_channel::Sender;
use glib::{clone, SourceId};
// use glib::SourceId; ARE CHANGES REQUIRED HERE TOO BECAUSEE I IMPORTED IT ABOVE
use gtk::prelude::*;
use slo... |
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>,... |
use crate::config;
use amethyst::input::{InputHandler, StringBindings};
use serde::{Deserialize, Serialize};
pub fn input_movement(input: &InputHandler<StringBindings>) -> (f32, f32) {
let raw_movement_y = match input.axis_value("player_vertical") {
Some(mov) => mov,
None => 0.0,
};
let raw... |
use anyhow::Result;
use kira::instance::InstanceSettings;
use kira::manager::{AudioManager, AudioManagerSettings};
use kira::sound::{self, handle::SoundHandle, SoundSettings};
use std::io::Cursor;
pub(crate) struct Player {
_manager: AudioManager,
sounds: Sounds,
}
struct Sounds {
music: SoundHandle,
... |
// Copyright 2018-2019 Mozilla
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, sof... |
// Supress warnings generated by bindgen: https://github.com/rust-lang/rust-bindgen/issues/1651
#![allow(deref_nullptr)]
#![allow(unknown_lints)]
//! Setup and control loop devices.
//!
//! Provides rust interface with similar functionality to the Linux utility `losetup`.
//!
//! # Examples
//!
//! Default options:
//... |
use crate::info::fetch_ws_crates;
use crate::util::{can_publish, get_published_version};
use anyhow::bail;
use anyhow::{Context, Result};
use cargo_metadata::Package;
use clap::ArgMatches;
use futures_util::future::{BoxFuture, FutureExt};
use semver::Version;
use std::collections::HashMap;
use std::fs::{read_to_string,... |
use crate::Result;
/// The ThreadPool contain new and spawn functions
pub trait ThreadPool {
/// Creates a new thread pool, immediately spawning the specified number of threads.
/// Returns an error if any thread fails to spawn. All previously-spawned threads are terminated.
fn new(threads: u32) -> Result<... |
use std::thread;
use std::time::Duration;
async fn run() {
println!("hello");
async_std::task::sleep(Duration::from_secs(1)).await;
println!("world!");
complete::mark_complete();
}
fn main() -> () {
thread::spawn(move || {
executor::spawn(run());
});
complete::block_until_complete(... |
#![recursion_limit = "1024"]
mod audio_service;
mod audio_store;
mod encoder;
mod recent_cache;
mod silence_gate;
use async_std::prelude::StreamExt;
use regex::Regex;
use async_std::future::timeout;
use std::time::Duration;
static EVENTSTREAM_PING_TIMEOUT: Duration = Duration::from_secs(15);
lazy_static::lazy_stati... |
//! Rasterizer for Outlines with Anti-Aliasing
//!
//! # Example
//!
//!
//! use agg::{Pixfmt,Rgb8,Rgba8,DrawOutline};
//! use agg::{RendererOutlineAA,RasterizerOutlineAA};
//!
//! // Create Image and Rendering Base
//! let pix = Pixfmt::<Rgb8>::new(100,100);
//! let mut ren_base = agg::RenderingBas... |
#![allow(dead_code)]
use std::mem;
use winapi::*;
/// A wrapper around `OVERLAPPED` to provide "rustic" accessors and
/// initializers.
#[derive(Debug)]
pub struct Overlapped(OVERLAPPED);
unsafe impl Send for Overlapped {}
unsafe impl Sync for Overlapped {}
impl Overlapped {
/// Creates a new zeroed out instan... |
#![doc = "generated by AutoRust 0.1.0"]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(unused_imports)]
use super::{models, API_VERSION};
#[non_exhaustive]
#[derive(Debug, thiserror :: Error)]
#[allow(non_camel_case_types)]
pub enum Error {
#[error(transparent)]
Operations_List(#[from] operations::l... |
// This file was generated
mod string_private { pub trait Sealed { } }
/// Extension for [`String`](std::string::String)
pub trait IsntStringExt: string_private::Sealed {
/// The negation of [`is_empty`](std::string::String::is_empty)
#[must_use]
fn is_not_empty(&self) -> bool;
}
impl string_private::Sea... |
extern crate actix_web;
extern crate serde_json;
extern crate uuid;
extern crate ikrelln;
mod helpers;
use std::collections::HashMap;
use std::{thread, time};
use actix_web::*;
use ikrelln::api::span::IngestResponse;
use ikrelln::opentracing::span::Kind;
use ikrelln::opentracing::Span;
#[test]
fn can_receive_span... |
use crate::enums::{Color, Font};
use crate::prelude::*;
use crate::utils::FlString;
use fltk_sys::dialog::*;
use std::{
ffi::{CStr, CString},
mem,
os::raw,
};
/// Color modes to be used with the color chooser
#[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum ColorMode {
/// Rgb color mode
... |
use std::sync::MutexGuard;
use nia_interpreter_core::Interpreter;
use nia_interpreter_core::NiaInterpreterCommand;
use nia_interpreter_core::NiaInterpreterCommandResult;
use nia_interpreter_core::{
EventLoopHandle, NiaRemoveDeviceByPathCommandResult,
};
use crate::error::{NiaServerError, NiaServerResult};
use cr... |
use std::ptr;
use crate::bdev::BDev;
use crate::generated::{spdk_bdev_create_bs_dev, spdk_bs_dev};
#[derive(Debug, Error)]
pub enum BlobBDevError {
#[error(display = "Could not create blob bdev!: {}", _0)]
FailedToCreate(String),
}
/// SPDK blob store block device.
///
/// This is a virtual representation of... |
use std::marker::PhantomData;
use std::iter::*;
use std::collections::VecDeque;
use std::cmp::Ordering;
use num::{PrimInt, zero, one};
use myopic::*;
use myopic::lens::lens::*;
use crate::shape::*;
// NOTE this is just a Monoid Action
pub trait Scope<I> {
fn adjust(&mut self, index: I);
}
pub struct Action<F,... |
pub mod action;
pub mod args;
pub mod error;
pub use action::*;
pub use args::*;
pub use error::*;
|
use primal::Primes;
pub fn run() -> u64 {
Primes::all().take_while(|&x| x < 2_000_000).sum::<usize>() as u64
}
|
use crate::{format_context::FormatContext, tools};
use ffmpeg_sys_next::*;
#[derive(Debug)]
pub struct SubtitleDecoder {
pub identifier: String,
pub stream_index: isize,
pub codec_context: *mut AVCodecContext,
}
impl SubtitleDecoder {
pub fn new(
identifier: String,
format: &FormatContext,
stream_... |
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
if env::var_os("CARGO_FEATURE_RT").is_some() {
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
println!("cargo:rustc-link-search={}", out.display());
let device_file = if env::var_os("CARGO_FEATURE_STM32G431").is_some(... |
//! Channel for sending and receiving STUN messages.
use crate::message::{
ErrorResponse, Indication, InvalidMessage, MessageError, MessageErrorKind, MessageResult,
Request, Response, SuccessResponse,
};
use crate::transport::StunTransport;
use crate::{Error, Result};
use fibers::sync::oneshot;
use fibers_timeo... |
use cumulus_client_consensus_aura::{
build_aura_consensus, BuildAuraConsensusParams, SlotProportion,
};
use cumulus_client_network::build_block_announce_validator;
use cumulus_client_service::{
prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams,
};
use cumulus_primitives_co... |
#[doc = "Reader of register LTDC_BPCR"]
pub type R = crate::R<u32, super::LTDC_BPCR>;
#[doc = "Writer for register LTDC_BPCR"]
pub type W = crate::W<u32, super::LTDC_BPCR>;
#[doc = "Register LTDC_BPCR `reset()`'s with value 0"]
impl crate::ResetValue for super::LTDC_BPCR {
type Type = u32;
#[inline(always)]
... |
use crate::asm::out8;
const PIC0_ICW1: u32 = 0x0020;
pub const PIC0_OCW2: u32 = 0x0020;
const PIC0_IMR: u32 = 0x0021;
const PIC0_ICW2: u32 = 0x0021;
const PIC0_ICW3: u32 = 0x0021;
const PIC0_ICW4: u32 = 0x0021;
const PIC1_ICW1: u32 = 0x00a0;
pub const PIC1_OCW2: u32 = 0x00a0;
const PIC1_IMR: u32 = 0x00a1;
const PIC1_I... |
extern crate pest;
#[macro_use]
extern crate pest_derive;
use clap::{load_yaml, App};
use image::{DynamicImage, ImageBuffer};
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
mod canvas;
mod css;
mod html;
mod layout;
mod mock;
mod paint;
mod style;
use pest::Parser;
fn main() {
let yaml = load_... |
use super::{check_dtype, HasPandasColumn, PandasColumn, PandasColumnObject, GIL_MUTEX};
use crate::errors::ConnectorXPythonError;
use anyhow::anyhow;
use fehler::throws;
use ndarray::{ArrayViewMut2, Axis, Ix2};
use numpy::{npyffi::NPY_TYPES, Element, PyArray, PyArrayDescr};
use pyo3::{FromPyObject, Py, PyAny, PyResult,... |
use std::sync::Arc;
use anyhow::Context;
use crate::app::authz::AuthzObject;
use crate::app::AppContext;
use crate::app::{error::ErrorExt, error::ErrorKind as AppErrorKind};
use crate::db::class::WebinarType;
use super::{find, AppResult};
pub use convert::convert as convert_webinar;
pub use create::*;
pub use downl... |
/* Our Crate */
use day_3::*;
/* Standard Library */
use std::fs::File;
use std::io::Read;
#[test]
fn calc_nearest_wire_crossing() {
let (wire1, wire2) = read_file("input.txt");
let wire1 = parse_string_to_wire(wire1);
let wire2 = parse_string_to_wire(wire2);
let mut positions1 = get_positions(wire1... |
use super::block_trait::DisplayNamed;
use super::BlockId;
use crate::arena::resource::ResourceId;
use crate::libs::color::Pallet;
use crate::libs::select_list::SelectList;
#[derive(Clone)]
pub struct CharacterTexture {
name: String,
texture_id: Option<ResourceId>,
height: f32,
}
#[derive(Clone)]
pub struc... |
//! Histogram type of plotting: point cloud, density or probability density function
//! (pdf) and cummulative density function (cdf).
//!
//! # Examples
//!
//! Quick plot.
//! ```no_run
//! use preexplorer::prelude::*;
//! pre::Density::new((0..10)).plot("my_identifier").unwrap();
//! ```
//!
//! Compare ``Density``s... |
use core::cell::UnsafeCell;
use core::intrinsics::{volatile_load, volatile_store};
pub struct VolatileCell<T>(UnsafeCell<T>);
impl<T> VolatileCell<T> {
pub unsafe fn get(&self) -> T where T: Copy {
volatile_load(self.0.get())
}
pub unsafe fn set(&self, v: T) {
volatile_store(self.0.get(), v)
}
}
|
pub mod ast;
pub mod semantics;
|
use super::Handle;
use futures_util::task::AtomicWaker;
use std::mem::ManuallyDrop;
use std::sync::atomic::{AtomicU8, AtomicUsize, Ordering};
use std::io;
use std::sync::Arc;
use std::task::{Context, Poll};
fumio_utils::mpsc! {
mod mpsc_task_list {
link TaskListLink;
head TaskListHead;
member next of InnerTask;... |
impl GPU {
pub fn dump_vram(&self) {
for k in 0..128 {
let tile = &self.vram[(k*128)..(k+1)*128];
for i in 0..8 {
for j in 0..4 {
let byte = tile[(i*8)+j];
let one = if (byte & 0x0F) > 0 { "█" } else { " " };
let two = if (byte >> 4) > 0 { "█" } else {... |
use std::env;
use std::error::Error;
use uuid::Uuid;
pub struct Config {
count: u8,
}
impl Config {
pub fn count(&self) -> &u8 {
&self.count
}
}
impl Config {
pub fn new(mut args: env::Args) -> Result<Self, Box<dyn Error>> {
args.next();
let count = match args.next() {
... |
extern crate crossterm;
use std::io::{stdout, Write};
use soldier::Soldier;
use utilities::Position;
use self::crossterm::{
execute,
style,
Clear,
ClearType,
Color,
Goto,
PrintStyledFont,
Show
};
pub fn init_ui() {
execute!(
stdout(),
Clear(ClearType::All),
Goto(0, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.