pub struct SFile { /* private fields */ }Expand description
An SFile can be constructed from a Path, io::DirEntry, or walkdir::DirEntry and guarantees the following:
- The entry is a file (exists).
- It has a file name.
- The full path is UTF-8 valid.
Implementations§
source§impl SFile
impl SFile
Public file components as str methods.
sourcepub fn to_str(&self) -> &str
pub fn to_str(&self) -> &str
Returns the &str of the path.
NOTE: We know that this must be Some() since the SFile constructor guarantees that the path.to_str() is valid.
sourcepub fn file_name(&self) -> &str
pub fn file_name(&self) -> &str
Returns the &str representation of the file_name()
NOTE: According to the constructors’ contract, this method will never return “” as a file_name() is required for construction.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for SFile
impl Send for SFile
impl Sync for SFile
impl Unpin for SFile
impl UnwindSafe for SFile
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