[][src]Struct debpkg::DebPkg

pub struct DebPkg<R: Read> { /* fields omitted */ }

A debian package represented by the control data the archive holding all the information

Methods

impl<'a, R: 'a + Read> DebPkg<R>[src]

pub fn parse(reader: R) -> Result<DebPkg<R>, Error>[src]

Parses a debian package out of reader

Arguments

  • reader - A type which implements std::io::Read and std::io::Seek and is formatted as an ar archive

Example

use debpkg::DebPkg;
let file = std::fs::File::open("test.deb").unwrap();
let pkg = DebPkg::parse(file).unwrap();

pub fn format_version(&self) -> (u32, u32)[src]

Returns the format version of the binary debian package

pub fn control(&'a mut self) -> Result<Archive<Box<dyn Read + 'a>>, Error>[src]

Returns the control tar

Arguments

  • self - A DebPkg created by a call to DebPkg::parse

Example

use debpkg::DebPkg;
let file = std::fs::File::open("test.deb").unwrap();
let mut pkg = DebPkg::parse(file).unwrap();
let mut control_tar = pkg.control().unwrap();
for file in control_tar.entries().unwrap() {
    println!("{}", file.unwrap().path().unwrap().display());
}

pub fn data(&'a mut self) -> Result<Archive<Box<dyn Read + 'a>>, Error>[src]

Returns the data tar

Must only be called

Arguments

  • self - A DebPkg created by a call to DebPkg::parse

Example

use debpkg::DebPkg;
let file = std::fs::File::open("test.deb").unwrap();
let mut pkg = DebPkg::parse(file).unwrap();
let mut data_tar = pkg.data().unwrap();
for file in data_tar.entries().unwrap() {
    println!("{}", file.unwrap().path().unwrap().display());
}

Auto Trait Implementations

impl<R> RefUnwindSafe for DebPkg<R> where
    R: RefUnwindSafe

impl<R> Send for DebPkg<R> where
    R: Send

impl<R> Sync for DebPkg<R> where
    R: Sync

impl<R> Unpin for DebPkg<R> where
    R: Unpin

impl<R> UnwindSafe for DebPkg<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.