Struct routing::Evented
[−]
[src]
#[must_use]pub struct Evented<T, Ev = Event> where Ev: Debug { /* fields omitted */ }
An Evented
The public methods on Evented
Methods
impl<Ev: Debug> Evented<(), Ev>
[src]
fn empty() -> Self
Construct a valueless Evented struct for storing events.
fn with_value<T>(self, val: T) -> Evented<T, Ev>
Add a value to a valueless Evented struct.
impl<T, Ev: Debug> Evented<T, Ev>
[src]
fn new(events: Vec<Ev>, val: T) -> Self
Construct a new Evented
fn single(event: Ev, val: T) -> Self
Construct a new Evented
fn map<F, U>(self, f: F) -> Evented<U, Ev> where F: FnOnce(T) -> U
Apply a function to the value contained within an Evented.
fn and_then<F, U>(self, f: F) -> Evented<U, Ev> where F: FnOnce(T) -> Evented<U, Ev>
Apply a function producing another Evented, and combine the events from both.
fn and<U>(self, other: Evented<U, Ev>) -> Evented<U, Ev>
Combine the events of this Evented with the events and value of another.
fn add_event(&mut self, ev: Ev)
Add a single event.
fn add_events(&mut self, evs: Vec<Ev>)
Add multiple events.
fn extract<U>(self, other: &mut Evented<U, Ev>) -> T
Extract the value from this Evented
fn extract_to_buf(self, buffer: &mut VecDeque<Ev>) -> T
Extract the events to an event buffer.
fn into_events(self) -> Vec<Ev>
Consume the Evented
This is one of two methods that allows us to drop events (the other is extract_to_buf).
Trait Implementations
impl<T, Ev: Debug> Drop for Evented<T, Ev>
[src]
Explode if an attempt is made to drop events.