pub struct Chunk { /* private fields */ }Expand description
Chunk meta-data. This doesn’t contain contents or children, but information needed to read the chunk from a file. You will still need a reader to read the contents though.
Implementations§
Source§impl Chunk
impl Chunk
Sourcepub fn read<R: Read + Seek>(reader: R) -> Result<Self, ReadError>
pub fn read<R: Read + Seek>(reader: R) -> Result<Self, ReadError>
Reads the chunk header and returns the information needed to read its contents or children.
Sourcepub fn content<R: Read + Seek>(
&self,
reader: R,
) -> Result<ContentReader<R>, ReadError>
pub fn content<R: Read + Seek>( &self, reader: R, ) -> Result<ContentReader<R>, ReadError>
Creates a reader for its contents.
pub fn read_content_to_vec<R: Read + Seek>( &self, reader: R, ) -> Result<Vec<u8>, ReadError>
Sourcepub fn children<R: Read + Seek>(&self, reader: R) -> ChildrenReader<R> ⓘ
pub fn children<R: Read + Seek>(&self, reader: R) -> ChildrenReader<R> ⓘ
Creates an iterator over its children. The iterator yields
Result<Chunk, _>, so you’ll need to handle the error first.
Each child then is another Chunk struct that can be used to read
contents or children.
Sourcepub fn offset(&self) -> u32
pub fn offset(&self) -> u32
Returns the offset at which the chunk starts. This is relative to the
start of the reader. Note that for children chunks, this is relative
to the start of the child data, since they basically use a
ContentReader to read children chunks.
Sourcepub fn content_offset(&self) -> u32
pub fn content_offset(&self) -> u32
Returns the offset to the content data. See Self::offset for further
information.
Sourcepub fn content_len(&self) -> u32
pub fn content_len(&self) -> u32
Returns the length of the content data.
Sourcepub fn children_offset(&self) -> u32
pub fn children_offset(&self) -> u32
Returns the offset to the children data. See Self::offset for
further information.
Sourcepub fn children_len(&self) -> u32
pub fn children_len(&self) -> u32
Returns the length of the children data.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnwindSafe for Chunk
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more