Struct DebArchive

Source
pub struct DebArchive { /* private fields */ }
Expand description

An intermediary layer between the DebPackage struct and an actual .deb file.

This struct allows you to read and write built packages from and to the filesystem.

The contents of a DebArchive cannot be directly manipulated. To modify a DebArchive, you must first convert it to a DebPackage with the to_package() method, or open the file using DebPackage’s from() function.

Implementations§

Source§

impl DebArchive

Source

pub fn write<W: Write>(&self, output: W) -> Result<()>

Writes package to output.

Source

pub fn read<R: Read>(input: R) -> Result<Self>

Reads package from input.

Source

pub fn to_package(&self) -> Result<DebPackage>

Converts DebArchive to DebPackage.

§Errors

This function may return an error if the archive’s control file (where all of a package’s metadata is stored) contains invalid syntax, or if part of the package is corrupted and can’t be read.

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> 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, 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.