Struct mesh::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> PortWithHandler<T>where
T: HandlePortEvent,
impl<T> PortWithHandler<T>where
T: HandlePortEvent,
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 for PortWithHandler<T>where
T: Debug,
impl<T> Debug for PortWithHandler<T>where
T: Debug,
source§impl<T> From<Port> for PortWithHandler<T>where
T: Default + HandlePortEvent,
impl<T> From<Port> for PortWithHandler<T>where
T: Default + HandlePortEvent,
source§fn from(port: Port) -> PortWithHandler<T>
fn from(port: Port) -> PortWithHandler<T>
Converts to this type from the input type.
source§impl<T> From<PortWithHandler<T>> for Portwhere
T: HandlePortEvent,
impl<T> From<PortWithHandler<T>> for Portwhere
T: HandlePortEvent,
source§fn from(port: PortWithHandler<T>) -> Port
fn from(port: PortWithHandler<T>) -> Port
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