/// Attaches Inspect nodes following a standard hierarchy, returning ownership of the newly
/// created LazyNodes.
Attaches Inspect nodes following a standard hierarchy, returning ownership of the newly
created LazyNodes.
Attaches Inspect nodes following a standard hierarchy returning ownership of the newly created LazyNodes .
pub fn new(fs: Weak<dyn FsInspect + Send + Sync + 'static>, root: &Node) -> FsInspectTree {
        let fs_clone = fs.clone();
        let info_node = root.create_lazy_child(INFO_NODE_NAME, move || {
            let fs_clone = fs_clone.clone();
            async move {
                let inspector = fuchsia_inspect::Inspector::new();
                if let Some(fs) = fs_clone.upgrade() {
                    fs.get_info_data().record_into(inspector.root());
                }
                Ok(inspector)
            }
            .boxed()
        });
        let fs_clone = fs.clone();
        let usage_node = root.create_lazy_child(USAGE_NODE_NAME, move || {
            let fs_clone = fs_clone.clone();
            async move {
                let inspector = fuchsia_inspect::Inspector::new();
                if let Some(fs) = fs_clone.upgrade() {
                    fs.get_usage_data().record_into(inspector.root());
                }
                Ok(inspector)
            }
            .boxed()
        });
        let fs_clone = fs.clone();
        let volume_node = root.create_lazy_child(VOLUME_NODE_NAME, move || {
            let fs_clone = fs_clone.clone();
            async move {
                let inspector = fuchsia_inspect::Inspector::new();
                if let Some(fs) = fs_clone.upgrade() {
                    fs.get_volume_data().record_into(inspector.root());
                }
                Ok(inspector)
            }
            .boxed()
        });
        FsInspectTree { _info: info_node, _usage: usage_node, _volume: volume_node }
    }
pub fn new ( fs : Weak < dyn FsInspect + Send + Sync + ' static > , root : & Node ) -> FsInspectTree { let fs_clone = fs . clone ( ) ; let info_node = root . create_lazy_child ( INFO_NODE_NAME , move | | { let fs_clone = fs_clone . clone ( ) ; async move { let inspector = fuchsia_inspect :: Inspector :: new ( ) ; if let Some ( fs ) = fs_clone . upgrade ( ) { fs . get_info_data ( ) . record_into ( inspector . root ( ) ) ; } Ok ( inspector ) } . boxed ( ) } ) ; let fs_clone = fs . clone ( ) ; let usage_node = root . create_lazy_child ( USAGE_NODE_NAME , move | | { let fs_clone = fs_clone . clone ( ) ; async move { let inspector = fuchsia_inspect :: Inspector :: new ( ) ; if let Some ( fs ) = fs_clone . upgrade ( ) { fs . get_usage_data ( ) . record_into ( inspector . root ( ) ) ; } Ok ( inspector ) } . boxed ( ) } ) ; let fs_clone = fs . clone ( ) ; let volume_node = root . create_lazy_child ( VOLUME_NODE_NAME , move | | { let fs_clone = fs_clone . clone ( ) ; async move { let inspector = fuchsia_inspect :: Inspector :: new ( ) ; if let Some ( fs ) = fs_clone . upgrade ( ) { fs . get_volume_data ( ) . record_into ( inspector . root ( ) ) ; } Ok ( inspector ) } . boxed ( ) } ) ; FsInspectTree { _info : info_node , _usage : usage_node , _volume : volume_node } }
Attaches Inspect nodes following a standard hierarchy, returning ownership of the newly
created LazyNodes.
Attaches Inspect nodes following a standard hierarchy returning ownership of the newly created LazyNodes .
fs
Weak<dyn FsInspect + Send + Sync + 'static>
root
&Node