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>) -> Self
pub fn new(rx: Receiver<ControllerInputPayload>) -> Self
Create a new channel-backed input source.
Sourcepub fn channel(buffer: usize) -> (Sender<ControllerInputPayload>, Self)
pub fn channel(buffer: usize) -> (Sender<ControllerInputPayload>, Self)
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