Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / playground.rs
Created Feb 12, 2016
Shared via Rust Playground
View playground.rs
trait StreamingIterator<'a> {
type Item;
fn next(&'a mut self) -> Option<Self::Item>;
}
struct Buffer<T> {
data: Vec<T>,
pos: usize
}
anonymous
anonymous / playground.rs
Created Feb 11, 2016
Shared via Rust Playground
View playground.rs
use std::collections::VecDeque;
// The kind * -> *
trait TypeToType<Input> {
type Output;
}
struct Vec_;
struct VecDeque_;
@Gankra
Gankra / gist:06b4c5454bd4f3ef732a
Last active Aug 29, 2015
libcollections traits 0.1
View gist:06b4c5454bd4f3ef732a
pub trait Collection {
fn len(self) -> uint;
fn is_empty(&self) -> bool; //defaulted
}
pub trait Mutable: Collection {
fn clear(&mut self);
}
pub trait Container<T>: Collection {
You can’t perform that action at this time.