pub trait Push<T> {
    fn push(&mut self, element: &mut Option<T>);

    fn send(&mut self, element: T) { ... }
    fn done(&mut self) { ... }
}
Expand description

Pushing elements of type T.

This trait moves data around using references rather than ownership, which provides the opportunity for zero-copy operation. In the call to push(element) the implementor can swap some other value to replace element, effectively returning the value to the caller.

Conventionally, a sequence of calls to push() should conclude with a call of push(&mut None) or done() to signal to implementors that another call to push() may not be coming.

Required methods

Pushes element with the opportunity to take ownership.

Provided methods

Pushes element and drops any resulting resources.

Pushes None, conventionally signalling a flush.

Implementations on Foreign Types

Implementors