feat!: Expanded add_methods to extra_user_data

Instead of being a function it now expects a struct with the
PartialUserData trait implemented. This in part ensures the correct
function signature.

It also adds another optional function to PartialUserData that returns
definitions for the added methods.
This commit is contained in:
2025-10-15 00:44:06 +02:00
parent 4b76bde2a6
commit cd470cadaf
5 changed files with 86 additions and 47 deletions

View File

@@ -8,6 +8,10 @@ pub trait PartialUserData<T> {
fn interface_name() -> Option<&'static str> {
None
}
fn definitions() -> Option<String> {
None
}
}
pub struct Device;