Struct realpath_ext::RealpathBuilder
source · 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 more