pub struct IncludeDir { /* private fields */ }
Implementations§
Source§impl IncludeDir
impl IncludeDir
Sourcepub fn file<P: AsRef<Path>>(self, path: P, comp: Compression) -> IncludeDir
pub fn file<P: AsRef<Path>>(self, path: P, comp: Compression) -> IncludeDir
Add a single file to the binary. With Gzip compression, the file will be encoded to OUT_DIR first. For chaining, it’s not sensible to return a Result. If any to-be-included files can’t be found, or encoded, this function will panic!.
Sourcepub fn add_file<P: AsRef<Path>>(
&mut self,
path: P,
comp: Compression,
) -> Result<()>
pub fn add_file<P: AsRef<Path>>( &mut self, path: P, comp: Compression, ) -> Result<()>
§Panics
This function panics when CARGO_MANIFEST_DIR or OUT_DIR are not defined.
Sourcepub fn dir<P: AsRef<Path>>(self, path: P, comp: Compression) -> IncludeDir
pub fn dir<P: AsRef<Path>>(self, path: P, comp: Compression) -> IncludeDir
Add a whole directory recursively to the binary.
This function calls file
, and therefore will panic! on missing files.
Sourcepub fn add_dir<P: AsRef<Path>>(
&mut self,
path: P,
comp: Compression,
) -> Result<()>
pub fn add_dir<P: AsRef<Path>>( &mut self, path: P, comp: Compression, ) -> Result<()>
§Panics
This function panics when CARGO_MANIFEST_DIR or OUT_DIR are not defined.
pub fn build(self, out_name: &str) -> Result<()>
Auto Trait Implementations§
impl Freeze for IncludeDir
impl RefUnwindSafe for IncludeDir
impl Send for IncludeDir
impl Sync for IncludeDir
impl Unpin for IncludeDir
impl UnwindSafe for IncludeDir
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