pub struct UniversalPluginId<'a> {
pub abi: &'a CStr,
pub id: &'a CStr,
}Expand description
Fields§
§abi: &'a CStrThe ABI string.
It can be e.g. “clap”, “vst2”, “vst3”, “au”, etc.
See UniversalPluginAbi::abi_str for known values this field can take.
id: &'a CStrThe ID string of the plugin.
This is formatted differently depending on the ABI type:
- CLAP: Use the plugin ID (e.g.
"com.u-he.diva") - AU: Format the string as “type:subt:manu” (e.g.
"aumu:SgXT:VmbA") - VST2: Format the ID as a signed 32-bit integer (e.g.
"-4382976") - VST3: Format the ID as a hyphenated UUID (e.g.
"123e4567-e89b-12d3-a456-426614174000")
Implementations§
Source§impl<'a> UniversalPluginId<'a>
impl<'a> UniversalPluginId<'a>
Sourcepub const unsafe fn from_raw(
raw: clap_universal_plugin_id,
) -> Option<UniversalPluginId<'a>>
pub const unsafe fn from_raw( raw: clap_universal_plugin_id, ) -> Option<UniversalPluginId<'a>>
Creates a UniversalPluginId from its raw, C-FFI compatible representation.
If either of the string pointers within the given struct are NULL, this returns None.
§Safety
Either of the contained pointers can be NULL, in which case the following requirements do
not apply.
Both pointers must point to valid C strings, and remain valid for the duration of the 'a lifetime.
See the documentation of CStr::from_ptr for the exhaustive list of safety requirements.
Sourcepub const unsafe fn from_raw_ptr(
ptr: *const clap_universal_plugin_id,
) -> Option<UniversalPluginId<'a>>
pub const unsafe fn from_raw_ptr( ptr: *const clap_universal_plugin_id, ) -> Option<UniversalPluginId<'a>>
Creates a UniversalPluginId from a pointer to its raw, C-FFI compatible representation.
If the given ptr, or either of the string pointers within the pointed struct are NULL, this returns None.
This function is a version of the from_raw method, except it allows to read
directly from a raw pointer without actually borrowing it, which may be slightly safer.
§Safety
The given ptr must be well-aligned and valid for that.
On top of that, the clap_universal_plugin_id value it points to must also satisfy the
safety requirements of the from_raw method.
Sourcepub const fn clap(id: &'a CStr) -> UniversalPluginId<'a>
pub const fn clap(id: &'a CStr) -> UniversalPluginId<'a>
Creates a UniversalPluginId for a CLAP plugin with a given id.
Sourcepub const fn abi(&self) -> Option<UniversalPluginAbi>
pub const fn abi(&self) -> Option<UniversalPluginAbi>
Returns the UniversalPluginAbi matching this ID’s plugin ABI.
If the ABI type string doesn’t match a known UniversalPluginAbi variant, this returns
None.
Sourcepub const fn to_raw(&self) -> clap_universal_plugin_id
pub const fn to_raw(&self) -> clap_universal_plugin_id
Returns a raw, C-FFI compatible representation of this ID.
The pointers contained in this struct are valid for the 'a lifetime.
Trait Implementations§
Source§impl<'a> Clone for UniversalPluginId<'a>
impl<'a> Clone for UniversalPluginId<'a>
Source§fn clone(&self) -> UniversalPluginId<'a>
fn clone(&self) -> UniversalPluginId<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more