Struct mesh_node::local_node::PortWithHandler
source · pub struct PortWithHandler<T> { /* private fields */ }
Expand description
A Port
that has a registered message handler.
Created by Port::set_handler
.
Implementations§
source§impl<T: HandlePortEvent> PortWithHandler<T>
impl<T: HandlePortEvent> PortWithHandler<T>
pub fn remove_handler(self) -> (Port, T)
pub fn with_handler<R>(&self, f: impl FnOnce(&mut T) -> R) -> R
pub fn with_port_and_handler<R>( &self, f: impl FnOnce(&mut PortControl<'_>, &mut T) -> R, ) -> R
Trait Implementations§
source§impl<T: Debug> Debug for PortWithHandler<T>
impl<T: Debug> Debug for PortWithHandler<T>
source§impl<T: Default + HandlePortEvent> From<Port> for PortWithHandler<T>
impl<T: Default + HandlePortEvent> From<Port> for PortWithHandler<T>
source§impl<T: HandlePortEvent> From<PortWithHandler<T>> for Port
impl<T: HandlePortEvent> From<PortWithHandler<T>> for Port
source§fn from(port: PortWithHandler<T>) -> Self
fn from(port: PortWithHandler<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for PortWithHandler<T>
impl<T> !RefUnwindSafe for PortWithHandler<T>
impl<T> Send for PortWithHandler<T>where
T: Send,
impl<T> Sync for PortWithHandler<T>where
T: Send,
impl<T> Unpin for PortWithHandler<T>
impl<T> !UnwindSafe for PortWithHandler<T>
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