pub struct Supervisor { /* private fields */ }Expand description
Mounts devices as they arrive and unmounts them as they leave.
Implementations§
Source§impl Supervisor
impl Supervisor
Sourcepub fn new(
config: SupervisorConfig,
source: Arc<dyn DeviceSource>,
rt: Handle,
commands: Sender<Command>,
) -> Self
pub fn new( config: SupervisorConfig, source: Arc<dyn DeviceSource>, rt: Handle, commands: Sender<Command>, ) -> Self
Build a supervisor. commands must be a sender for the same channel
whose receiver goes to Supervisor::run.
Sourcepub fn run(self, commands: Receiver<Command>)
pub fn run(self, commands: Receiver<Command>)
Handle commands until Command::Stop arrives or every sender is
dropped, then unmount everything.
Blocks the calling thread. See the module docs on why it can’t run inside a tokio runtime.
Sourcepub fn mounted_keys(&self) -> Vec<String>
pub fn mounted_keys(&self) -> Vec<String>
Devices currently mounted, by key. Used by tests.
Auto Trait Implementations§
impl !RefUnwindSafe for Supervisor
impl !UnwindSafe for Supervisor
impl Freeze for Supervisor
impl Send for Supervisor
impl Sync for Supervisor
impl Unpin for Supervisor
impl UnsafeUnpin for Supervisor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more