This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] | |
extern crate nom; | |
use std::str; | |
use nom::{digit, recognize_float, space, line_ending, IResult}; | |
use nom::types::CompleteStr; | |
#[derive(Debug)] | |
struct FloatRecord { | |
timestamp: u64, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] | |
extern crate nom; | |
use nom::types::{CompleteByteSlice, CompleteStr}; | |
use nom::{digit, recognize_float, space, IResult}; | |
use std::str; | |
pub trait NomInput<'a, U: nom::AsChar>: | |
Clone | |
+ nom::Slice<std::ops::Range<usize>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$win_user = "ipc" | |
$linux_user = "ipc" | |
$package = "CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc" | |
$base_path = "C:\Users\" + $win_user + "\AppData\Local\Packages\" + $package + "\LocalState\rootfs" | |
$dirs = @("\bin", "\sbin", "\usr\bin", "\usr\sbin", "\home\" + $linux_user + "\.cargo\bin") | |
$dirs | ForEach { Add-MpPreference -ExclusionProcess ($base_path + $_ + "\*") } | |
Add-MpPreference -ExclusionPath $base_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c:\msys64\home\ipc\rust>rustup toolchain link latest-stage2 build\x86_64-pc-windows-gnu\stage2 | |
c:\msys64\home\ipc\rust>rustup default latest-stage2 | |
info: default toolchain set to 'latest-stage2' | |
c:\msys64\home\ipc\rust>rustup which rustc | |
C:\Users\ipc\.rustup\toolchains\latest-stage2\bin\rustc.exe | |
c:\msys64\home\ipc\rust>rustc -vV | |
rustc 1.29.0-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Message)] | |
struct Batch { | |
key: String, | |
messages: Vec<String> | |
} | |
struct RedisListTailer { | |
redis: Addr<Redis>, | |
key: String, | |
current_index: isize, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate actix_web; | |
extern crate slog_envlogger; | |
use actix_web::actix; | |
use actix_web::fs::NamedFile; | |
use actix_web::middleware; | |
use actix_web::HttpRequest; | |
use actix_web::Result; | |
use actix_web::{server, App}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate sxd_document; | |
extern crate sxd_xpath; | |
use std::error::Error; | |
use sxd_document::parser; | |
use sxd_xpath::evaluate_xpath; | |
use sxd_xpath::Value; | |
use sxd_document::dom::Document; | |
pub struct XmlFixDictionary<'a> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct GracefulTlsStream { | |
inner: Arc<Mutex<TlsStream<TcpStream, ClientSession>>>, | |
} | |
impl Write for GracefulTlsStream { | |
fn write(&mut self, buf: &[u8]) -> Result<usize, std::io::Error> { | |
let mut guard = self.inner.lock().unwrap(); | |
guard.write(buf) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![deny(warnings, rust_2018_idioms)] | |
use futures::Future; | |
use hyper::client::connect::{Destination, HttpConnector}; | |
use tower_grpc::Request; | |
use tower_hyper::{client, util}; | |
use tower_util::MakeService; | |
use std::error::Error; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// The request message containing the user's name. | |
#[derive(Clone, PartialEq, ::prost::Message)] | |
pub struct HelloRequest { | |
#[prost(string, tag="1")] | |
pub name: std::string::String, | |
} | |
/// The response message containing the greetings | |
#[derive(Clone, PartialEq, ::prost::Message)] | |
pub struct HelloReply { | |
#[prost(string, tag="1")] |
OlderNewer