pub struct AsyncUtf8Reader<T>{ /* private fields */ }
Expand description
A struct to open and read a FAR-formatted archive asynchronously. Requires that all paths are valid UTF-8.
Implementations§
Source§impl<T> AsyncUtf8Reader<T>
impl<T> AsyncUtf8Reader<T>
Sourcepub async fn new(source: T) -> Result<Self, Error>
pub async fn new(source: T) -> Result<Self, Error>
Create a new AsyncUtf8Reader for the provided source.
Sourcepub fn list(&self) -> impl ExactSizeIterator<Item = Utf8Entry<'_>>
pub fn list(&self) -> impl ExactSizeIterator<Item = Utf8Entry<'_>>
Return a list of the items in the archive.
Sourcepub async fn read_file(&mut self, path: &str) -> Result<Vec<u8>, Error>
pub async fn read_file(&mut self, path: &str) -> Result<Vec<u8>, Error>
Read the entire contents of an entry with the specified path. O(log(# directory entries))
pub fn into_source(self) -> T
Source§impl<T> AsyncUtf8Reader<Arc<Mutex<T>>>
impl<T> AsyncUtf8Reader<Arc<Mutex<T>>>
Sourcepub fn read_file_stream(
&self,
path: &str,
buffer_size: usize,
) -> Result<(u64, impl Stream<Item = Result<Vec<u8>, Error>> + Send), Error>
pub fn read_file_stream( &self, path: &str, buffer_size: usize, ) -> Result<(u64, impl Stream<Item = Result<Vec<u8>, Error>> + Send), Error>
Read the contents of the entry with the specified path as a stream.
Each Vec in the stream will have a maximum size of buffer_size
.
O(log(# directory entries))
Trait Implementations§
Source§impl<T> Debug for AsyncUtf8Reader<T>
impl<T> Debug for AsyncUtf8Reader<T>
Auto Trait Implementations§
impl<T> Freeze for AsyncUtf8Reader<T>where
T: Freeze,
impl<T> RefUnwindSafe for AsyncUtf8Reader<T>where
T: RefUnwindSafe,
impl<T> Send for AsyncUtf8Reader<T>where
T: Send,
impl<T> Sync for AsyncUtf8Reader<T>where
T: Sync,
impl<T> Unpin for AsyncUtf8Reader<T>
impl<T> UnwindSafe for AsyncUtf8Reader<T>where
T: 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