logo

Function libpd_rs::init

source · []
pub fn init() -> Result<(), InitializationError>
Expand description

Initializes libpd.

This function should be called before any other in this crate. It initializes libpd globally and also initializes ring buffers for internal message passing.

After setting internal hooks, it initializes libpd by calling the underlying C function which is libpd_init. See libpd_queued_init to explore what it is doing.

Note: Support for multi instances of pd is not implemented yet.

Example

use libpd_rs::init;

assert_eq!(init().is_ok(), true);
assert_eq!(init().is_err(), true);

Errors

A second call to this function will return an error.

A list of errors that can occur: