This file contains hidden or 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
Client.new(<some TCP or TLS stream>) | |
.connect() //will start the handshake of 7 or so messages, returns a future that resolves once the handshake is done | |
.and_then(|client| { | |
client.create_channel() // returns a future that resolves once the channel is created | |
.map(|channel| { | |
channel | |
.queue("queue_name") // returns a future that resolves once the queue is declared | |
.and_then(|queue| { | |
queue.publish(|queue| { | |
queue.send(message) |
This file contains hidden or 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_rules! default_incomplete ( | |
($i: expr, $submac:ident!( $($args:tt)* ), $default: expr) => { | |
match $submac($i, $($args)*) { | |
IResult::Incomplete(_) => IResult::Done($i, $default), | |
other => other | |
} | |
} | |
); |
This file contains hidden or 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
Sozu Entity Contributor Assignment Agreement | |
Thank you for your interest in contributing to Sozu, legally represented by Clever Cloud SAS ("We" or "Us"). | |
This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by electronic submission, following the instructions at . This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us. | |
1. Definitions | |
"You" means any Legal Entity on behalf of whom a Contribution has been received by Us. "Legal Entity" means an entity which is not a natural person. "Affiliates" means other Legal Entities that control, are controlled by, or under common control with that Legal Entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such Legal Entity, whether by contract or otherwise, (ii) ownership of fifty perc |
This file contains hidden or 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
Sozu Individual Contributor Assignment Agreement | |
Thank you for your interest in contributing to Sozu, legally represented by Clever Cloud SAS ("We" or "Us"). | |
This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by electronic submission, following the instructions at . This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us. | |
1. Definitions | |
"You" means the individual who Submits a Contribution to Us. | |
"Contribution" means any work of authorship that is Submitted by You to Us in which You own or assert ownership of the Copyright. If You do not own the Copyright in the entire work of authorship, please follow the instructions in . | |
"Copyright" means all rights protecting works of authorship owned or controlled by You, including copyright, moral and neighboring rights, as appropriate, for the full term of their |
This file contains hidden or 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
$ RUST_BACKTRACE=1 RUST_LOG=trace ./target/debug/examples/main | |
TRACE:mio::sys::unix::kqueue: registering; token=Token(18446744073709551615); interests=Ready {Readable} | |
TRACE:mio::poll: registering with poller | |
TRACE:mio::poll: registering with poller | |
DEBUG:tokio_core::reactor: adding a new I/O source | |
TRACE:mio::poll: registering with poller | |
TRACE:mio::sys::unix::kqueue: registering; token=Token(2); interests=Ready {Readable | Writable | Hup} | |
TRACE:sozu_command_futures: will send message: ConfigMessage { id: "message-id-42", version: 0, data: ListWorkers, proxy_id: None } | |
TRACE:sozu_command_futures: lock | |
TRACE:sozu_command_futures: calling start_send |
This file contains hidden or 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
trying to build: | |
named!(no_compiler, | |
do_parse!( | |
length: be_u8 >> | |
bytes: take!(length) | |
) | |
); | |
you would get the following error |
This file contains hidden or 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
#include <iostream> | |
#include <cassert> | |
#include <vector> | |
using namespace std; | |
class Service { | |
vector<string> menu; | |
unsigned int places; | |
unsigned int available_places; |
This file contains hidden or 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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
class Service { | |
vector<string> menu; | |
vector<int> choices; | |
vector<string> plates; |
This file contains hidden or 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
$ readelf -a hello.o | |
ELF Header: | |
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 | |
Class: ELF64 | |
Data: 2's complement, little endian | |
Version: 1 (current) | |
OS/ABI: UNIX - System V | |
ABI Version: 0 | |
Type: REL (Relocatable file) | |
Machine: Linux BPF |
This file contains hidden or 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::is_hex_digit; | |
#[derive(Debug,PartialEq)] | |
pub struct Color { | |
pub red: u8, | |
pub green: u8, | |
pub blue: u8, |