pub enum UsedChain {
Ack(Token),
Data(Token, Segments),
}Expand description
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.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for UsedChain
impl RefUnwindSafe for UsedChain
impl Send for UsedChain
impl Sync for UsedChain
impl Unpin for UsedChain
impl UnsafeUnpin for UsedChain
impl UnwindSafe for UsedChain
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