Struct includedir_codegen::IncludeDir
source · pub struct IncludeDir { /* private fields */ }
Implementations
sourceimpl 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 RefUnwindSafe for IncludeDir
impl Send for IncludeDir
impl Sync for IncludeDir
impl Unpin for IncludeDir
impl UnwindSafe for IncludeDir
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more