/// Lookup the parent of a namespace node.
///
/// Consider using Task::open_file_at or Task::lookup_parent_at rather than
/// calling this function directly.
///
/// This function resolves all but the last component of the given path.
/// The function returns the parent directory of the last component as well
/// as the last component.
///
/// If path is empty, this function returns dir and an empty path.
/// Similarly, if path ends with "." or "..", these components will be
/// returned along with the parent.
///
/// The returned parent might not be a directory.
Lookup the parent of a namespace node.
Consider using Task::open_file_at or Task::lookup_parent_at rather than
calling this function directly.

This function resolves all but the last component of the given path.
The function returns the parent directory of the last component as well
as the last component.

If path is empty, this function returns dir and an empty path.
Similarly, if path ends with "." or "..", these components will be
returned along with the parent.

The returned parent might not be a directory.
Lookup the parent of a namespace node . Consider using Task :: open_file_at or Task :: lookup_parent_at rather than calling this function directly . This function resolves all but the last component of the given path . The function returns the parent directory of the last component as well as the last component . If path is empty this function returns dir and an empty path . Similarly if path ends with " . " or " .. " these components will be returned along with the parent . The returned parent might not be a directory .
pub fn lookup_parent<'a>(
        &self,
        context: &mut LookupContext,
        dir: NamespaceNode,
        path: &'a FsStr,
    ) -> Result<(NamespaceNode, &'a FsStr), Errno> {
        let mut current_node = dir;
        let mut it = path.split(|c| *c == b'/');
        let mut current_path_component = it.next().unwrap_or(b"");
        while let Some(next_path_component) = it.next() {
            current_node = current_node.lookup_child(context, self, current_path_component)?;
            current_path_component = next_path_component;
        }
        Ok((current_node, current_path_component))
    }
pub fn lookup_parent < ' a > ( & self , context : & mut LookupContext , dir : NamespaceNode , path : & ' a FsStr , ) -> Result < ( NamespaceNode , & ' a FsStr ) , Errno > { let mut current_node = dir ; let mut it = path . split ( | c | * c == b'/' ) ; let mut current_path_component = it . next ( ) . unwrap_or ( b" " ) ; while let Some ( next_path_component ) = it . next ( ) { current_node = current_node . lookup_child ( context , self , current_path_component ) ? ; current_path_component = next_path_component ; } Ok ( ( current_node , current_path_component ) ) }
Lookup the parent of a namespace node.
Lookup the parent of a namespace node .
&self
context
&mut LookupContext
dir
NamespaceNode
path
&'a FsStr