[][src]Struct debpkg::Control

pub struct Control { /* fields omitted */ }

Stores the Debian package's control information

Methods

impl Control[src]

pub fn extract<R: Read>(archive: Archive<R>) -> Result<Control, Error>[src]

Parse the Control file in a Debian Package out of a tar file

Arguments

  • archive - The archive which contains the tar file

Example

use debpkg::{DebPkg, Control};
let file = std::fs::File::open("test.deb").unwrap();
let mut pkg = DebPkg::parse(file).unwrap();
let mut control_tar = pkg.control().unwrap();
let control = Control::extract(control_tar).unwrap();

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

Parse the Control file in a Debian Package

Arguments

  • reader - A types which implements read as contains Debian binary package control file

Example

use debpkg::{DebPkg, Control};
let file = std::fs::File::open("test.deb").unwrap();
let mut pkg = DebPkg::parse(file).unwrap();
let control_tar = pkg.control().unwrap();

pub fn name(&self) -> &str[src]

Returns the package name from the control file

pub fn version(&self) -> &str[src]

Returns the package version from the control file

pub fn short_description(&self) -> Option<&str>[src]

Returns short description if it exists from the control file

pub fn long_description(&self) -> Option<&str>[src]

Returns long description if it exists from the control file

pub fn get(&self, field_name: &str) -> Option<&str>[src]

Returns field value based on field name if it exists

Arguments

  • self - A Control struct returned from Control::parse

  • field_name - The field name. This string is case insensitve

pub fn tags(&self) -> impl Iterator<Item = &str>[src]

Returns an iterator to all the field names in the control file

Trait Implementations

impl Debug for Control[src]

Auto Trait Implementations

impl RefUnwindSafe for Control

impl Send for Control

impl Sync for Control

impl Unpin for Control

impl UnwindSafe for Control

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.