pub unsafe trait Extension:
Sized
+ Copy
+ Send
+ Sync
+ 'static {
type ExtensionSide: ExtensionSide;
const IDENTIFIERS: &'static [&'static CStr];
// Required method
unsafe fn from_raw(raw: RawExtension<Self::ExtensionSide>) -> Self;
}Expand description
A type representing a CLAP extension pointer.
The role of this trait is to tie a type to a standard CLAP extension identifier. This is then used by the Clack APIs to always match the correct extension type from its identifier.
This trait also defines how an extension pointer should be transformed to a reference to the extension type.
§Safety
The IDENTIFIER must match the official identifier for the given
extension, otherwise the extension data could be misinterpreted, leading to Undefined Behavior.
Required Associated Constants§
Sourceconst IDENTIFIERS: &'static [&'static CStr]
const IDENTIFIERS: &'static [&'static CStr]
The standard identifier for this extension.
Required Associated Types§
Sourcetype ExtensionSide: ExtensionSide
type ExtensionSide: ExtensionSide
Whether this is a host extension or a plugin extension
Required Methods§
Sourceunsafe fn from_raw(raw: RawExtension<Self::ExtensionSide>) -> Self
unsafe fn from_raw(raw: RawExtension<Self::ExtensionSide>) -> Self
Returns an instance of the extension from a given extension pointer.
§Safety
Callers must ensure the extension pointer points to the extension type that matches
Self::IDENTIFIERS.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".