pub enum PortEvent<T> {
Connect,
Message(T),
Disconnect,
}Expand description
A port’s state transition events (either connect, message, or disconnect).
Variants§
Implementations§
Source§impl<T> PortEvent<T>
impl<T> PortEvent<T>
pub fn message(&self) -> Option<&T>
pub fn into_message(self) -> Option<T>
Sourcepub fn is_connect(&self) -> bool
pub fn is_connect(&self) -> bool
Checks whether the event is a connect event.
Sourcepub fn is_message(&self) -> bool
pub fn is_message(&self) -> bool
Checks whether the event is a message event.
Sourcepub fn is_disconnect(&self) -> bool
pub fn is_disconnect(&self) -> bool
Checks whether the event is a disconnect event.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl<T: Ord> Ord for PortEvent<T>
impl<T: Ord> Ord for PortEvent<T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd> PartialOrd for PortEvent<T>
impl<T: PartialOrd> PartialOrd for PortEvent<T>
impl<T: Copy> Copy for PortEvent<T>
impl<T: Eq> Eq for PortEvent<T>
impl<T> StructuralPartialEq for PortEvent<T>
Auto Trait Implementations§
impl<T> Freeze for PortEvent<T>where
T: Freeze,
impl<T> RefUnwindSafe for PortEvent<T>where
T: RefUnwindSafe,
impl<T> Send for PortEvent<T>where
T: Send,
impl<T> Sync for PortEvent<T>where
T: Sync,
impl<T> Unpin for PortEvent<T>where
T: Unpin,
impl<T> UnwindSafe for PortEvent<T>where
T: UnwindSafe,
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