ControlTarBuilder

Struct ControlTarBuilder 

Source
pub struct ControlTarBuilder<'a> { /* private fields */ }
Expand description

A builder for a control.tar file inside .deb packages.

Implementations§

Source§

impl<'a> ControlTarBuilder<'a>

Source

pub fn new(control_file: ControlFile<'a>) -> Self

Create a new instance from a control file.

Source

pub fn add_extra_file( self, path: impl AsRef<Path>, entry: impl Into<FileEntry>, ) -> Result<Self, DebError>

Add an extra file to the control archive.

This is usually used to add maintainer scripts. Maintainer scripts are special scripts like preinst and postrm that are executed during certain activities.

Source

pub fn add_data_file<P: AsRef<Path>, R: Read>( self, path: P, reader: &mut R, ) -> Result<Self, DebError>

Add a data file to be indexed.

This should be called for every file in the corresponding data.tar archive in the .deb archive.

path is the relative path the file will be installed to. reader is a reader to obtain the file content.

This method has the side-effect of computing the checksum for the path so a checksums entry can be written.

Source

pub fn set_mtime(self, time: Option<SystemTime>) -> Self

Source

pub fn write<W: Write>(&self, writer: &mut W) -> Result<(), DebError>

Write the control.tar file to a writer.

Auto Trait Implementations§

§

impl<'a> Freeze for ControlTarBuilder<'a>

§

impl<'a> RefUnwindSafe for ControlTarBuilder<'a>

§

impl<'a> Send for ControlTarBuilder<'a>

§

impl<'a> Sync for ControlTarBuilder<'a>

§

impl<'a> Unpin for ControlTarBuilder<'a>

§

impl<'a> UnwindSafe for ControlTarBuilder<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.