pub enum UsedChain {
Ack(Token),
Data(Token, Segments),
}Expand description
A used chain observed by the driver (producer) side.
Read-only chains are returned as Ack. Chains with a writable
buffer complete as Data, even when the device wrote zero
bytes. Non-empty segments use backend-owned mappings. Borrowed mappings
keep their pool slots allocated until the last Bytes owner drops.
Variants§
Ack(Token)
Acknowledgement for a read-only/fire-and-forget chain.
Data(Token, Segments)
Data written by the consumer into the chain’s writable buffers.
The payload may contain zero bytes when the consumer writes zero bytes; that is still a data used chain because the submitted chain had writable capacity.
Implementations§
Source§impl UsedChain
impl UsedChain
Sourcepub fn token(&self) -> Token
pub fn token(&self) -> Token
Token identifying which submitted chain this used chain corresponds to.
Sourcepub fn to_bytes(&self) -> Option<Bytes>
pub fn to_bytes(&self) -> Option<Bytes>
Data written by the consumer as contiguous bytes, if this chain has data.
Sourcepub fn segments(&self) -> Option<&Segments>
pub fn segments(&self) -> Option<&Segments>
Segments written by the consumer, if this chain has data.
Sourcepub fn into_bytes(self) -> Option<Bytes>
pub fn into_bytes(self) -> Option<Bytes>
Consume the used chain and return written data as contiguous bytes, if present.
Sourcepub fn into_segments(self) -> Option<Segments>
pub fn into_segments(self) -> Option<Segments>
Consume the used chain and return written segments, if present.