pub struct SubAsset { /* private fields */ }Expand description
One independently valid piece of a multi-part asset, such as one image of a Multi-Picture Format file.
Sub-assets are contiguous, in file order, and together cover every byte of the
asset, so they can be listed as the parts of a C2PA multi-asset hash. A
Structure always has at least one: the primary asset, which is the whole
file when nothing else is embedded.
Implementations§
Source§impl SubAsset
impl SubAsset
Sourcepub fn range(&self) -> ByteRange
pub fn range(&self) -> ByteRange
Where the sub-asset lies in the asset: absolute offset and length.
Sourcepub fn segments(&self) -> Range<usize> ⓘ
pub fn segments(&self) -> Range<usize> ⓘ
Indices (see SegmentId::index) of the segments the sub-asset is made of.
Sourcepub fn media_type(&self) -> Option<&str>
pub fn media_type(&self) -> Option<&str>
Media type of the sub-asset, or None when the container cannot tell (trailing
data after the last image).
Sourcepub fn is_primary(&self) -> bool
pub fn is_primary(&self) -> bool
Whether this is the primary asset, the first sub-asset.
Trait Implementations§
impl Eq for SubAsset
impl StructuralPartialEq for SubAsset
Auto Trait Implementations§
impl Forget for SubAsset
impl Freeze for SubAsset
impl Move for SubAsset
impl RefUnwindSafe for SubAsset
impl Send for SubAsset
impl Sync for SubAsset
impl Unpin for SubAsset
impl UnsafeUnpin for SubAsset
impl UnwindSafe for SubAsset
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