[−][src]Struct debpkg::Control
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,