pub struct Port { /* private fields */ }Available on crate feature
hub only.Expand description
Implementations§
Source§impl Port
impl Port
Sourcepub fn id(&self) -> u64
pub fn id(&self) -> u64
A process-unique identifier for this port (used for no-echo filtering and in log messages).
Sourcepub fn send(&self, frame: CanFrame)
pub fn send(&self, frame: CanFrame)
Send a frame to every other port.
Never blocks. If no other port is attached the frame is discarded.
Sourcepub async fn recv(&mut self) -> Option<CanFrame>
pub async fn recv(&mut self) -> Option<CanFrame>
Wait for the next frame from another port. Returns None if the hub
is gone.
If this port fell more than CHANNEL_DEPTH frames behind, the
frames it missed are skipped (and logged with the log feature) and
reception continues with the oldest frame still in the ring.
Sourcepub fn try_recv(&mut self) -> Option<CanFrame>
pub fn try_recv(&mut self) -> Option<CanFrame>
Return a frame if one is ready, without waiting. Lag is handled
exactly as in Port::recv.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Port
impl RefUnwindSafe for Port
impl Send for Port
impl Sync for Port
impl Unpin for Port
impl UnsafeUnpin for Port
impl UnwindSafe for Port
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