pub trait Handoff: Default + HandoffMeta {
type Inner;
// Required methods
fn take_inner(&self) -> Self::Inner;
fn borrow_mut_swap(&self) -> RefMut<'_, Self::Inner>;
// Provided methods
fn give<T>(&self, item: T) -> T
where Self: CanReceive<T> { ... }
fn try_give<T>(&self, item: T) -> Result<T, T>
where Self: TryCanReceive<T> { ... }
}
Expand description
Trait for handoffs to implement.
Required Associated Types§
Required Methods§
sourcefn take_inner(&self) -> Self::Inner
fn take_inner(&self) -> Self::Inner
Take the inner datastructure, similar to std::mem::take
.
sourcefn borrow_mut_swap(&self) -> RefMut<'_, Self::Inner>
fn borrow_mut_swap(&self) -> RefMut<'_, Self::Inner>
Take the inner datastructure by swapping input and output buffers.
For better performance over Self::take_inner
.
Provided Methods§
sourcefn give<T>(&self, item: T) -> Twhere
Self: CanReceive<T>,
fn give<T>(&self, item: T) -> Twhere
Self: CanReceive<T>,
See CanReceive::give
.
sourcefn try_give<T>(&self, item: T) -> Result<T, T>where
Self: TryCanReceive<T>,
fn try_give<T>(&self, item: T) -> Result<T, T>where
Self: TryCanReceive<T>,
Object Safety§
This trait is not object safe.