pub struct ArchiveRef {
pub id: u32,
pub index_id: u8,
pub sector: usize,
pub length: usize,
}
Expand description
A reference to an archive segment.
Archives are not stored in a contiguous fashion.
An ArchiveRef
is basically a wide pointer, like &str
or &[u8]
. When an Archive
is fetched from the
Dat2
file it knows where the memory starts and its length. Each block of memory belong to the archive
is viewed as a Sector
, which contains a pointer to the next sector. Once this chain is
exhausted you are left with all of the archive data.
Fields§
§id: u32
§index_id: u8
§sector: usize
§length: usize
Implementations§
Source§impl ArchiveRef
impl ArchiveRef
Sourcepub fn data_blocks(&self) -> DataBlocks ⓘ
pub fn data_blocks(&self) -> DataBlocks ⓘ
Generate a data block iterator from this archive reference.
Trait Implementations§
Source§impl Clone for ArchiveRef
impl Clone for ArchiveRef
Source§fn clone(&self) -> ArchiveRef
fn clone(&self) -> ArchiveRef
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ArchiveRef
impl Debug for ArchiveRef
Source§impl Default for ArchiveRef
impl Default for ArchiveRef
Source§fn default() -> ArchiveRef
fn default() -> ArchiveRef
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ArchiveRef
impl<'de> Deserialize<'de> for ArchiveRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&ArchiveRef> for SectorHeaderSize
impl From<&ArchiveRef> for SectorHeaderSize
Source§fn from(archive: &ArchiveRef) -> Self
fn from(archive: &ArchiveRef) -> Self
Converts to this type from the input type.
Source§impl Hash for ArchiveRef
impl Hash for ArchiveRef
Source§impl Ord for ArchiveRef
impl Ord for ArchiveRef
Source§fn cmp(&self, other: &ArchiveRef) -> Ordering
fn cmp(&self, other: &ArchiveRef) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ArchiveRef
impl PartialEq for ArchiveRef
Source§impl PartialOrd for ArchiveRef
impl PartialOrd for ArchiveRef
Source§impl Serialize for ArchiveRef
impl Serialize for ArchiveRef
impl Copy for ArchiveRef
impl Eq for ArchiveRef
impl StructuralPartialEq for ArchiveRef
Auto Trait Implementations§
impl Freeze for ArchiveRef
impl RefUnwindSafe for ArchiveRef
impl Send for ArchiveRef
impl Sync for ArchiveRef
impl Unpin for ArchiveRef
impl UnwindSafe for ArchiveRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more