Skip to main content

RuntimeOptions

Struct RuntimeOptions 

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

Which NDI runtime to select; see Runtime::select.

The default options search for the runtime library of either edition in the documented order and accept whichever is found first. On dynamically loaded, non-Apple ELF targets, any runtime already in the process’s global symbol scope must be the selected module; see crate::LoadRefusal::ForeignRuntimeInScope.

§Examples

use grafton_ndi::{Runtime, RuntimeOptions, SdkEdition};

let options = RuntimeOptions::default()
    .library_path("/opt/ndi/lib/libndi.so.6")
    .edition(SdkEdition::Standard);
let runtime = Runtime::select(&options)?;

Implementations§

Source§

impl RuntimeOptions

Source

pub fn clear_library_path(self) -> Self

Restore the normal library search instead of an explicit path.

Source

pub fn clear_edition(self) -> Self

Accept either SDK edition instead of requiring one.

Source

pub fn configured_library_path(&self) -> Option<&Path>

Requested exact library path, or None for the normal search.

Source

pub fn configured_edition(&self) -> Option<SdkEdition>

Requested edition, or None to accept either edition.

Source

pub fn new() -> Self

The default options: the runtime library of either edition, from the documented search.

Source

pub fn library_path(self, path: impl Into<PathBuf>) -> Self

Load exactly this absolute shared-library path.

A path that does not name an existing file is refused before native loading. A failure to load the file is reported without a fallback. A statically linked target has no library to load and rejects an absolute path with Error::RuntimeConflict. A relative path returns Error::InvalidInput on every target, before an implementation is selected. On dynamically loaded, non-Apple ELF targets, a different runtime already linked or preloaded into the global symbol scope causes crate::SelectionConflict::ForeignRuntimeInScope before this file is opened. Aliases identifying the same loaded module are accepted.

Source

pub fn edition(self, edition: SdkEdition) -> Self

Search only for the runtime library of this SDK edition.

On dynamically loaded targets, requesting SdkEdition::Advanced requires the selected library to export the Advanced SDK entry points. Requesting SdkEdition::Standard never rejects an implementation for exporting more than the Standard SDK does, so an Advanced runtime found under the Standard file name, or named by library_path, meets it. Without a request, the libraries of both editions are sought.

A statically linked target has one implementation, the archive linked at build time. An Advanced request is met only when the build linked the Advanced archive; a Standard request accepts either archive. See SdkEdition for how the build chooses the archive.

Trait Implementations§

Source§

impl Clone for RuntimeOptions

Source§

fn clone(&self) -> Self

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 RuntimeOptions

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RuntimeOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for RuntimeOptions

Source§

impl Hash for RuntimeOptions

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RuntimeOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RuntimeOptions

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.