Skip to main content

CuStreamTx

Trait CuStreamTx 

Source
pub trait CuStreamTx:
    Debug
    + Send
    + Sync {
    // Required method
    fn try_send(&mut self, packet: &[u8]) -> Result<(), CuStreamTxError>;

    // Provided method
    fn poll_pending(&mut self) -> Result<bool, CuStreamTxError> { ... }
}
Expand description

One-way, fire-and-forget transmission of complete logstream packets.

Implementations must return immediately without waiting, locking, allocating, retrying, acknowledging, or accepting a partial packet. Ok(()) means only that the resource accepted this packet once; it does not guarantee delivery.

Carriers must protect complete packet boundaries and integrity. Packet hardware or the network stack may supply the checksum; adapters over byte streams must add framing, an integrity check, and receive resynchronization. The common LogStream envelope has no checksum. Carrier overhead is outside the packet MTU.

Required Methods§

Source

fn try_send(&mut self, packet: &[u8]) -> Result<(), CuStreamTxError>

Provided Methods§

Source

fn poll_pending(&mut self) -> Result<bool, CuStreamTxError>

Advance an accepted packet with bounded, nonblocking work. Returns true while bytes remain. Drivers must keep polling until it returns false. The default implementation reports an idle transport.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: CuStreamTx + ?Sized> CuStreamTx for Box<T>

Implementors§