Skip to main content

BlobMetadata

Type Alias BlobMetadata 

Source
pub type BlobMetadata = BlobMetadataV53;

Aliased Type§

pub struct BlobMetadata {
    pub merkle_leaves: Vec<[u8; 32]>,
    pub format: BlobFormatV53,
}

Fields§

§merkle_leaves: Vec<[u8; 32]>§format: BlobFormatV53

Implementations§

Source§

impl BlobMetadata

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.