Skip to main content

BlobMetadataV53

Struct BlobMetadataV53 

Source
pub struct BlobMetadataV53 {
    pub merkle_leaves: MerkleLeaves,
    pub format: BlobFormatV53,
}

Fields§

§merkle_leaves: MerkleLeaves§format: BlobFormatV53

Implementations§

Source§

impl BlobMetadataV53

Source

pub async fn read_from<S: HandleOwner>( blob_object: &DataObjectHandle<S>, ) -> Result<Self, Error>

Reads the blob metadata from an attribute on blob_object. If the attribute doesn’t exist then it’s assumed to be BlobMetadata::empty().

Source

pub async fn write_to<S: HandleOwner>( &self, blob_object: &DataObjectHandle<S>, ) -> Result<(), Error>

Writes the metadata to the BLOB_METADATA_ATTRIBUTE_ID attribute on blob_object. If the metadata is equal to BlobMetadata::empty() then the attribute isn’t written.

Source

pub fn serialized_size(&self) -> Result<usize, Error>

Returns the size of the serialized metadata. If the metadata is equal to BlobMetadata::empty() then the metadata won’t get written, so 0 is returned.

Source

pub fn into_merkle_verifier(self, root: Hash) -> Result<MerkleVerifier, Error>

Consumes the metadata and turns it into a MerkleVerifier.

Source

pub fn empty() -> Self

Constructs a BlobMetadata that is considered to be empty. The empty metadata does not get written out as an attribute.

Trait Implementations§

Source§

impl Debug for BlobMetadataV53

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for BlobMetadataV53

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<BlobMetadataUnversioned> for BlobMetadataV53

Source§

fn from(old: BlobMetadataUnversioned) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for BlobMetadataV53

Source§

fn eq(&self, other: &BlobMetadataV53) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for BlobMetadataV53

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TypeFingerprint for BlobMetadataV53

Source§

impl Versioned for BlobMetadataV53

Source§

fn max_serialized_size() -> Option<u64>

Maximum size of a serialized version of this type. Serialization and deserialization will fail if the limit is exceeded. If None, there is no limit. None is preferred over u64::MAX because serializing and deserializing with a limit has runtime overhead.
Source§

fn deserialize_from<R>(reader: &mut R, _version: Version) -> Result<Self>
where R: Read + ?Sized, for<'de> Self: Deserialize<'de>,

Source§

fn serialize_into<W>(&self, writer: &mut W) -> Result<()>
where W: Write, Self: Serialize,

Source§

impl VersionedLatest for BlobMetadataV53

Source§

fn deserialize_from_version<R>(reader: &mut R, version: Version) -> Result<Self>
where R: Read, Self: Sized,

Deserializes from a given version format and upgrades to the latest version.
Source§

fn deserialize_with_version<R>(reader: &mut R) -> Result<(Self, Version)>
where R: Read, Self: Sized,

Like deserialize_from_version but reads Version from reader first, then uses it to deserialize self.
Source§

fn serialize_with_version<W>(&self, writer: &mut W) -> Result<()>
where W: Write, Self: Sized,

Like serialize_into but serialized Version first, then self.
Source§

impl Eq for BlobMetadataV53

Source§

impl StructuralPartialEq for BlobMetadataV53

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,