pub struct InMemoryStationTransport { /* private fields */ }Expand description
Bounded in-memory station-to-station packet transport.
Implementations§
Source§impl InMemoryStationTransport
impl InMemoryStationTransport
Sourcepub fn new(limits: StationTransportLimits) -> Self
pub fn new(limits: StationTransportLimits) -> Self
Creates an empty bounded station transport.
Sourcepub fn register_station(&mut self, station_id: StationId)
pub fn register_station(&mut self, station_id: StationId)
Registers a target station queue.
Sourcepub fn unregister_station(&mut self, station_id: StationId) -> Option<usize>
pub fn unregister_station(&mut self, station_id: StationId) -> Option<usize>
Unregisters a station and releases its queued packet storage.
Sourcepub fn queued_len(&self, station_id: StationId) -> Option<usize>
pub fn queued_len(&self, station_id: StationId) -> Option<usize>
Returns queued packet count for a station.
Sourcepub fn queued_capacity(&self, station_id: StationId) -> Option<usize>
pub fn queued_capacity(&self, station_id: StationId) -> Option<usize>
Returns packet slots retained by one station queue.
Sourcepub fn retained_queue_capacity(&self) -> usize
pub fn retained_queue_capacity(&self) -> usize
Returns packet slots retained across all registered station queues.
Sourcepub const fn limits(&self) -> StationTransportLimits
pub const fn limits(&self) -> StationTransportLimits
Returns configured limits.
Sourcepub const fn stats(&self) -> InMemoryStationTransportStats
pub const fn stats(&self) -> InMemoryStationTransportStats
Returns transport statistics.
Trait Implementations§
Source§impl Clone for InMemoryStationTransport
impl Clone for InMemoryStationTransport
Source§fn clone(&self) -> InMemoryStationTransport
fn clone(&self) -> InMemoryStationTransport
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryStationTransport
impl Debug for InMemoryStationTransport
Source§impl Default for InMemoryStationTransport
impl Default for InMemoryStationTransport
Source§impl StationTransportReceiver for InMemoryStationTransport
impl StationTransportReceiver for InMemoryStationTransport
Source§type Error = StationTransportError
type Error = StationTransportError
Transport error type.
Source§fn try_recv_station(
&mut self,
target_station: StationId,
) -> Result<Option<StationInboundPacket>, Self::Error>
fn try_recv_station( &mut self, target_station: StationId, ) -> Result<Option<StationInboundPacket>, Self::Error>
Attempts to receive one encoded packet for
target_station.Source§impl StationTransportSink for InMemoryStationTransport
impl StationTransportSink for InMemoryStationTransport
Source§type Error = StationTransportError
type Error = StationTransportError
Transport error type.
Source§fn send_station(
&mut self,
packet: StationOutboundPacket,
) -> Result<(), Self::Error>
fn send_station( &mut self, packet: StationOutboundPacket, ) -> Result<(), Self::Error>
Sends one encoded station packet.
Source§fn send_station_batch(
&mut self,
batch: StationPacketBatch,
) -> Result<(), Self::Error>
fn send_station_batch( &mut self, batch: StationPacketBatch, ) -> Result<(), Self::Error>
Sends a station packet batch.
Auto Trait Implementations§
impl Freeze for InMemoryStationTransport
impl RefUnwindSafe for InMemoryStationTransport
impl Send for InMemoryStationTransport
impl Sync for InMemoryStationTransport
impl Unpin for InMemoryStationTransport
impl UnsafeUnpin for InMemoryStationTransport
impl UnwindSafe for InMemoryStationTransport
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