Skip to main content

HostInfo

Struct HostInfo 

Source
pub struct HostInfo { /* private fields */ }
Expand description

Human-readable information and description about the host.

This information is passed to plugins at instantiation time by PluginInstance::new.

See the new method’s documentation for an example of how to instantiate it.

Implementations§

Source§

impl HostInfo

Source

pub fn new( name: &str, vendor: &str, url: &str, version: &str, ) -> Result<Self, NulError>

Creates a new host information container from its components.

  • name: The name of the host. Example: "Bitwig Studio"
  • vendor: The software vendor of the host. Example: "Bitwig GmbH"
  • url: Example: "https://bitwig.com"
  • version: The version string of the host. Example: "4.3.2"

All parameters are copied into new string buffers.

§Errors

All parameters must not contain the null (\0) character. If any of them do, a NulError is returned.

§Example
use clack_host::host::HostInfo;

let info = HostInfo::new("Bitwig Studio", "Bitwig GmbH", "https://bitwig.com", "4.3.2");
Source

pub fn new_from_cstring( name: CString, vendor: CString, url: CString, version: CString, ) -> Self

An infallible version of new.

This method takes ownership of preexisting CString buffers, and therefore cannot fail from null byte errors, and performs fewer allocations compared to new.

See the documentation for new for more information about the arguments.

Source

pub fn from_plugin(info: &HostInfo<'_>) -> Self

Available on crate feature clack-plugin only.

Creates a new host information container using the data originally provided to a plugin.

Source

pub fn name(&self) -> &CStr

Returns the name of the host.

Source

pub fn vendor(&self) -> &CStr

Returns the software vendor of the host.

Source

pub fn url(&self) -> &CStr

Returns the host’s web homepage’s URL.

Source

pub fn version(&self) -> &CStr

Returns the version string of the host

Trait Implementations§

Source§

impl Clone for HostInfo

Source§

fn clone(&self) -> HostInfo

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 Debug for HostInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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.