text stringlengths 8 4.13M |
|---|
pub fn connect(){
println!("network::connect()");
}
// 在这里添加 mod server;,并将下面的内容移入server.rs是不行的。
// lib.rs中添加类似代码与其它文件是不同的。
// mod server {
// fn connect(){
// println!("network::server::connect");
// }
// }
pub mod server;
|
#![cfg_attr(feature = "dev", allow(unstable_features))]
#![cfg_attr(feature = "dev", feature(plugin))]
#![cfg_attr(feature = "dev", plugin(clippy))]
extern crate bgjk;
extern crate isatty;
extern crate rand;
extern crate sfml;
#[macro_use (o, slog_log, slog_trace, slog_debug, slog_info, slog_warn, slog_error)]
extern c... |
use std::collections::{BTreeMap, HashMap, HashSet};
use std::str::FromStr;
use html5ever::{LocalName, Namespace, QualName};
use kuchiki::{
iter::{Descendants, Elements, Select},
traits::*,
NodeData, NodeRef,
};
use log::info;
use url::Url;
use crate::errors::{ErrorKind, PaperoniError};
const DEFAULT_CHAR... |
use request::request;
use parse;
use typeinfo::{ Type, TypeInfo };
/// Break up search string into several parts and join results.
pub fn multi_search(string: &str, base: &str) -> Vec<TypeInfo> {
let parts = parse::string_lit_comma_split(string);
let mut res = Vec::new();
for part in parts.iter() {
... |
// Copyright (c) 2021 Kim J. Nordmo and WormieCorp.
// Licensed under the MIT license. See LICENSE.txt file in the project
#![cfg_attr(docsrs, doc(cfg(any(feature = "powershell"))))]
use std::fmt::Debug;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use lazy_static::lazy_static;
use log::{debug... |
pub fn factors(n: u64) -> Vec<u64> {
let mut primes: Vec<u64> = Vec::new();
let mut prime_factors: Vec<u64> = Vec::new();
let mut i = 2;
let mut working_n = n;
while i <= working_n {
if i > (working_n as f64).sqrt() as u64 || is_prime(i, &primes) {
primes.push(i);
w... |
#![no_std]
#![no_main]
mod crt;
mod panic;
fn main() {
loop {}
}
|
#![cfg(feature = "rusoto_core")]
use crate::dns::Resolver;
use futures01::{
future::{Future, FutureResult},
Poll,
};
use hyper::client::connect::HttpConnector;
use hyper_openssl::{
openssl::ssl::{SslConnector, SslMethod},
HttpsConnector,
};
use rusoto_core::{CredentialsError, HttpClient, Region};
use ru... |
// Copyright (c) 2021 RBB S.r.l
// opensource@mintlayer.org
// SPDX-License-Identifier: MIT
// Licensed under the MIT License;
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://spdx.org/licenses/MIT
//
// Unless required by applicable law or agr... |
mod components;
mod resources;
use bevy::{prelude::*, sprite::collide_aabb::collide};
use components::*;
use resources::*;
macro_rules! load_assets {
($asset_server:expr, $materials:expr, $($path:expr),+) => {
{
let mut assets = Vec::new();
$(
assets.push(
... |
#![cfg_attr(
feature = "unstable",
feature(
maybe_uninit_uninit_array,
maybe_uninit_extra,
maybe_uninit_array_assume_init
)
)]
//! Collection types that takes the maximum, the summation and more from iterators.
//!
//! Every collection type in the crate implements [`FromIterator`](c... |
use crate::prelude::*;
use log::warn;
use sdl2::{
controller::{Axis as SdlAxis, Button as SdlButton},
event::{Event as SdlEvent, WindowEvent as SdlWindowEvent},
joystick::HatState as SdlHatState,
keyboard::{Keycode as SdlKeycode, Mod as SdlMod},
mouse::MouseButton as SdlMouseButton,
};
#[doc(hidden... |
//
//! Copyright 2020 Alibaba Group Holding Limited.
//!
//! 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 ... |
extern crate mediawiki_dump_parser;
use mediawiki_dump_parser::Parser;
use std::io;
fn main() {
let stdin = io::stdin();
let parser = Parser::new(stdin);
for e in parser {
println!("{}", e.title);
}
}
|
pub mod authority_keys;
#[cfg_attr(rustfmt, rustfmt_skip)]
pub mod cast_channel;
#[cfg_attr(rustfmt, rustfmt_skip)]
pub mod logging;
pub mod proxies;
|
// Copyright 2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
//! IOTA node MQTT API
mod error;
pub mod types;
use std::{
sync::{Arc, RwLock as StdRwLock},
time::Instant,
};
use crypto::utils;
use iota_types::block::{
payload::{milestone::ReceiptMilestoneOption, MilestonePayload},
Block,
};... |
pub fn is_toeplitz_matrix(matrix: Vec<Vec<i32>>) -> bool {
let row = matrix.len();
let column = matrix[0].len();
for i in 0..row {
if i == 0 {
for j in 0..column {
let mut di = i;
let mut dj = j;
loop {
let next_i = di ... |
#![feature(str_split_once)]
use std::convert::TryInto;
#[allow(unused_imports)]
use shared::prelude::*;
const INPUT: &'static str = include_str!("./input.txt");
type Solution = u128;
type Grid = [[bool; 10]; 10];
#[derive(Debug, Clone, Copy, Default, PartialEq)]
struct Tile {
id: u128,
grid: Grid,
}
impl T... |
//------------------------------------------------------------------------------
// Mutable References
//------------------------------------------------------------------------------
fn multiple_immutable_references() {
let mut s = String::from("hello");
let r1 = &mut s; // r1 reference’s scope start
// ... |
use std::collections::HashMap;
use std::collections::HashSet;
use crate::descriptor::FileDescriptorProto;
use crate::reflect::FileDescriptor;
pub(crate) struct FdsBuilder {
names: Vec<String>,
unprocessed: HashMap<String, FileDescriptorProto>,
processed: HashMap<String, FileDescriptor>,
}
impl FdsBuilder... |
use config::{ConfigError, Config, File, Environment};
use serde;
use serde::de::Deserializer;
use serde::Deserialize;
pub trait DeserializeWith: Sized {
fn deserialize_with<'de, D>(de: D) -> Result<Self, D::Error>
where D: Deserializer<'de>;
}
#[derive(Debug, Deserialize, Clone)]
pub enum ServerMode {
... |
use crate::tasks::{
AccumulatorCollector, BlockAccumulatorSyncTask, BlockCollector, BlockConnectedEventHandle,
BlockFetcher, BlockIdFetcher, BlockSyncTask, PeerOperator,
};
use anyhow::format_err;
use network_api::PeerProvider;
use starcoin_accumulator::node::AccumulatorStoreType;
use starcoin_chain::BlockChain... |
use std::collections::HashMap;
fn main(){
enum UTERM {
INT{value: u32},
VAR{value:String},
BOOL{value:bool},
OP1{op:String, arg1:Box<UTERM>, arg2:Box<UTERM>},
OP2{op: String, arg1:Box<UTERM>, arg2:Box<UTERM>},
ABS{v:Box<UTERM>,body:Box<UTERM>},
APP{t1:Box<UTERM>,t2:Box<UTERM>},
}
enum TTER... |
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use] extern crate rocket;
#[macro_use] extern crate serde_derive;
use rocket::http::RawStr;
use rocket_contrib::json::Json;
#[get("/hello")]
fn index() -> String {
String::from("Hello, world!")
}
#[get("/hello/<name>")]
fn hello(name: &RawStr) -> String {
... |
use crate::bot::trading::{TradingEvent, Tick};
use std::sync::Arc;
use tokio::sync::{Notify};
use crate::crypto::orderbook::{OrderBook, OrderSide, OrderType};
use crate::CONFIG as Config;
use crate::utils::{count_transactions_for_pair, get_transactions_for_pair};
use crate::database::TransactionStage;
use parking_lot::... |
use crate::JsonV;
use calamine::{DataType, Reader, Sheets};
use wasm_bindgen::JsValue;
/// sheets: excel对象
/// title_row: 标题在多少行
/// rows_excluded: 数据排除多少行
pub fn run(
mut sheets: Sheets,
title_row: Vec<usize>,
rows_excluded: Vec<usize>,
excluded_keyword: String,
) -> Result<JsValue, JsValue> {
let... |
//! # The Three Little Pigs
//!
//! Failed, time limit exceeded
//!
//! - https://codeforces.com/problemset/problem/1548/C
//! - https://alphacode.deepmind.com/#problem=5
use std::io::{self, prelude::*};
const MOD: usize = 1_000_000_000 + 7;
const N: usize = 1_000_000;
struct Combinator {
m: usize,
facts: Ve... |
use std::time::Duration;
use boolinator::Boolinator;
use hex::encode as hex_encode;
use reqwest::header::{HeaderMap, HeaderName, HeaderValue, CONTENT_TYPE, USER_AGENT};
use reqwest::Response;
use reqwest::StatusCode;
use ring::hmac;
use serde::de;
use serde::de::DeserializeOwned;
use crate::errors::error_messages;
us... |
//! An SPSC broadcast channel.
//!
//! - The value can only be a `usize`.
//! - The consumer is only notified if the value is different.
//! - The value `0` is reserved for closed.
use futures_util::task::AtomicWaker;
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
};
use std::task;
type Value = usize;... |
pub fn func1() {}
pub fn func2() {}
pub fn func3() {}
fn priv_func1() {}
fn priv_func2() {}
|
mod common;
// only used with WS
#[cfg(feature = "ws")]
macro_rules! if_wasm {
($($item:item)*) => {$(
#[cfg(target_arch = "wasm32")]
$item
)*}
}
macro_rules! if_not_wasm {
($($item:item)*) => {$(
#[cfg(not(target_arch = "wasm32"))]
$item
)*}
}
if_not_wasm! {
#[cfg... |
use clap::{Arg, App};
use colored::*;
use std::str::FromStr;
use std::convert::TryInto;
use bip39::{Mnemonic, Language};
use bitcoin::secp256k1::Secp256k1;
use bitcoin::util::bip32::{ExtendedPrivKey, ExtendedPubKey, DerivationPath, ChildNumber};
use bitcoin::network::constants::Network;
use bitcoin::util::address::Ad... |
use std::sync::Arc;
use async_trait::async_trait;
use cubeclient::models::{
V1CubeMeta, V1CubeMetaDimension, V1CubeMetaJoin, V1CubeMetaMeasure, V1CubeMetaSegment,
V1LoadRequestQuery, V1LoadResponse,
};
use datafusion::arrow::datatypes::SchemaRef;
use crate::{
compile::engine::df::scan::MemberField,
sq... |
struct Solution {}
impl Solution {
pub fn single_number(nums: Vec<i32>) -> i32 {
nums.iter().fold(0, |acc, v| acc ^ v)
}
}
fn main() {
let a = vec![2, 2, 1];
let b = vec![4, 1, 2, 1, 2];
println!("{}", Solution::single_number(a));
println!("{}", Solution::single_number(b));
}
|
use std::time::{Duration, Instant};
use actix::prelude::*;
use log::{debug};
use tokio_timer::Delay;
use crate::{
AppData, AppError,
common::DependencyAddr,
config::SnapshotPolicy,
messages::{AppendEntriesRequest, EntryType},
network::RaftNetwork,
replication::{ReplicationStream, RSRateUpdate,... |
use core::fmt::Display ;
#[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone, Debug)]
pub struct Port(u16);
impl Port {
pub const fn new(number: u16) -> Port {
Port(number)
}
pub fn in8(self) -> u8 {
unsafe { ::cpu::in8(self.0) }
}
pub fn out8(self, num: u8) {
unsafe { ::cpu::out8(self.0, nu... |
pub mod splitview;
pub mod tabs;
pub mod toasts;
pub mod multiline_alert;
pub mod oneline_alert;
pub mod index;
pub mod buttons;
pub mod form;
pub mod listing;
pub mod dialogs; |
struct Solution;
use std::collections::HashMap;
impl Solution {
fn longest_wpi(hours: Vec<i32>) -> i32 {
let n = hours.len();
let mut hm: HashMap<i32, usize> = HashMap::new();
let mut score = 0;
let mut res = 0;
for i in 0..n {
score += if hours[i] > 8 { 1 } else... |
#![allow(unused_imports)]
use tracing::{error, info, warn, debug, trace};
use async_trait::async_trait;
#[cfg(feature = "enable_local_fs")]
use std::{collections::VecDeque};
use tokio::io::Result;
use tokio::io::Error;
use tokio::io::ErrorKind;
use std::pin::Pin;
use crate::crypto::*;
#[cfg(feature = "enable_local_fs"... |
// Copyright 2020 WHTCORPS INC. Licensed under Apache-2.0.
use std::sync::mpsc::channel;
use std::sync::Arc;
use std::time::Duration;
use std::{fs, thread};
use ekvproto::meta_timeshare;
use ekvproto::fidel_timeshare;
use ekvproto::violetabft_cmd_timeshare::*;
use ekvproto::violetabft_server_timeshare::VioletaBftMess... |
use crate::{
dds::qos::{
QosPolicies, policy::Deadline, policy::DestinationOrder, policy::Durability, policy::History,
policy::LatencyBudget, policy::Lifespan, policy::Liveliness, policy::Ownership,
policy::Reliability,
},
structure::duration::Duration,
};
pub struct ROSDiscoveryTopic {}
impl ROSDis... |
//! Code for validating the various types of [`Link`].
mod cache;
mod context;
mod filesystem;
mod web;
pub use cache::{Cache, CacheEntry};
pub use context::{BasicContext, Context};
pub use filesystem::{check_filesystem, resolve_link, Options};
#[allow(deprecated)]
pub use web::get;
pub use web::{check_web, head};
u... |
use crate::data_structures::tree::treebuilder::TreeBuilder;
use either::*;
use crate::data_structures::tree::Tree;
use crate::data_structures::tree::traversal::{Traversal, TraversalDirection};
use crate::data_structures::tree::operations::Combinatorics;
use crate::data_structures::tree::operations::Operations;
struct ... |
use super::*;
use super::super::*;
use crate::drawing::PainterRef;
use crate::score::RendererState;
use std::convert::{TryInto, TryFrom};
use std::any::Any;
macro_rules! count {
() => (0usize);
( $x:tt $($xs:tt)* ) => (1usize + count!($($xs)*));
}
macro_rules! conv_elem_ref {
{ enum ElementRef { $($Variant:id... |
#![cfg_attr(not(feature = "std"), no_std)]
mod macros;
#[cfg(feature = "std")]
mod serde;
pub use self::macros::*;
#[cfg(feature = "std")]
pub use self::serde::{serde_hex, serde_text};
use frame_support::dispatch::{DispatchError, DispatchResult};
/// Although xss is imperceptible on-chain, we merely want to make it... |
extern crate poopbot;
use poopbot::PoopBot;
fn main() {
PoopBot::new()
.connect();
}
|
use std::{result, error, fmt};
use std::convert::From;
#[derive(Debug)]
pub struct PlatformError(&'static str);
#[derive(Debug)]
pub struct InitError(&'static str);
#[derive(Debug)]
pub enum AtlasError {
Platform(PlatformError),
Init(InitError),
}
pub type Result<T> = result::Result<T, AtlasError>;
impl Pl... |
fn main() {
let x = 5;
println!( "x is : {}", x );
// print : x is : 5
x = 6;
println!( "x is : {}", x );
// print : x is : 6
}
|
struct Solution;
trait MyClamp {
fn my_clamp(self, min: i32, max: i32) -> i32;
}
impl MyClamp for i32 {
fn my_clamp(self, min: i32, max: i32) -> i32 {
self.max(min).min(max)
}
}
impl Solution {
fn check_overlap(
radius: i32,
x_center: i32,
y_center: i32,
x1: i3... |
#[doc = "Register `CTESTATUS` reader"]
pub struct R(crate::R<CTESTATUS_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CTESTATUS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CTESTATUS_SPEC>> for R {
#[inline(always)]
fn from(read... |
/*
* Isilon SDK
*
* Isilon SDK - Language bindings for the OneFS API
*
* OpenAPI spec version: 5
* Contact: sdk@isilon.com
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
use std::borrow::Borrow;
use std::collections::HashMap;
use std::rc::Rc;
use futures;
use futures::Future;
use hyper;... |
//! # WMI-rs
//!
//! [WMI] is a management API for Windows-based operating systems.
//! This crate provides a high level Rust API focused around data retrieval (vs. making changes to
//! the system and watching for event which are also supported by WMI).
//!
//! This crate also uses `serde` to transform pointers to WMI... |
#![doc(html_logo_url = "http://test.fractal.global/img/logo.svg",
html_favicon_url = "http://test.fractal.global/img/favicon32.png",
html_root_url = "http://fractal.global/api-rs/")]
//! Fractal Global Credits API.
//!
//! This library provides methods to access the Fractal Global Credits in Rust. The mai... |
rust_proc_macro::ensure_proc_macro_data_exists!();
pub use rust_proc_macro::ensure_proc_macro_data_exists;
|
extern crate time;
use std::fs::File;
use std::io::Read;
use std::iter::FromIterator;
use time::now;
fn generate_programs(to_char: char) -> Vec<char> {
(('a' as u8)..(to_char as u8) + 1)
.map(|c| c as char)
.collect::<Vec<_>>()
}
fn get_input() -> String {
let mut input = String::new();
F... |
#![feature(slice_patterns)]
use std::io::BufRead;
struct Generator {
value: u64,
factor: u64,
}
impl Generator {
fn new(seed: u64, factor: u64) -> Generator {
Generator {
value: seed,
factor: factor,
}
}
}
impl Iterator for Generator {
type Item = u64;
... |
use std::cmp::*;
use std::collections::*;
use std::io::*;
use std::str::*;
// scanner from https://codeforces.com/contest/1396/submission/91365784
struct Scanner {
stdin: Stdin,
buffer: VecDeque<String>,
}
#[allow(dead_code)]
impl Scanner {
fn new() -> Self {
Scanner {
stdin: stdin(),
... |
// 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 http://mozilla.org/MPL/2.0/
//! This crate provides an easy way to define `huus` data structures using macros.
#![warn(missing_docs)]
#![feature(pro... |
fn main() {
let mut scan = Scanner::default();
let n: u64 = scan.item();
let mut a: Vec<u64> = scan.vec(n as usize);
a.sort();
println!("{}", mindist(a));
}
fn mindist(a: Vec<u64>) -> u64 {
let mut c: u64 = 1;
let mut min_d: u64 = a.iter().map(|n| n - 1).sum::<u64>();
while {
c... |
#[derive(Debug, PartialEq, Clone)]
pub enum Token {
LParen,
RParen,
Plus,
Minus,
Multiply,
Divide,
Identifier(String),
Integer(i32),
StringLiteral(String),
}
struct Interpreter {
tokens: Vec<Token>,
pos: usize
}
impl Interpreter {
fn new(tokens: Vec<Token>) -> Self {
... |
// Generated using scripts/make_static.py. Do NOT edit directly!
use router::Router;
use hyper::header;
use iron::prelude::*;
use iron::modifiers::Header;
use iron::status;
pub fn get_static_handler() -> Router {
let mut r = Router::new();
r.get("/app.css", (|_: &mut Request|
Ok(Response::with((
... |
//! A minimal Hardware Abstraction Layer (HAL) for embedded systems
//!
//! **NOTE** The HAL is in design phase. Expect the API to change in non
//! backward compatible ways without previous notice.
//!
//! # Design goals
//!
//! The HAL
//!
//! - Must *erase* device specific details. Neither register, register blocks ... |
#![allow(unused)]
fn main() {
copy_type();
non_copy_type();
}
#[derive(Copy, Clone)]
struct CopyType {
data: i32,
}
fn copy_type() {
// Ownership rules are similar to a basic Copy type, say, i32
let the_tuple = (
CopyType { data: 1 },
CopyType { data: 2 },
);
// Elements... |
//! Unreal Engine 4 crash context information
#![warn(missing_docs)]
use elementtree::{Element, QName};
use std::collections::BTreeMap;
#[cfg(test)]
use similar_asserts::assert_eq;
use crate::error::Unreal4Error;
/// RuntimeProperties context element.
///
/// [Source](https://github.com/EpicGames/UnrealEngine/blob... |
use std::collections::HashSet;
use aocinput::request;
#[derive(Debug)]
struct Instruction {
kind: String,
val: isize,
}
impl Instruction {
fn from_string(s: &str) -> Instruction {
let pair: Vec<&str> = s.split_ascii_whitespace().collect();
let kind = pair[0].to_owned();
let val = ... |
use serde::Serialize;
#[derive(Serialize)]
pub struct ProductId {
product_id: i32,
}
impl ProductId {
pub fn new(id: i32) -> Self {
ProductId { product_id: id }
}
pub fn get_id(&self) -> i32 {
self.product_id
}
}
|
use event::Event;
use std::sync::mpsc::Sender;
// Check the command and if there is an action
pub fn check_command (cmd: String, tx: &Sender<Event>) {
let mut cmd_split = cmd.split_whitespace();
match cmd_split.next().unwrap() {
"/quit" => {
tx.send(Event::Quit).unwrap();
},
"/q" => {
tx... |
/// Simple modulo hasher
///
/// This is the most simple hashing function one could fathom.
/// It does not calculate modulo a big prime but only modulo the maximum
pub struct ModHash;
impl Hasher<u32> for ModHash {
fn hash(val: &u32, max: usize) -> usize {
*val as usize % max
}
}
/// Theoretically nic... |
use crate::rpc_request;
use solana_sdk::{signature::SignerError, transaction::TransactionError};
use std::{fmt, io};
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ClientError {
Io(#[from] io::Error),
Reqwest(#[from] reqwest::Error),
RpcError(#[from] rpc_request::RpcError),
SerdeJson(#[from] se... |
use super::*;
/// A toplevel integer
#[derive(Clone, Debug)]
pub struct IntegerDef {
pub name: Spanned<String>,
pub doc: Option<String>,
pub variables: Vec<VarDef>,
pub code: String, // varmap, type_check_code
}
impl IntegerDef {
pub fn type_check(&self) -> Result<(), TypeError> {
Ok(())
... |
use rand::prelude::*;
pub trait NextRandValue
where
Self: Sized, {
fn next_i64(&self) -> (i64, Self);
fn next_u64(&self) -> (u64, Self) {
let (i, r) = self.next_i64();
(if i < 0 { -(i + 1) as u64 } else { i as u64 }, r)
}
fn next_i32(&self) -> (i32, Self);
fn next_u32(&self) -> (u32, Self) {
... |
use nalgebra::Vector3;
/// Second order polynomial, x(t) paper equation `(1)`.
pub fn second_order(
t: Vector3<f32>,
initial_pos: Vector3<f32>,
initial_vel: Vector3<f32>,
accel: Vector3<f32>,
) -> Vector3<f32> {
initial_pos + initial_vel.component_mul(&t) + 0.5 * accel.component_mul(&t.component_mu... |
use crate::entity::Entity;
use crate::layout::{Align, Justify};
use crate::style::Color;
#[derive(Debug, Clone)]
pub struct Text {
pub text: String,
pub font: String,
pub font_size: f32,
pub font_color: Color,
pub indent: f32,
}
impl Default for Text {
fn default() -> Self {
Text {
... |
use serde_derive::{Deserialize, Serialize};
use std::time::Duration;
/// This event informs of the completion of a tick in the [`UniverseGroup`].
///
/// [`UniverseGroup`]: crate::universe_group::UniverseGroup
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct TickProcessedEvent {
#[serde(rename = "process... |
// Copyright 2020 Conflux Foundation. All rights reserved.
// Conflux is free software and distributed under GNU General Public License.
// See http://www.gnu.org/licenses/
use cfx_types::Address;
use std::str::FromStr;
lazy_static! {
pub static ref ADMIN_CONTROL_CONTRACT_ADDRESS: Address =
Address::from_... |
//! This crate contains Rust bindings to [Xenon]. Xenon is a middleware that provides a uniform
//! interface to various software systems that are used in the area of scientific and high-performance
//! computing. These bindings are based on [gRPC] and require a [Xenon gRPC server] to attach to.
//! Consistency is main... |
use b::hello;
use proc_macro::{Literal, TokenStream, TokenTree};
#[proc_macro]
pub fn greet(_item: TokenStream) -> TokenStream {
TokenTree::Literal(Literal::string(hello())).into()
}
|
pub mod native_update;
pub mod resolved; |
pub mod core;
pub mod app;
fn main() {
let router = core::router::Router::new();
let server = core::server::WebServer::new(&router);
server.serve();
}
|
struct PredPrediction
{
}
pub struct DFAState
{
} |
// Copyright 2022 The Jujutsu 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 agreed t... |
extern crate amethyst_config;
extern crate amethyst_core;
#[macro_use]
extern crate derivative;
extern crate fnv;
#[macro_use]
extern crate serde;
extern crate smallvec;
extern crate winit;
#[cfg(feature = "sdl_controller")]
extern crate sdl2;
#[cfg(feature = "profiler")]
extern crate thread_profiler;
pub use self::... |
use std::time::Duration;
use alacritty_config_derive::ConfigDeserialize;
#[derive(ConfigDeserialize, Default, Clone, Debug, PartialEq, Eq)]
pub struct Mouse {
pub double_click: ClickHandler,
pub triple_click: ClickHandler,
pub hide_when_typing: bool,
#[config(deprecated = "use `hints` section instead"... |
// SPDX-License-Identifier: MIT OR Apache-2.0
use std::path::Path;
use std::fs;
use std::env;
fn languages() {
println!("cargo:rerun-if-changed=build.rs");
let mut languages = vec![];
let mut out = vec![];
for entry in walkdir::WalkDir::new("./languages")
.into_iter()
.filter_map(|me| ... |
use std::{collections::HashMap, time::Instant};
use acteur::{Listen, Serve, Service, ServiceAssistant, ServiceConfiguration};
use futures::lock::Mutex;
use reqwest::blocking::Client;
use crate::{
actor::{
messages::{GetAppState, SearchProfileId, SendChatMessage},
AppState,
},
service::Just... |
#![doc(html_no_source)]
//! # Ossuary
//!
//! Ossuary is a Rust library for establishing an encrypted and
//! authenticated communication channel between a client and a server.
//!
//! It establishes a 1-to-1 client/server communication channel that requires
//! reliable, in-order packet delivery, such as provided by T... |
#[allow(unused_imports)]
use serde_json::Value;
#[derive(Debug, Serialize, Deserialize)]
pub struct HttpSettings {
/// This is schema that contains HTTP protocol properties.
#[serde(rename = "settings")]
pub settings: Option <crate::models::HttpSettingsSettings>,
}
|
use std::slice;
/// Represents a vector, that can be passed to C land.
/// Has to be deallocated using [rpgp_cvec_drop], otherwise leaks memory.
#[repr(C)]
#[derive(Debug)]
pub struct cvec {
data: *mut u8,
len: libc::size_t,
}
impl PartialEq for cvec {
fn eq(&self, other: &cvec) -> bool {
if self.... |
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::collections::HashMap;
use std::io::Write;
use super::{KeyValue};
use super::common::merge_name;
use super::serde_json;
use super::service_proto::service_grpc::{MapReduceClient};
use super::service_proto::service::{ShutdownRequest};
use file_uti... |
pub fn get_included_str() -> &'static str {
include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/include/included_file.rs.inc"
))
}
|
// Copyright (c) 2015, The Radare Project. All rights reserved.
// See the COPYING file at the top-level directory of this distribution.
// Licensed under the BSD 3-Clause License:
// <http://opensource.org/licenses/BSD-3-Clause>
// This file may not be copied, modified, or distributed
// except according to those term... |
use ark_groth16::constraints::VerifyingKeyVar;
use ark_mnt6_753::{constraints::PairingVar, Fq as MNT6Fq, MNT6_753};
use ark_r1cs_std::{alloc::AllocVar, uint8::UInt8};
use ark_relations::r1cs::{ConstraintSystemRef, SynthesisError};
use nimiq_pedersen_generators::DefaultWindow;
use nimiq_zkp_primitives::pedersen_paramete... |
#![feature(test)]
extern crate bip_metainfo;
extern crate test;
#[cfg(test)]
mod benches {
use bip_metainfo::{Metainfo, MetainfoBuilder, DirectAccessor};
use test::Bencher;
#[bench]
fn bench_build_multi_kb_metainfo(b: &mut Bencher) {
let file_content = vec![55u8; 10 * 1024 * 1024];
b... |
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct StaticGraphic {
pub name: &'static str,
}
|
use crate::types::{ClientConfig, ClientMessageConfig, ClientNodeConfig, NodeConfig};
use std::env;
use std::fs;
use toml;
mod sign;
mod types;
/// Basic config types
enum AppConfigType {
Node,
Client,
}
/// Generate config data by specific ty[e
fn generate_config_date(config_type: AppConfigType) -> String {
... |
mod account;
mod address;
mod create_creator_account;
mod deploy_genesis;
mod deploy_scripts;
mod deposit_ckb;
mod dump_tx;
mod generate_config;
mod get_balance;
pub mod godwoken_rpc;
mod hasher;
mod polyjuice;
mod prepare_scripts;
mod setup;
mod transfer;
mod update_cell;
mod utils;
mod withdraw;
use anyhow::Result;
... |
extern crate liu_takano_session_types;
use std::time::Duration;
use std::marker::PhantomData;
use liu_takano_session_types::*;
extern crate serde_derive;
extern crate serde;
use std::thread;
use std::time::Instant;
type Id = String;
type Atm = Choose<Offer<AtmDeposit, Offer<AtmWithdraw, End>>,End>;
type AtmDeposit =... |
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate diesel;
#[macro_use]
extern crate rocket;
#[macro_use]
extern crate rocket_contrib;
//
mod db;
mod form;
mod queries;
pub const IMAGES_PATH: &'static str = "./images";
#[database("sqlite")]
pub struct DbConnection(diesel::SqliteConnection);
im... |
// Copyright (c) Starcoin
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
use crate::execution_strategies::types::{Block, Executor, ExecutorResult};
use starcoin_vm_types::transaction::TransactionOutput;
use std::{collections::BTreeMap, error::Error, fmt};
#[derive(Debug)]
pub enum MultiResult<E: Error... |
use std::{thread,time};
use postoffice::collector;
use std::collections::HashMap;
pub mod disk;
pub mod collectify;
pub mod get;
mod actify;
pub mod list;
use collectify::FdbFile;
pub fn init(){
thread::spawn(move || {
loop{
match process_collector(){
Ok(name)=>{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.