pub struct PathBufD(/* private fields */);
Expand description
PathBuf
wrapper
Implementations§
Source§impl PathBufD
impl PathBufD
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new PathBufD
with a given capacity.
Sourcepub fn pop(&mut self) -> bool
pub fn pop(&mut self) -> bool
Truncates self
to self.parent
Returns false
and does nothing if self.parent
is None
.
Otherwise, returns true
.
Sourcepub fn set_file_name<S>(&mut self, file_name: S)
pub fn set_file_name<S>(&mut self, file_name: S)
Updates self.file_name
to file_name
Sourcepub fn set_extension<S>(&mut self, extension: S)
pub fn set_extension<S>(&mut self, extension: S)
Updates self.extension
to Some(extension)
or to None
if extension
is empty.
Sourcepub fn as_mut_os_string(&mut self) -> &mut OsString
pub fn as_mut_os_string(&mut self) -> &mut OsString
Yields a mutable reference to the underlying OsString
instance.
Sourcepub fn into_os_string(self) -> OsString
pub fn into_os_string(self) -> OsString
Sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Invokes try_reserve
on the underlying instance of OsString
.
Sourcepub fn reserve_exact(&mut self, additional: usize)
pub fn reserve_exact(&mut self, additional: usize)
Invokes reserve_exact
on the underlying instance of OsString
.
Sourcepub fn try_reserve_exact(
&mut self,
additional: usize,
) -> Result<(), TryReserveError>
pub fn try_reserve_exact( &mut self, additional: usize, ) -> Result<(), TryReserveError>
Invokes try_reserve_exact
on the underlying instance of OsString
.
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Invokes shrink_to_fit
on the underlying instance of OsString
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PathBufD
impl<'de> Deserialize<'de> for PathBufD
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PathBufD
impl StructuralPartialEq for PathBufD
Auto Trait Implementations§
impl Freeze for PathBufD
impl RefUnwindSafe for PathBufD
impl Send for PathBufD
impl Sync for PathBufD
impl Unpin for PathBufD
impl UnwindSafe for PathBufD
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