pub struct PathInputOptions<'a> {
pub home_dir: Option<&'a Path>,
/* private fields */
}Expand description
Options controlling path normalization.
Mirrors TypeScript PathInputOptions. PathInputOptions::new and
Default both default expand_tilde to true.
Fields§
§home_dir: Option<&'a Path>Home directory used for ~ expansion. When None and expansion is
enabled, the process home directory is used.
Implementations§
Source§impl<'a> PathInputOptions<'a>
impl<'a> PathInputOptions<'a>
Sourcepub const fn trim(self, trim: bool) -> Self
pub const fn trim(self, trim: bool) -> Self
Set whether leading/trailing whitespace is trimmed.
Sourcepub const fn trims_input(self) -> bool
pub const fn trims_input(self) -> bool
Return whether leading/trailing whitespace is trimmed.
Sourcepub const fn expand_tilde(self, expand_tilde: bool) -> Self
pub const fn expand_tilde(self, expand_tilde: bool) -> Self
Set whether a leading ~ is expanded.
Sourcepub const fn expands_tilde(self) -> bool
pub const fn expands_tilde(self) -> bool
Return whether a leading ~ is expanded.
Sourcepub const fn home_dir(self, home_dir: Option<&'a Path>) -> Self
pub const fn home_dir(self, home_dir: Option<&'a Path>) -> Self
Set the home directory used for ~ expansion.
Sourcepub const fn strip_at_prefix(self, strip_at_prefix: bool) -> Self
pub const fn strip_at_prefix(self, strip_at_prefix: bool) -> Self
Set whether a leading @ is stripped.
Sourcepub const fn strips_at_prefix(self) -> bool
pub const fn strips_at_prefix(self) -> bool
Return whether a leading @ is stripped.
Sourcepub const fn normalize_unicode_spaces(
self,
normalize_unicode_spaces: bool,
) -> Self
pub const fn normalize_unicode_spaces( self, normalize_unicode_spaces: bool, ) -> Self
Set whether Unicode space variants are normalized.
Sourcepub const fn normalizes_unicode_spaces(self) -> bool
pub const fn normalizes_unicode_spaces(self) -> bool
Return whether Unicode space variants are normalized.
Trait Implementations§
Source§impl<'a> Clone for PathInputOptions<'a>
impl<'a> Clone for PathInputOptions<'a>
Source§fn clone(&self) -> PathInputOptions<'a>
fn clone(&self) -> PathInputOptions<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for PathInputOptions<'a>
Source§impl<'a> Debug for PathInputOptions<'a>
impl<'a> Debug for PathInputOptions<'a>
Auto Trait Implementations§
impl<'a> Freeze for PathInputOptions<'a>
impl<'a> RefUnwindSafe for PathInputOptions<'a>
impl<'a> Send for PathInputOptions<'a>
impl<'a> Sync for PathInputOptions<'a>
impl<'a> Unpin for PathInputOptions<'a>
impl<'a> UnsafeUnpin for PathInputOptions<'a>
impl<'a> UnwindSafe for PathInputOptions<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.