Struct dir_structure::DirChild
source · pub struct DirChild<T>where
T: DirStructureItem,{ /* private fields */ }Expand description
A single child of a DirChildren structure.
Implementations§
source§impl<T> DirChild<T>where
T: DirStructureItem,
impl<T> DirChild<T>where T: DirStructureItem,
sourcepub fn new(file_name: impl Into<OsString>, value: T) -> Self
pub fn new(file_name: impl Into<OsString>, value: T) -> Self
Creates a new DirChild with the specified file name and value.
sourcepub fn file_name(&self) -> &OsString
pub fn file_name(&self) -> &OsString
Gets the file name of the child (or the name of the directory; the last segment in the path).
sourcepub fn file_name_mut(&mut self) -> &mut OsString
pub fn file_name_mut(&mut self) -> &mut OsString
Gets the file name of the child (or the name of the directory; the last segment in the path).
Mutable reference version of Self::file_name.
sourcepub fn value(&self) -> &T
pub fn value(&self) -> &T
Gets the value of the child.
This is the parsed value of the file / directory.
sourcepub fn value_mut(&mut self) -> &mut T
pub fn value_mut(&mut self) -> &mut T
Gets the value of the child.
This is the parsed value of the file / directory.
Mutable reference version of Self::value.
Auto Trait Implementations§
impl<T> RefUnwindSafe for DirChild<T>where T: RefUnwindSafe,
impl<T> Send for DirChild<T>where T: Send,
impl<T> Sync for DirChild<T>where T: Sync,
impl<T> Unpin for DirChild<T>where T: Unpin,
impl<T> UnwindSafe for DirChild<T>where T: UnwindSafe,
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