Struct realpath_ext::RealpathRawBuilder
source · pub struct RealpathRawBuilder<'a> { /* private fields */ }
Expand description
A “builder” that allows customizing options to realpath_raw()
.
realpath_raw(path, buf, flags)
is equivalent to
RealpathRawBuilder::new().flags(flags).realpath_raw(path, buf)
.
Implementations§
source§impl<'a> RealpathRawBuilder<'a>
impl<'a> RealpathRawBuilder<'a>
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new “builder”.
The returned builder has its flags
empty, and temp_buffer
set to None
.
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.
sourcepub fn temp_buffer(&mut self, tmp: Option<&'a mut [u8]>) -> &mut Self
pub fn temp_buffer(&mut self, tmp: Option<&'a mut [u8]>) -> &mut Self
Set the temporary buffer used to store intermediate results.
It’s recommended to make this buffer somewhat larger than the buf
passed to
Self::realpath_raw()
, since the current algorithm requires a bit of overhead in the
temporary buffer.
If tmp
is None
(default), a temporary buffer of length PATH_MAX + 100
will be
allocated on the stack.
sourcepub fn realpath_raw(
&mut self,
path: &[u8],
buf: &mut [u8]
) -> Result<usize, i32>
pub fn realpath_raw( &mut self, path: &[u8], buf: &mut [u8] ) -> Result<usize, i32>
Canonicalize the path given by path
into the buffer given by buf
.
path
, buf
, and the return value have the same meanings as for realpath_raw()
.