pub struct Archive<'a> { /* private fields */ }
Expand description
An in-memory representation of a parsed Unix Archive
Implementations
sourceimpl<'a> Archive<'a>
impl<'a> Archive<'a>
pub fn parse(buffer: &'a [u8]) -> Result<Archive<'a>>
sourcepub fn get(&self, member: &str) -> Option<&Member<'_>>
pub fn get(&self, member: &str) -> Option<&Member<'_>>
Get the member named member
in this archive, if any. If there are
multiple files in the archive with the same name it only returns one
of them.
sourcepub fn get_at(&self, index: usize) -> Option<&Member<'_>>
pub fn get_at(&self, index: usize) -> Option<&Member<'_>>
Get the member at position index
in this archive, if any.
sourcepub fn extract<'b>(&self, member: &str, buffer: &'b [u8]) -> Result<&'b [u8]>
pub fn extract<'b>(&self, member: &str, buffer: &'b [u8]) -> Result<&'b [u8]>
Returns a slice of the raw bytes for the given member
in the scrollable buffer
sourcepub fn summarize(&self) -> Vec<(&str, &Member<'_>, Vec<&'a str>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn summarize(&self) -> Vec<(&str, &Member<'_>, Vec<&'a str>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Gets a summary of this archive, returning a list of membername, the member, and the list of symbols the member contains
sourcepub fn members(&self) -> Vec<&'a str>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn members(&self) -> Vec<&'a str>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get the list of member names in this archive
This returns members in alphabetical order, not in the order they
occurred in the archive. If there are multiple files with the same
name, the size of the returned array will be less than the size of
len()
.
sourcepub fn member_of_symbol(&self, symbol: &str) -> Option<&'a str>
pub fn member_of_symbol(&self, symbol: &str) -> Option<&'a str>
Returns the member’s name which contains the given symbol
, if it is in the archive
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Archive<'a>
impl<'a> Send for Archive<'a>
impl<'a> Sync for Archive<'a>
impl<'a> Unpin for Archive<'a>
impl<'a> UnwindSafe for Archive<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more