Skip to content

Instantly share code, notes, and snippets.

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)
macro_rules! default_incomplete (
($i: expr, $submac:ident!( $($args:tt)* ), $default: expr) => {
match $submac($i, $($args)*) {
IResult::Incomplete(_) => IResult::Done($i, $default),
other => other
}
}
);
@Geal
Geal / Sozu Entity Contributor Assignment Agreement
Last active April 3, 2017 14:56
Sozu Entity Contributor Assignment Agreement
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
@Geal
Geal / Sozu Individual Contributor Assignment Agreement
Last active April 3, 2017 15:03
Sozu Individual Contributor Assignment Agreement
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
$ 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
trying to build:
named!(no_compiler,
do_parse!(
length: be_u8 >>
bytes: take!(length)
)
);
you would get the following error
#include <iostream>
#include <cassert>
#include <vector>
using namespace std;
class Service {
vector<string> menu;
unsigned int places;
unsigned int available_places;
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Service {
vector<string> menu;
vector<int> choices;
vector<string> plates;
$ 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
@Geal
Geal / css.rs
Created February 10, 2018 22:02
#[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,