Skip to main content

Archive

Struct Archive 

Source
#[non_exhaustive]
pub struct Archive { pub sfx_offset: usize, pub main: MainHeader, pub blocks: Vec<Block>, /* private fields */ }

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§sfx_offset: usize§main: MainHeader§blocks: Vec<Block>

Implementations§

Source§

impl Archive

Source

pub fn extract_to<F>( &self, options: ArchiveReadOptions<'_>, open: F, ) -> Result<()>
where F: FnMut(&ExtractedEntryMeta) -> Result<Box<dyn Write>>,

Source§

impl Archive

Source

pub fn parse(input: &[u8]) -> Result<Self>

Source

pub fn parse_owned(input: Vec<u8>) -> Result<Self>

Source

pub fn parse_with_options( input: &[u8], options: ArchiveReadOptions<'_>, ) -> Result<Self>

Source

pub fn parse_owned_with_options( input: Vec<u8>, options: ArchiveReadOptions<'_>, ) -> Result<Self>

Source

pub fn parse_with_password( input: &[u8], password: Option<&[u8]>, ) -> Result<Self>

Source

pub fn parse_owned_with_password( input: Vec<u8>, password: Option<&[u8]>, ) -> Result<Self>

Source

pub fn parse_path(path: impl AsRef<Path>) -> Result<Self>

Source

pub fn parse_path_with_options( path: impl AsRef<Path>, options: ArchiveReadOptions<'_>, ) -> Result<Self>

Source

pub fn parse_path_with_password( path: impl AsRef<Path>, password: Option<&[u8]>, ) -> Result<Self>

Source

pub fn parse_path_with_signature( path: impl AsRef<Path>, signature: ArchiveSignature, options: ArchiveReadOptions<'_>, ) -> Result<Self>

Source

pub fn parse_path_with_signature_and_password( path: impl AsRef<Path>, signature: ArchiveSignature, password: Option<&[u8]>, ) -> Result<Self>

Source

pub fn files(&self) -> impl Iterator<Item = &FileHeader>

Source

pub fn services(&self) -> impl Iterator<Item = &FileHeader>

Source

pub fn archive_comment(&self) -> Result<Option<Vec<u8>>>

Decodes the archive-level CMT service payload, if any.

RAR 5 stores comments as Service blocks named CMT. Archive-level comments appear before any File block; service blocks attached to a specific file follow that file. This returns only the former.

Source

pub fn archive_comment_with_password( &self, password: Option<&[u8]>, ) -> Result<Option<Vec<u8>>>

Same as Self::archive_comment but supplies a password for individually-encrypted comment services.

Source

pub fn repair_recovery(&self) -> Result<Vec<u8>>

Source

pub fn repair_recovery_to(&self, writer: &mut dyn Write) -> Result<()>

Trait Implementations§

Source§

impl Clone for Archive

Source§

fn clone(&self) -> Archive

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Archive

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.