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
impl RuntimeOptions
Sourcepub fn clear_library_path(self) -> Self
pub fn clear_library_path(self) -> Self
Restore the normal library search instead of an explicit path.
Sourcepub fn clear_edition(self) -> Self
pub fn clear_edition(self) -> Self
Accept either SDK edition instead of requiring one.
Sourcepub fn configured_library_path(&self) -> Option<&Path>
pub fn configured_library_path(&self) -> Option<&Path>
Requested exact library path, or None for the normal search.
Sourcepub fn configured_edition(&self) -> Option<SdkEdition>
pub fn configured_edition(&self) -> Option<SdkEdition>
Requested edition, or None to accept either edition.
Sourcepub fn new() -> Self
pub fn new() -> Self
The default options: the runtime library of either edition, from the documented search.
Sourcepub fn library_path(self, path: impl Into<PathBuf>) -> Self
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.
Sourcepub fn edition(self, edition: SdkEdition) -> Self
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.