pub struct Deb {
pub extracted_path: Option<String>,
/* private fields */
}
Expand description
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§
Source§impl Deb
@todo Add support for prerm and postinst files
impl Deb
@todo Add support for prerm and postinst files
pub fn new(path: &'static str) -> Self
Sourcepub fn extract(&mut self) -> Result<&mut Self, Error>
pub fn extract(&mut self) -> Result<&mut Self, Error>
Extracts the deb file into a set of individual files
Sourcepub fn version(&self) -> Result<Version, Error>
pub fn version(&self) -> Result<Version, Error>
Returns the version of the deb file. Note that the standard has been V2_0 (2.0
) since debian 0.93
Sourcepub fn retrieve_control(&self) -> Result<Control, Error>
pub fn retrieve_control(&self) -> Result<Control, Error>
@todo Docs for this function
Auto Trait Implementations§
impl Freeze for Deb
impl RefUnwindSafe for Deb
impl Send for Deb
impl Sync for Deb
impl Unpin for Deb
impl UnwindSafe for Deb
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more