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: BlobFormatV53Implementations§
Source§impl BlobMetadata
impl BlobMetadata
Sourcepub async fn read_from<S: HandleOwner>(
blob_object: &DataObjectHandle<S>,
) -> Result<Self, Error>
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().
Sourcepub async fn write_to<S: HandleOwner>(
&self,
blob_object: &DataObjectHandle<S>,
) -> Result<(), Error>
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.
Sourcepub fn serialized_size(&self) -> Result<usize, Error>
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.
Sourcepub fn into_merkle_verifier(self, root: Hash) -> Result<MerkleVerifier, Error>
pub fn into_merkle_verifier(self, root: Hash) -> Result<MerkleVerifier, Error>
Consumes the metadata and turns it into a MerkleVerifier.