text
stringlengths
8
4.13M
mod sql_test; use apllodb_server::test_support::test_setup; use sql_test::{SqlTest, Step, StepRes, Steps}; #[ctor::ctor] fn setup() { test_setup(); } #[async_std::test] async fn test_add_column() { SqlTest::default() .add_steps(Steps::CreateTablePeople) .add_step(Step::new("BEGIN", StepRes::O...
#![allow(dead_code, unused_variables)] use futures::Future; fn ma() { let x = foo1(); } async fn foo1() -> usize { 0 } fn foo2() -> impl Future<Output = usize> { async { 0 } }
use web_sys::{WebGl2RenderingContext, WebGlShader}; use super::api::{WebRenderAPI}; #[derive(Debug)] pub struct RenderBuilder { webgl_context: Option<WebGl2RenderingContext>, vert_shader: Option<WebGlShader>, frag_shader: Option<WebGlShader>, } impl RenderBuilder { pub fn new() -> Self { RenderBuilder { ...
use alloc::boxed::Box; use collections::{BTreeMap, String}; use core::cmp::{min, max}; use fs::{KScheme, Resource, ResourceSeek, VecResource}; use system::error::{Error, Result, ENOENT}; use system::syscall::{MODE_DIR, MODE_FILE, Stat}; #[path="../../build/initfs.gen"] pub mod gen; /// Init Filesystem resource pu...
use std::{collections::BTreeMap, fs::File, io::BufReader, path::PathBuf}; use assembly_xml::common::exact::{expect_attribute, expect_end, expect_start, expect_text}; use color_eyre::eyre::eyre; use quick_xml::{events::Event as XmlEvent, Reader as XmlReader}; use structopt::StructOpt; #[derive(StructOpt)] struct Optio...
//! Netherrack-specific reading I/O operations use io_operations::reader::Reader; extern crate varint; extern crate bit_utils; use self::bit_utils::BitInformation; pub trait NetherrackReader : Reader { /// Reads a UTF-8 string from the buffer #[allow(unused_variables)] //Only for error stuff fn read_ut...
#[doc = "Register `LPMCCR` reader"] pub type R = crate::R<LPMCCR_SPEC>; #[doc = "Register `LPMCCR` writer"] pub type W = crate::W<LPMCCR_SPEC>; #[doc = "Field `VLPSIZE` reader - VACT largest packet size"] pub type VLPSIZE_R = crate::FieldReader; #[doc = "Field `VLPSIZE` writer - VACT largest packet size"] pub type VLPS...
/*! Type-level ascii characters and bytes. This module is declared at the root so that error messages will print a shorter type. */ #![allow(non_snake_case, non_camel_case_types)] /* This is code used to generate the macro invocation. fn main() { let mut list=(0..=255u8) .map(|b|{ let c=b ...
use crate::ast_to_rustspec::{translate_base_typ, translate_expr_expects_exp, SpecialNames}; use crate::name_resolution::TopLevelContext; use crate::rustspec::*; use pretty::RcDoc; use proc_macro2; use rustc_ast::{ ast::{self, AttrVec, Attribute, Expr, ExprKind, Path, PathSegment, Ty}, node_id::NodeId, ptr::...
use ckb_error::{Error, ErrorKind}; use failure::Fail; #[derive(Fail, Debug, PartialEq, Eq, Clone)] pub enum ScriptError { /// The field code_hash in script is invalid #[fail(display = "InvalidCodeHash")] InvalidCodeHash, /// The script consumes too much cycles #[fail(display = "ExceededMaximumCycl...
#[doc = "Reader of register TRIM_LDO_3"] pub type R = crate::R<u32, super::TRIM_LDO_3>; #[doc = "Writer for register TRIM_LDO_3"] pub type W = crate::W<u32, super::TRIM_LDO_3>; #[doc = "Register TRIM_LDO_3 `reset()`'s with value 0x10"] impl crate::ResetValue for super::TRIM_LDO_3 { type Type = u32; #[inline(alw...
mod context; mod manager; use std::borrow::Cow; use std::collections::HashSet; use std::sync::Arc; use anyhow::Result; use crossbeam_channel::Sender; use once_cell::sync::Lazy; use parking_lot::Mutex; use crate::stdio_server::providers::builtin::on_session_create; use crate::stdio_server::{rpc::Call, types::Provider...
//! Defines the astronomical length standards as newtypes use core::{self, fmt}; use length::imperial::*; use length::metric::*; use composite::UnitName; /// A newtype that wraps around `f64` and provides convenience functions for unit-aware and type-safe manipulation. #[derive(Clone, Copy)] pub struct AU(pub f64);...
/* * RIDB API Additional Functions 0.1 * * The Recreation Information Database (RIDB) provides data resources to citizens, offering a single point of access to information about recreational opportunities nationwide. The RIDB represents an authoritative source of information and services for millions of visitors to...
#[doc = "Register `ETZPC_HWCFGR` reader"] pub type R = crate::R<ETZPC_HWCFGR_SPEC>; #[doc = "Field `NUM_TZMA` reader - NUM_TZMA"] pub type NUM_TZMA_R = crate::FieldReader; #[doc = "Field `NUM_PER_SEC` reader - NUM_PER_SEC"] pub type NUM_PER_SEC_R = crate::FieldReader; #[doc = "Field `NUM_AHB_SEC` reader - NUM_AHB_SEC"]...
//! Relocations-related types. use std::convert::TryInto; use crate::int::u24; use crate::int::Int; use crate::obj::Block; use crate::syn::operand::Symbol; /// An error occuring while relocating a symbol. #[derive(Debug)] pub enum RelocationError { /// Indicates that the symbol's address was not in the expected ba...
fn read<T: std::str::FromStr>() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec<T: std::str::FromStr>() -> Vec<T> { read::<String>() .split_whitespace() .map(|e| e.parse().ok().unwrap()) .collect() } fn cmb...
#[cfg(test)] mod cli { use std::process::Command; use assert_cmd::prelude::*; #[test] fn should_match_single_json_when_selector_is_prop() { let mut cmd = Command::main_binary().unwrap(); cmd.arg(".name"); let mut stdin_cmd = cmd.with_stdin(); let mut assert_cmd = stdin...
#[doc = "Reader of register PROC_CONFIG"] pub type R = crate::R<u32, super::PROC_CONFIG>; #[doc = "Writer for register PROC_CONFIG"] pub type W = crate::W<u32, super::PROC_CONFIG>; #[doc = "Register PROC_CONFIG `reset()`'s with value 0x1000_0000"] impl crate::ResetValue for super::PROC_CONFIG { type Type = u32; ...
// Copyright 2019-2020 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate 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 option) a...
extern crate slack; extern crate rustc_serialize; use self::rustc_serialize::json::Json; use reply; use gomi; fn pick_up_user_action(raw_json: &str) -> bool { //#test channel id -> C45M040DA //if raw_json.contains("\"channel\":\"C45M040DA\"") { //#random channel id -> C45SC46VC if raw_json.contains...
use ai::libc::c_char; use ai::internals::AtNode; use ai::string::string; use ai::node::Node; use ai::node_entry::AI_NODE_ALL; use std::marker::PhantomData; use std::ptr; use std::ffi::CString; #[derive(Debug)] pub struct Universe<'a> { phantom: PhantomData<&'a i32>, } pub fn universe_is_active() -> bool { un...
use embedded_hal::blocking::spi; use std::io::{Read, Write}; use std::sync::{Arc, Mutex}; use crate::io::{send_clear, send_spi_init, send_spi_write}; pub struct SPI<T> { ident: String, channel: Arc<Mutex<Box<T>>>, } impl<T> SPI<T> where T: Read + Write, { pub fn new( ident: String, sc...
#![no_std] #![feature(alloc)] #[macro_use] extern crate alloc; use alloc::vec::Vec; extern crate common; use common::bytesrepr::ToBytes; use common::contract_api::call_contract; use common::contract_api::pointers::ContractPointer; #[no_mangle] pub extern "C" fn call() { //This hash comes from blake2b256( [0;32] ...
// // zhttpto.rs // // Starting code for PS1 // Running on Rust 0.9 // // Note that this code has serious security risks! You should not run it // on any system with access to sensitive files. // // University of Virginia - cs4414 Spring 2014 // Weilin Xu and David Evans // Version 0.3 #[feature(globs)]; use std::i...
use wasm_bindgen::prelude::*; macro_rules! router { {$path:ident then _ => $default:expr} => {{ $default }}; {$path:ident then $pattern:tt $(($capture:ident))? => $html:expr, $($patterns:tt $(($captures:ident))? => $htmls:expr),+} => {{ let pattern = format!("^{}$", $pattern); let ...
use blocks::case::{Case, TypeCase}; use pancurses::Window; pub struct Map { list_items: Vec<Case>, } impl Map { pub fn new() -> Self { Map { list_items: Vec::new(), } } pub fn draw(&self, window: &Window) { window.clear(); window.draw_box('|', '-'); ...
use crate::engine::{ControlMap, Engine}; use crate::config; use std::sync::mpsc; use synthesizer_io_core::graph::{Message, Note}; pub struct NoteModule { voices: [Voices; config::CHANNEL_COUNT], //note_ch_tx : mpsc::Sender::<NoteEvent> } impl NoteModule { pub fn new() -> NoteModule { NoteModule {...
pub mod player; pub mod renderer; pub mod checks; pub mod game; pub mod coin; pub mod board; use crate::game::Game; fn main() { let mut game = Game::new_game(); game.start() }
#[doc = "Reader of register IFCR"] pub type R = crate::R<u32, super::IFCR>; #[doc = "Writer for register IFCR"] pub type W = crate::W<u32, super::IFCR>; #[doc = "Register IFCR `reset()`'s with value 0"] impl crate::ResetValue for super::IFCR { type Type = u32; #[inline(always)] fn reset_value() -> Self::Typ...
extern mod std; extern mod zmq; use std::io; use std::str; use std::task; fn new_server(socket: zmq::Socket) { let msg = socket.recv_str(0).unwrap(); io::println(format!("server received {}", msg)); let msg = format!("hello {}", msg); io::println(format!("server sending {}", msg)); match socket....
use colored::*; use nod::{NodError, Node, Progress, Result}; use pbr::{ProgressBar, Units}; struct CliProgress<'a> { pb: &'a mut ProgressBar<std::io::Stdout>, } impl<'a> CliProgress<'a> { pub fn new(pb: &'a mut ProgressBar<std::io::Stdout>) -> CliProgress<'a> { CliProgress { pb } } } impl<'a> Pr...
/* * Datadog API V1 Collection * * Collection of all Datadog Public endpoints. * * The version of the OpenAPI document: 1.0 * Contact: support@datadoghq.com * Generated by: https://openapi-generator.tech */ /// AwsAccountListResponse : List of enabled AWS accounts. #[derive(Clone, Debug, PartialEq, Serializ...
use std::io::Read; use crate::error::{TychoError, TychoResult}; use crate::ident::ValueIdent; use crate::read::func::{read_byte, read_bytes}; use crate::read::length::read_length; use crate::read::number::{read_number, read_number_ident}; use crate::read::string::{read_char, read_string}; use crate::{Value, Uuid}; p...
use super::Style; /// Specifies the format for outputing css. /// /// The format is the style (expanded or compressed) and the precision /// for numeric values. #[derive(Clone, Copy, Debug)] pub struct Format { pub style: Style, pub precision: usize, } impl Format { pub fn introspect() -> Self { l...
struct Person { name: String, birth: i32 } pub fn compose() { let mut composers = Vec::new(); composers.push(Person { name: "palestrina".to_string(), birth: 1525 }); composers.push(Person { name: "dowland".to_string(), birth: 1563 }); composers.pu...
use components::{Link, RelativeTime}; use eos::*; use prelude::*; use stdweb::web::document; use views::svg; pub struct ProfilePage { props: Props, polls: EosData<Vec<Poll>>, eos_agent: Box<Bridge<EosAgent>>, } #[derive(PartialEq, Clone, Default)] pub struct Props { pub context: Context, pub chain...
// https://beta.atcoder.jp/contests/abc003/tasks/abc003_3 macro_rules! scan { ($t:ty) => { { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().parse::<$t>().unwrap() } }; ($($t:ty),*) => { { ...
#[macro_use(lift)] extern crate carboxyl; extern crate conv; extern crate num; extern crate rustc_serialize; extern crate sdl2; extern crate sdl2_image; extern crate sdl2_ttf; extern crate snes_spc; extern crate time; use carboxyl::Sink; use sdl2::audio::AudioSpecDesired; use sdl2::event::Event; use sdl2::keyboard::Ke...
// Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 // Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 fn main() { let proto_files = [ "src/proto/channel_transaction.proto", "src/proto/message.proto", "src/proto/script_pac...
use syn::{self, Ident, Fields}; use overrides::Overrides; pub struct Variant { pub ident: Ident, pub name: String, } impl Variant { pub fn parse(raw: &syn::Variant) -> Result<Variant, String> { match raw.fields { Fields::Unit => {} _ => return Err("non-C-like enums are not...
//! Contains the `add...metric` functions that are used for gathering metrics. use crate::server::{Command, ControlChanError, ControlChanErrorKind, ControlChanMiddleware, ControlChanMsg, Event, Reply, ReplyCode}; use async_trait::async_trait; use lazy_static::*; use prometheus::{opts, register_int_counter, register_i...
#[doc = "Register `DAC_CR` reader"] pub type R = crate::R<DAC_CR_SPEC>; #[doc = "Register `DAC_CR` writer"] pub type W = crate::W<DAC_CR_SPEC>; #[doc = "Field `EN1` reader - DAC channel1 enable This bit is set and cleared by software to enable/disable DAC channel1."] pub type EN1_R = crate::BitReader; #[doc = "Field `E...
mod errors; // Uncertain if this one belongs here, but is useful in some of the // examples. pub mod bezier_util; mod color; mod growth_image; mod growth_image_builder; mod kd_tree; pub mod palettes; mod point_tracker; mod topology; pub use color::RGB; pub use errors::Error; pub use growth_image::SaveImageType; pub...
//! A deferred job queue. //! //! When you want to run some time-consuming work, please consider using this //! mechanism. use alloc::boxed::Box; use crossbeam::queue::SegQueue; use kerla_api::sync::SpinLock; pub trait JobCallback = FnOnce() + Send + 'static; static GLOBAL_QUEUE: SpinLock<SegQueue<Box<dyn JobCallback>...
pub mod post; pub mod s3;
use types; use card::Card; use calculator::utility; pub fn test(cards: Vec<Card>) -> Option<types::Combination> { if cards.len() < 5 { return None; } for suit in vec![ types::Suit::Clubs, types::Suit::Diamonds, types::Suit::Hearts, types::Suit::Spades, ] { if let Some(fl...
#![feature(proc_macro_hygiene, decl_macro)] #[macro_use] extern crate diesel; #[macro_use] extern crate rocket; #[macro_use] extern crate rocket_contrib; extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; pub mod models; pub mod routes; pub mod schema; use rocket_contrib::templates::...
use nix::sys::signal; use nix::sys::signal::SaFlags; use nix::sys::signal::{sigaction, SigAction, SigHandler, SigSet}; use super::process; extern "C" fn handle_signal(_signam: i32) { println!(); } impl process::Process { pub(crate) fn signal_action(&self) { let sa = SigAction::new( SigHandler::Handler(...
use std::{fs::read_to_string}; struct GrepArgs { pattern: String, path: String, } impl GrepArgs { fn new(path: String, pattern: String) -> GrepArgs { GrepArgs {path, pattern} } } fn grep(content: String, pattern: String) { for line in content.lines() { if line.contains(pattern.as_s...
use serde::{Deserialize, Serialize}; use std::ops::Add; #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Point { pub row: usize, pub column: usize, } impl Add<(usize, usize)> for Point { type Output = Point; fn add(self, rhs: (usize, usize)) -> Self::Output { Self { row:...
use paste::paste; #[cxx::bridge(namespace = "xtensor_rust::bridge")] mod ffi { // Unfortunately we could not automate this boilerplate with a macro extern "Rust" { type RsTensorU8; fn shape(&self) -> &[usize]; fn as_slice(&self) -> &[u8]; fn as_slice_mut(&mut self) -> &mut [u8]...
use super::*; use crate::track::Duration; #[test] fn test_valid() { let payload = std::include_str!("test.json"); let json = serde_json ::from_str::<Json>(payload) .expect("failed to parse json"); let expected = Json { audios: AudiosObject( Box::new( [ Entry { id: "371745443_456552853".in...
use std::marker::PhantomData; use crate::{IsBot, IsTop, LatticeFrom, LatticeOrd, Merge}; /// A `Point` lattice, corresponding to a single instance of `T`. /// /// Will runtime panic if a merge between inequal values is attempted. /// /// The `Provenance` generic param is a token for the origin of this point. The para...
use rbs::Value; use std::fmt::{Debug, Display, Formatter}; use std::str::FromStr; use crate::Error; use serde::Deserializer; #[derive(serde::Serialize, Clone, Eq, PartialEq, Hash)] #[serde(rename = "Json")] pub struct Json(pub String); impl<'de> serde::Deserialize<'de> for Json { fn deserialize<D>(deserializer: ...
//! Manages searches for ... //! //! ? `Coords` and `SigningPublicKey`s for nodes for which the IPv6 is known use crate::{dev::*, types::NodeID}; /// /// ?? Handle<StartSearch> pub trait SearchManager<C: Core>: Sized { // /// // type Router: <C as Core>::Router; /// Information about an ongoing search. ...
macro_rules! parse_name_from_captures{ ($captures:expr, $name:expr) => {$captures.name($name).unwrap().as_str().parse()?}; }
#[cfg(feature = "create")] mod create_direct; mod single_array; #[cfg(feature = "create")] pub(crate) use create_direct::*; pub(crate) use single_array::*; pub(crate) use std::path::PathBuf;
use proc_macro2::TokenTree; use syn::Macro; use syn::ItemUse; use syn::Visibility; use syn::ItemMod; use std::env; use std::fs::File; use std::io::{self, Read, Write}; use syn::Attribute; use syn::Signature; use syn::Binding; use syn::UseRename; use syn::{UsePath, UseTree}; use proc_macro2::Span; use syn::{Ident, Tok...
#[doc = "Register `CRYP_CSGCM6R` reader"] pub type R = crate::R<CRYP_CSGCM6R_SPEC>; #[doc = "Register `CRYP_CSGCM6R` writer"] pub type W = crate::W<CRYP_CSGCM6R_SPEC>; #[doc = "Field `CSGCM6` reader - CSGCM6"] pub type CSGCM6_R = crate::FieldReader<u32>; #[doc = "Field `CSGCM6` writer - CSGCM6"] pub type CSGCM6_W<'a, R...
use crate::actions::Actions; use crate::digger::{DiggerState, FuelUpgrade, WasteCollected}; use crate::loading::AudioAssets; use crate::GameState; use bevy::prelude::*; use bevy_kira_audio::{Audio, AudioChannel, AudioPlugin}; pub struct InternalAudioPlugin; impl Plugin for InternalAudioPlugin { fn build(&self, ap...
use chrono::{serde::ts_seconds, DateTime, Utc}; use serde_derive::{Deserialize, Serialize}; use sqlx::postgres::PgConnection; /////////////////////////////////////////////////////////////////////////////// #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Object { pub id: i64, pub scope: String, ...
mod contentdirectory; pub use self::contentdirectory::ContentDirectory; mod connectionmanager; pub use self::connectionmanager::ConnectionManager;
use super::prelude::*; use std::fmt::Write; #[derive(Debug, Clone, PartialEq)] pub struct If { pub cond: Box<Expr>, pub consequence: Block, pub alternative: Option<Block>, } impl Display for If { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { let mut out = format!("if {} {}", self.cond,...
use crate::game::{town::Town, Game}; use crate::gui::ui_state::ClockTick; use crate::init::quicksilver_integration::Signal; use crate::prelude::*; use crate::view::Frame; use quicksilver::graphics::Mesh; use quicksilver::prelude::Window; use specs::WorldExt; use std::marker::PhantomData; pub(crate) struct TownFrame<'a...
fn main() { let args = std::env::args(); if args.len() < 2 { panic!("Please provide a file"); } panic!(args.first()); let path = std::path::Path::new(&args[1]); let s = std::fs::File::open(&path).read_to_stirng().unwrap(); }
use std::{ ffi::OsString, fs::{File, OpenOptions}, io::Write, os::fd::AsRawFd, }; use input_linux::{ sys::{input_event, BUS_VIRTUAL}, AbsoluteAxis, AbsoluteEvent, AbsoluteInfo, AbsoluteInfoSetup, EventKind, EventTime, InputEvent, InputId, InputProperty, Key, KeyEvent, KeyState, SynchronizeE...
// Copyright 2021 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 binance_async::{ model::websocket::{BinanceWebsocketMessage, Subscription}, BinanceWebsocket, }; use sqlx::PgPool; use std::{error::Error, time::SystemTime}; use tokio::stream::StreamExt; #[tokio::main] async fn main() -> Result<(), Box<dyn Error>> { dotenv::dotenv().ok(); let mut socket = Binance...
#[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let params = vault_iam_auth::Parameters { iam_server_id: None, mount_path: String::from("aws"), role: String::from("my-role"), vault_address: String::from("https://vault.address.com:8200"), }; let response: serde_json::Val...
// This file is part of Substrate. // Copyright (C) 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 // // http://...
use aoc::read_data; use std::collections::HashMap; use std::error::Error; #[derive(Debug)] // loc, binary struct Mem(String, String); #[derive(Debug)] struct Section { mask: String, mem: Vec<Mem>, } impl Section { fn from_v(v: Vec<String>) -> Self { let mut mem = Vec::new(); for d in v.it...
use std::fmt; type Result<T> = std::result::Result<T, String>; #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub(crate) struct Location { offset: usize, } impl Location { pub(crate) fn new(offset: usize) -> Self { Self { offset } } } impl fmt::Display for Location { fn fmt(&self, f: &mut fmt:...
use postings::compression::{BlockDecoder, VIntDecoder, COMPRESSION_BLOCK_SIZE}; use DocId; use common::BitSet; use common::HasLen; use postings::compression::compressed_block_size; use docset::{DocSet, SkipResult}; use fst::Streamer; use postings::serializer::PostingsSerializer; use postings::FreqReadingOption; use pos...
#[doc = "Register `GPIOI_HWCFGR8` reader"] pub type R = crate::R<GPIOI_HWCFGR8_SPEC>; #[doc = "Field `AF_PRIO8` reader - AF_PRIO8"] pub type AF_PRIO8_R = crate::FieldReader; #[doc = "Field `AF_PRIO9` reader - AF_PRIO9"] pub type AF_PRIO9_R = crate::FieldReader; #[doc = "Field `AF_PRIO10` reader - AF_PRIO10"] pub type A...
use crate::queue::{ConcurrentQueue, PaddedUsize}; use a19_core::pow2::PowOf2; use std::cell::UnsafeCell; use std::mem::replace; use std::sync::atomic::{AtomicUsize, Ordering}; use std::thread; use std::vec::Vec; struct MpmcNode<T> { id: AtomicUsize, value: Option<T>, } pub struct MpmcQueueWrap<T> { queue:...
//! Transforms run once for each defined dotfile during the deploy process. //! //! They can either be specified for a whole profile, in which case each dotfile //! is transformed by them or they can be attached to a specific dotfile. //! //! The transformation takes place after the template resolving and takes the //!...
use arrow::{ array::{BooleanArray, Float64Array, Int64Array, StringArray}, record_batch::RecordBatch, }; use connectorx::{ destinations::arrow::ArrowDestination, prelude::*, sources::postgres::{rewrite_tls_args, BinaryProtocol, CSVProtocol, PostgresSource}, sources::PartitionParser, sql::CXQ...
use layouts::{RLayout}; pub struct RApplication { id: i32 } impl RApplication { pub fn new() -> RApplication { RApplication { id: 0 } } pub fn setLayout( &self, layout: &RLayout ) { } pub fn run( &self ) { } }
fn main() { println!("{}", "these\n\ are\n\ three lines"); }
use planpoker_common::RoomInfo; use planpoker_common::RoomMessage; use planpoker_common::RoomRequest; use planpoker_common::UserId; use planpoker_common::Vote; use yew::prelude::*; use yew_router::push_route; use crate::agents::RoomAgent; use crate::components::card::Card; use crate::components::loading::Loa...
pub struct HubResult {} impl HubResult { fn new() -> Self { HubResult {} } }
pub mod texture_loader; pub mod font_loader; pub mod obj_loader; pub mod math; pub mod image_m; /* pub struct Settings{ pub resolution: (u32, u32), pub vr: bool } impl Settings{ pub fn from_args() -> Settings{ let args: Vec<String> = env::args().collect(); let (mut res_x, mut res_y) = (1024...
// Code based on [https://github.com/defuz/sublimate/blob/master/src/core/syntax/scope.rs](https://github.com/defuz/sublimate/blob/master/src/core/syntax/scope.rs) // released under the MIT license by @defuz use bitflags::bitflags; use serde::{Deserialize, Serialize}; /// Foreground and background colors, with font st...
mod lexer; use lexer::{Lexer,Token}; fn main() { let mut l = Lexer::new(); l.process_string(String::from("a <- a + 2")); }
use crate::neatns::network::node; use std::collections::HashMap; pub struct InnovationLog { pub node_additions: HashMap<u64, InnovationTime>, pub edge_additions: HashMap<(node::NodeRef, node::NodeRef), u64>, } pub struct InnovationTime { pub node_number: u64, pub innovation_number: u64, } impl Innova...
extern crate reqwest; #[macro_use] extern crate serde_derive; #[macro_use] extern crate serde_json; use std::env; use reqwest::Client; use reqwest::Error; use std::time::Duration; use reqwest::ClientBuilder; fn main() -> Result<(), Error> { let _ = run1(); let _ = run(); Ok(()) } fn run1() -> Result<()...
use std::env; use std::process; use common::load_file; #[derive(Debug)] struct Header { num_children: usize, num_metadata: usize, } #[derive(Debug)] struct Node { header: Header, children: Vec<Box<Node>>, metadata: Vec<i32>, } fn parse(data: &Vec<i32>, pos: usize) -> (Node, usize) { let head...
use crate::error::{from_protobuf_error, NiaServerError, NiaServerResult}; use crate::protocol::Serializable; use protobuf::Message; #[derive(Clone, Debug, PartialEq, Eq)] pub struct ActionMouseButtonRelease { button_code: i32, } impl ActionMouseButtonRelease { pub fn new(button_code: i32) -> ActionMouseButton...
use std::collections::{HashMap, HashSet, VecDeque}; use std::fmt; use std::io::{self, Error, ErrorKind, Write}; use std::mem; use std::pin::Pin; use std::sync::{Arc, Mutex}; use std::thread; use std::time::Duration; use crate::asynk::connector::Connector; use crate::asynk::message::Message; use crate::asynk::proto::{s...
//! Provides traits for statistical computation pub use self::iter_statistics::*; pub use self::order_statistics::*; pub use self::slice_statistics::*; pub use self::statistics::*; pub use self::traits::*; mod iter_statistics; mod order_statistics; // TODO: fix later mod slice_statistics; mod statistics; mod traits;
/* * Free FFT and convolution (Rust) * * Copyright (c) 2020 Project Nayuki. (MIT License) * https://www.nayuki.io/page/free-small-fft-in-multiple-languages * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), t...
use crate::uses::*; use super::NLVec; #[derive(Debug)] struct MapNode<K, V> { key: K, value: V, } impl<K: Ord, V> MapNode<K, V> { fn new(key: K, value: V) -> Self { MapNode { key, value, } } fn heap(key: K, value: V) -> *mut Self { to_heap(Self::new(key, value)) } } #[derive(Debug)] pub struct N...
use rsb_derive::Builder; use crate::api::*; use crate::errors::*; use crate::{SlackClient, SlackClientHttpApi}; use crate::listener::{ErrorHandler, SlackClientEventsListener}; use futures::future::{BoxFuture, FutureExt}; use hyper::body::*; use hyper::{Method, Request, Response}; use log::*; use std::future::Future; ...
#![no_std] #![crate_type = "lib"] #![crate_name = "emlib"] #![allow(warnings)] #[macro_use] // emlib bindings pub mod acmp; pub mod adc; pub mod chip; pub mod cmu; pub mod dma; pub mod ebi; pub mod emu; pub mod gpio; pub mod i2c; pub mod irq; pub mod lesense; pub mod leuart; pub mod prs; pub mod rtc; pub mod timer; pu...
//! This crate provides various matcher algorithms for line oriented search given the query string. //! //! The matcher result consists of the score and the indices of matched items. //! //! There two steps to match a line: //! //! // RawLine //! // | //! // | MatchType: extract the content to match....
use std::str::FromStr; use std::{thread, time}; use chrono::Duration; use chrono::offset::Utc; use rand::distributions::Alphanumeric; use rand::{thread_rng, Rng}; use serenity::model::id::{UserId, GuildId}; use std::iter; use connectionpool::*; use util; static USAGE: &str = "Usage: `!remindme x scale`, where `x` is...
// Copyright 2016 The Fancy Regex Authors. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, p...
mod acquire_lease_response; pub use self::acquire_lease_response::AcquireLeaseResponse; mod break_lease_response; pub use self::break_lease_response::BreakLeaseResponse; mod get_acl_response; pub use self::get_acl_response::GetACLResponse; mod get_properties_response; pub use self::get_properties_response::GetPropertie...
use Default; use winapi::um::d3d12::{D3D12_GRAPHICS_PIPELINE_STATE_DESC, D3D12_SHADER_BYTECODE, D3D12_BLEND_DESC, D3D12_STREAM_OUTPUT_DESC, D3D12_RASTERIZER_DESC, D3D12_DEPTH_STENCIL_DESC, D3D12_DEPTH_STENCILOP_DESC, D3D12_INPUT_LAYOUT_DESC, D3D12_CACHED_PIPELINE_STATE, D3D12_RENDER_TARGET_BLEND_DESC, D3D12_COLOR_WRITE...