pub struct MetadataSnapshot { /* private fields */ }Expand description
An opaque observation binding one adapter instance, literal key and version. Payload ownership remains with the snapshot; callers reserve payload, key, token and transport scratch before invoking the physical operation.
Implementations§
Source§impl MetadataSnapshot
impl MetadataSnapshot
Sourcepub fn bytes(&self) -> Option<&[u8]>
pub fn bytes(&self) -> Option<&[u8]>
Exact borrowed bytes, or absence. Cloning the snapshot retains its owner; raw Bytes aliases cannot escape that lifetime through this accessor.
use object_log::MetadataSnapshot;
fn borrow(snapshot: &MetadataSnapshot) -> Option<&[u8]> { snapshot.bytes() }ⓘ
use object_log::MetadataSnapshot;
fn escape(snapshot: MetadataSnapshot) -> bytes::Bytes {
snapshot.bytes().unwrap().clone()
}Trait Implementations§
Source§impl Clone for MetadataSnapshot
impl Clone for MetadataSnapshot
Auto Trait Implementations§
impl !RefUnwindSafe for MetadataSnapshot
impl !UnwindSafe for MetadataSnapshot
impl Forget for MetadataSnapshot
impl Freeze for MetadataSnapshot
impl Send for MetadataSnapshot
impl Sync for MetadataSnapshot
impl Unpin for MetadataSnapshot
impl UnsafeUnpin for MetadataSnapshot
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