Skip to main content

HostInfo

Struct HostInfo 

Source
pub struct HostInfo<'a> { /* private fields */ }
Expand description

Various information about the host, provided at plugin instantiation time.

Implementations§

Source§

impl<'a> HostInfo<'a>

Source

pub const unsafe fn from_raw(raw: NonNull<clap_host>) -> Self

Creates a new HostInfo type from a given raw, C FFI compatible pointer.

§Safety

Pointer must be valid for the duration of the 'a lifetime. Moreover, the contents of the clap_host struct must all also be valid.

Source

pub const fn clap_version(&self) -> ClapVersion

The ClapVersion the host uses.

Source

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.

Source

pub const fn vendor(&self) -> Option<&'a CStr>

The host’s vendor (e.g. “Bitwig GmbH”).

This field is optional.

Source

pub const fn url(&self) -> Option<&'a CStr>

A URL to the host’s webpage.

This field is optional.

Source

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.

Source

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
}
Source

pub const fn as_raw(&self) -> &'a clap_host

Returns a raw, C FFI-compatible reference to the host handle.

Trait Implementations§

Source§

impl<'a> Clone for HostInfo<'a>

Source§

fn clone(&self) -> HostInfo<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for HostInfo<'a>

Source§

impl<'a> From<HostSharedHandle<'a>> for HostInfo<'a>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.