Skip to main content

EmbeddedAsset

Struct EmbeddedAsset 

Source
pub struct EmbeddedAsset {
    pub item: Item,
    pub parent: Option<usize>,
    pub depth: usize,
    pub structure: Result<Structure>,
    /* private fields */
}
Expand description

One embedded file discovered by Structure::scan_embedded.

Its structure’s offsets are relative to its own stream, not the original file. Use reader to read its metadata from the original source. No embedded image data is retained in memory.

Fields§

§item: Item

The containing structure’s item, including its declared media type, URI and native identifiers.

§parent: Option<usize>

Index of the parent in the scan result, or None for a root child.

§depth: usize

Immediate children have depth 1.

§structure: Result<Structure>

The parsed contents, or the specific error (including unsupported format). Malformed or unsupported children do not hide other siblings.

Implementations§

Source§

impl EmbeddedAsset

Source

pub fn ranges(&self) -> &[ByteRange]

Byte ranges in the original source, in logical order.

Source

pub fn reader<'a, R: Read + Seek + ?Sized>( &'a self, src: &'a mut R, ) -> Result<EmbeddedReader<'a, R>>

Open this asset as a bounded stream over the original source. This also works for an unsupported asset, so applications can inspect its raw data.

Trait Implementations§

Source§

impl Debug for EmbeddedAsset

Source§

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

Formats the value using the given formatter. Read more

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
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.