pub struct HostInfo<'a> { /* private fields */ }Expand description
Various information about the host, provided at plugin instantiation time.
Implementations§
Source§impl<'a> HostInfo<'a>
impl<'a> HostInfo<'a>
Sourcepub const fn clap_version(&self) -> ClapVersion
pub const fn clap_version(&self) -> ClapVersion
The ClapVersion the host uses.
Sourcepub const fn name(&self) -> Option<&'a CStr>
pub const fn name(&self) -> Option<&'a CStr>
A user-friendly name for the host (e.g. “Bitwig Studio”).
This should always be set by the host.
Sourcepub const fn vendor(&self) -> Option<&'a CStr>
pub const fn vendor(&self) -> Option<&'a CStr>
The host’s vendor (e.g. “Bitwig GmbH”).
This field is optional.
Sourcepub const fn url(&self) -> Option<&'a CStr>
pub const fn url(&self) -> Option<&'a CStr>
A URL to the host’s webpage.
This field is optional.
Sourcepub const fn version(&self) -> Option<&'a CStr>
pub const fn version(&self) -> Option<&'a CStr>
A version string for the host (e.g. “4.3”).
This should always be set by the host.
Sourcepub fn get_extension<E: Extension<ExtensionSide = HostExtensionSide>>(
&self,
) -> Option<E>
pub fn get_extension<E: Extension<ExtensionSide = HostExtensionSide>>( &self, ) -> Option<E>
Retrieves the host’s pointer to the given extension type E.
This returns None if the host does not support the given extension.
§Example
use clack_extensions::log::{HostLog, LogSeverity};
use clack_plugin::host::HostInfo;
let info: HostInfo = /* ... */
if let Some(log) = info.get_extension::<HostLog>() {
// The log extension is supported by this host
} else {
// The log extension is not supported by this host
}Trait Implementations§
impl<'a> Copy for HostInfo<'a>
Source§fn from(h: HostSharedHandle<'a>) -> Self
fn from(h: HostSharedHandle<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> !Send for HostInfo<'a>
impl<'a> !Sync for HostInfo<'a>
impl<'a> Freeze for HostInfo<'a>
impl<'a> RefUnwindSafe for HostInfo<'a>
impl<'a> Unpin for HostInfo<'a>
impl<'a> UnsafeUnpin for HostInfo<'a>
impl<'a> UnwindSafe for HostInfo<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more