package_directory

Trait OnRootDirDrop

Source
pub trait OnRootDirDrop:
    Send
    + Sync
    + Debug { }
Expand description

RootDir takes an optional OnRootDirDrop value that will be dropped when the RootDir is dropped.

This is useful because the VFS functions operate on Arc<RootDir>s (and create clones of the Arcs in response to e.g. Directory::open calls), so this allows clients to perform actions when the last clone of the Arc<RootDir> is dropped (which is frequently when the last fuchsia.io connection closes).

The ExecutionScope used to serve the connection could also be used to notice when all the Arc<RootDir>s are dropped, but only if the Arc<RootDir>s are only used by VFS. Tracking when the RootDir itself is dropped allows non VFS uses of the Arc<RootDir>s.

Implementors§

Source§

impl<T> OnRootDirDrop for T
where T: Send + Sync + Debug,