Skip to content

Instantly share code, notes, and snippets.

Nemo157 Nemo157

Block or report user

Report or block Nemo157

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Nemo157 / .gitignore
Last active Nov 18, 2019
hyper on async-std
View rustc.main-{{closure}}.-------.generator_resume.0.mir
// MIR for `main::{{closure}}`
// source = MirSource { def_id: DefId(0/1:9 ~ generators[317d]::main[0]::{{closure}}[0]), promoted: None }
// pass_name = generator_resume
// disambiguator = 0
// generator_layout = GeneratorLayout { fields: [LocalDecl { mutability: Not, is_user_variable: Some(Set(Var(VarBindingForm { binding_mode: BindByValue(MutImmutable), opt_ty_info: None, opt_match_place: Some((None, src/test/debuginfo/ 37:18)), pat_span: src/test/debuginfo/ 37:14 }))), internal: false, is_block_tail: None, ty: i32, user_ty: UserTypeProjections { contents: [] }, name: Some(d), source_info: SourceInfo { span: src/test/debuginfo/ 37:14, scope: scope[2] }, visibility_scope: scope[1] }] }
fn main::{{closure}}(_1: std::pin::Pin<&mut [generator@src/test/debuginfo/ 41:6 a:&mut i32 {i32, ()}]>) -> std::ops::GeneratorState<(), ()>{
let mut _0: std::ops::GeneratorState<(), ()>; // return place
scope 1 {
trait App<Input>
Input: { request: http::Request }
type Output: Into<http::Response>;
fn call(self, input: Input) -> Self::Output;
struct AuthApp<T> {
View Cargo.toml
name = "foo"
version = "0.1.0"
authors = ["Wim Looman <>"]
edition = "2018"
name = "foo"
path = ""
#![feature(arbitrary_self_types, generators, generator_trait, pin)]
use std::{
ops::{DerefMut, Deref, Generator, GeneratorState},
trait PinIterator {
type Item;

Keybase proof

I hereby claim:

  • I am nemo157 on github.
  • I am nemo157 ( on keybase.
  • I have a public key ASD1nVnDDI5Cp5WsBc513ncqywdomif0qkol8hTYsP_9Rgo

To claim this, I am signing this object:

Nemo157 /
Last active Oct 10, 2019
An attempt at working out how to shim an argument accepting generator into a Sink
use core::pin::Pin;
use core::task::{Context, Poll};
pub enum GeneratorState<Y, R> { Yielded(Y), Complete(R) }
pub trait Generator<Args> {
type Yield;
type Return;
fn resume(self: Pin<&mut Self>, args: Args) -> GeneratorState<Self::Yield, Self::Return>;


Basic example

catch {
    let decoded = bs58::decode("he11owor1d").into_vec()?;
    let encoded = bs58::encode(decoded).into_string();
    assert_eq!("he11owor1d", encoded);
View castofkings-s5.rss
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<title>A Cast of Kings: Season 5</title>
<description>Recreated podcost containing old episodes of "A Cast of Kings" for my personal use</description>
<lastBuildDate>Sat, 23 Jul 2016 12:00:00 +0000</lastBuildDate>
<title>S5 Post-season</title>
<enclosure url="" length="0" type="audio/mpeg" />
View castofkings-s4.rss
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<title>A Cast of Kings: Season 4</title>
<description>Recreated podcost containing old episodes of "A Cast of Kings" for my personal use</description>
<lastBuildDate>Sun, 3 Jul 2016 12:00:00 +0000</lastBuildDate>
<title>S4 - Wrapup</title>
<pubDate>Mon, 23 Jun 2014 00:00:00 +0000</pubDate>
You can’t perform that action at this time.