pub struct Dat2(/* private fields */);
Expand description
A virtual file type for the .dat2
file.
Implementations§
Source§impl Dat2
impl Dat2
Sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Initializes a memory map over the specified .dat2
file.
Sourcepub fn read(&self, archive_ref: &ArchiveRef) -> Result<Buffer<Encoded>, Error>
pub fn read(&self, archive_ref: &ArchiveRef) -> Result<Buffer<Encoded>, Error>
Read all the data that belongs to the ArchiveRef
.
Sourcepub fn read_into_writer<W>(
&self,
archive_ref: &ArchiveRef,
writer: &mut W,
) -> Result<(), Error>where
W: Write,
pub fn read_into_writer<W>(
&self,
archive_ref: &ArchiveRef,
writer: &mut W,
) -> Result<(), Error>where
W: Write,
Read all the data that belongs to the ArchiveRef
into the given writer.
pub fn metadata(&self, archive_ref: &ArchiveRef) -> Result<IndexMetadata, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dat2
impl RefUnwindSafe for Dat2
impl Send for Dat2
impl Sync for Dat2
impl Unpin for Dat2
impl UnwindSafe for Dat2
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> 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