[−][src]Trait phollaits::TarBuilderExt
Required methods
pub fn append_file<P: Into<String>>(&mut self, path: P)
[src]
appends a file to an archive.
Example
extern crate tar; extern crate phollaits; use phollaits::*; use tar::Builder; fn main() { let b = Builder::new("/tmp/archive.tar"); b.append_file("/home/ph0llux/example01.png"); //appends a file (absoulte path) b.append("example02.png"); //appends a file (relative path) b.close_archive(); }
pub fn append_text<F: Into<String>, T: Into<String>>(
&mut self,
filename: F,
text: T
) -> Result<()>
[src]
&mut self,
filename: F,
text: T
) -> Result<()>
appends a text (string) to an archive.
Example
extern crate tar; extern crate phollaits; use phollaits::*; use tar::Builder; fn main() { let b = Builder::new("/tmp/archive.tar"); let content = "this is an example text"; let filename_in_archive = "/home/ph0llux/example01.txt"; b.append_text(filename_in_archive, content); b.close_archive(); }
pub fn close_archive(self) -> Result<File>
[src]
This method simply calls the into_inner() method. This method is used solely for embellishment purposes. you can call the into_inner() method directly.
Implementations on Foreign Types
impl TarBuilderExt for Builder<File>
[src]
pub fn append_file<P: Into<String>>(&mut self, path: P)
[src]
pub fn append_text<F: Into<String>, T: Into<String>>(
&mut self,
filename: F,
text: T
) -> Result<()>
[src]
&mut self,
filename: F,
text: T
) -> Result<()>