[][src]Struct deb_rs::file::Deb

pub struct Deb {
    pub extracted_path: Option<String>,
    // some fields omitted
}

This is the struct that should be used to parse .deb files. It should first be created with Deb::new and then extracted with Deb::extract. Once the file has been extracted you can then retrieve data from it.

Example

use std::io::Error;
use deb_rs::file::Deb;

fn main() -> Result<(), Error> {
  let mut deb = Deb::new("./example/assets/gnome_clocks.deb");
  deb.extract()?;

  deb.version()?; // Returns the version of the structure of the debian package.
  // NOTE: extract() will fail with versions that are not 2.0 as their structure is different

  deb.retrieve_control()?; // Will return some general information about the contents of the package

   deb.install_tree()?; // Returns an array of files that must be moved for the file package to work

   Ok(())
}

Fields

extracted_path: Option<String>

Implementations

impl Deb[src]

@todo Add support for prerm and postinst files

pub fn new(path: &'static str) -> Self[src]

pub fn extract(&mut self) -> Result<&mut Self, Error>[src]

Extracts the deb file into a set of individual files

pub fn version(&self) -> Result<Version, Error>[src]

Returns the version of the deb file. Note that the standard has been V2_0 (2.0) since debian 0.93

pub fn install_tree(&self) -> Result<Vec<PathItem>, Error>[src]

@todo Docs for this function

pub fn retrieve_control(&self) -> Result<Control, Error>[src]

@todo Docs for this function

Auto Trait Implementations

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 = Infallible

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,