Struct include_dir::File
source · [−]pub struct File<'a> { /* private fields */ }
Expand description
A file with its contents stored in a &'static [u8]
.
Implementations
sourceimpl<'a> File<'a>
impl<'a> File<'a>
sourcepub fn path(&self) -> &'a Path
pub fn path(&self) -> &'a Path
The full path for this File
, relative to the directory passed to
crate::include_dir!()
.
sourcepub fn contents(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn contents(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
The file’s raw contents.
sourcepub fn contents_utf8(&self) -> Option<&str>
pub fn contents_utf8(&self) -> Option<&str>
The file’s contents interpreted as a string.
Trait Implementations
impl<'a> Eq for File<'a>
impl<'a> StructuralEq for File<'a>
impl<'a> StructuralPartialEq for File<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for File<'a>
impl<'a> Send for File<'a>
impl<'a> Sync for File<'a>
impl<'a> Unpin for File<'a>
impl<'a> UnwindSafe for File<'a>
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