pub struct ChannelInputSource { /* private fields */ }Expand description
Input source backed by an async channel.
This is the default source used internally. The consumer sends input through a channel that this source reads from.
Implementations§
Source§impl ChannelInputSource
impl ChannelInputSource
Sourcepub fn new(rx: Receiver<ControllerInputPayload>) -> ChannelInputSource
pub fn new(rx: Receiver<ControllerInputPayload>) -> ChannelInputSource
Create a new channel-backed input source.
Sourcepub fn channel(
buffer: usize,
) -> (Sender<ControllerInputPayload>, ChannelInputSource)
pub fn channel( buffer: usize, ) -> (Sender<ControllerInputPayload>, ChannelInputSource)
Create a channel pair for input.
Returns (sender, source) where sender is used by the consumer
to send input and source is passed to the engine.
Trait Implementations§
Source§impl InputSource for ChannelInputSource
impl InputSource for ChannelInputSource
Auto Trait Implementations§
impl Freeze for ChannelInputSource
impl RefUnwindSafe for ChannelInputSource
impl Send for ChannelInputSource
impl Sync for ChannelInputSource
impl Unpin for ChannelInputSource
impl UnwindSafe for ChannelInputSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more