Skip to main content

DeviceOpener

Trait DeviceOpener 

Source
pub trait DeviceOpener: Send + Sync {
    // Required methods
    fn open(&self, rt: &Handle) -> Result<MtpDevice, Error>;
    fn describe(&self) -> String;
}
Expand description

Source of MTP devices for a mount.

Implementations block; they’re called from a FUSE callback thread with a tokio handle to drive the async mtp-rs calls on.

Required Methods§

Source

fn open(&self, rt: &Handle) -> Result<MtpDevice, Error>

Opens the device this mount belongs to. Called once at startup and again on every reconnect attempt, so it must always resolve to the same physical device (match on serial number, not “first available”).

Source

fn describe(&self) -> String

How to name the device in user-facing messages.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§