pub trait Function:
Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn driver(&self) -> OsString;
fn dir(&self) -> FunctionDir;
fn register(&self) -> Result<()>;
// Provided methods
fn pre_removal(&self) -> Result<()> { ... }
fn post_removal(&self, _dir: &Path) -> Result<()> { ... }
}Expand description
USB gadget function.
Required Methods§
Sourcefn dir(&self) -> FunctionDir
fn dir(&self) -> FunctionDir
Function directory.
Provided Methods§
Sourcefn pre_removal(&self) -> Result<()>
fn pre_removal(&self) -> Result<()>
Notifies the function that the USB gadget is about to be removed.
Sourcefn post_removal(&self, _dir: &Path) -> Result<()>
fn post_removal(&self, _dir: &Path) -> Result<()>
Notifies the function that the USB gadget has been removed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".