Struct veloren_common_assets::source::Tar
pub struct Tar<R = SyncFile> {
reader: R,
files: HashMap<FileDesc, (u64, u64)>,
dirs: HashMap<SharedString, Vec<OwnedEntry>>,
label: Option<String>,
}
Expand description
Fields§
§reader: R
§files: HashMap<FileDesc, (u64, u64)>
§dirs: HashMap<SharedString, Vec<OwnedEntry>>
§label: Option<String>
Implementations§
§impl<R> Tar<R>
impl<R> Tar<R>
pub fn from_reader(reader: R) -> Result<Tar<R>, Error>
pub fn from_reader(reader: R) -> Result<Tar<R>, Error>
Creates a Tar
archive backed by a reader that supports seeking.
pub fn from_reader_with_label(reader: R, label: String) -> Result<Tar<R>, Error>
pub fn from_reader_with_label(reader: R, label: String) -> Result<Tar<R>, Error>
Creates a Tar
archive backed by a reader that supports seeking.
An additionnal label that will be used in errors can be added.
Trait Implementations§
§impl<R> Source for Tar<R>
impl<R> Source for Tar<R>
§fn read(&self, id: &str, ext: &str) -> Result<FileContent<'_>, Error>
fn read(&self, id: &str, ext: &str) -> Result<FileContent<'_>, Error>
Try reading the source given an id and an extension. Read more
§fn read_dir(
&self,
id: &str,
f: &mut dyn FnMut(DirEntry<'_>),
) -> Result<(), Error>
fn read_dir( &self, id: &str, f: &mut dyn FnMut(DirEntry<'_>), ) -> Result<(), Error>
Reads the content of a directory. Read more
§fn exists(&self, entry: DirEntry<'_>) -> bool
fn exists(&self, entry: DirEntry<'_>) -> bool
Returns
true
if the entry points at an existing entity. Read moreAuto Trait Implementations§
impl<R> Freeze for Tar<R>where
R: Freeze,
impl<R> RefUnwindSafe for Tar<R>where
R: RefUnwindSafe,
impl<R> Send for Tar<R>where
R: Send,
impl<R> Sync for Tar<R>where
R: Sync,
impl<R> Unpin for Tar<R>where
R: Unpin,
impl<R> UnwindSafe for Tar<R>where
R: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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