pub struct RealpathBuilder { /* private fields */ }
Expand description
A “builder” that allows customizing options to realpath_raw()
.
realpath(path, flags)
is equivalent to RealpathBuilder::new().flags(flags).realpath(path)
.
Implementations§
Source§impl RealpathBuilder
impl RealpathBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new “builder”.
The returned builder has its flags
empty. max_size
will be set to 32768 on WASI, and
PATH_MAX
on other OSes.
Sourcepub fn max_len(&mut self, max_len: usize) -> &mut Self
pub fn max_len(&mut self, max_len: usize) -> &mut Self
Set the maximum path length allowed before failing with ENAMETOOLONG
.
Generally speaking, this is only useful if the OS supports paths longer than PATH_MAX
(for
example, this is the case on WASI).
Note: In some cases, Self::realpath()
may allocate a smaller buffer than this length,
then expand it and retry if resolution fails with ENAMETOOLONG
.
Sourcepub fn flags(&mut self, flags: RealpathFlags) -> &mut Self
pub fn flags(&mut self, flags: RealpathFlags) -> &mut Self
Set the flags used to modify path resolution.
See RealpathFlags
for more information.
Trait Implementations§
Source§impl Clone for RealpathBuilder
impl Clone for RealpathBuilder
Source§fn clone(&self) -> RealpathBuilder
fn clone(&self) -> RealpathBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for RealpathBuilder
impl RefUnwindSafe for RealpathBuilder
impl Send for RealpathBuilder
impl Sync for RealpathBuilder
impl Unpin for RealpathBuilder
impl UnwindSafe for RealpathBuilder
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