pub struct FileApi { /* private fields */ }Expand description
The File library selected for this process.
Cloning is cheap. Every clone, and every player and recorder created from one, keeps the NDI runtime initialized.
Implementations§
Source§impl FileApi
impl FileApi
Sourcepub fn new(ndi: &Ndi, options: &FileApiOptions) -> Result<Self>
pub fn new(ndi: &Ndi, options: &FileApiOptions) -> Result<Self>
Find and load the File library that accompanies ndi’s runtime.
The first successful call selects the library for the process; later calls return the same one. No player or recorder is created and nothing is advertised.
§Errors
Error::RuntimeLoadFailedwhen no usable File library can be loaded. Itscrate::LoadFailurerecords typed attempts and whether any native code loaded before being refused. This is retryable, and the rest of the crate keeps working.Error::RuntimeConflictwhen the selected NDI runtime is not one the File library can accompany,optionsnames a library other than the one already selected, or native loading re-enters File library selection on the same thread.crate::SelectionFailure::kindnames thecrate::SelectionConflict; itsDisplaygives the diagnostic text.Error::InvalidInputwhenoptionsnames a relative path.
Sourcepub fn library_path(&self) -> Option<&Path>
pub fn library_path(&self) -> Option<&Path>
Canonical loaded file, with links resolved, or None for a linked SDK.
Uses the platform’s ordinary path form; Windows extended syntax is kept
only when needed to express the same file.
Sourcepub fn status(&self, family: FileFamily) -> CapabilityStatus
pub fn status(&self, family: FileFamily) -> CapabilityStatus
Whether the selected library provides family.
CapabilityStatus::Unavailable with
SymbolUnavailable
when it does not export one of the family’s entry points. Every
operation that needs the family then fails with
Error::UnsupportedCapability, and keeps failing: the library stays
selected for the life of the process.
Sourcepub fn supports(&self, family: FileFamily) -> bool
pub fn supports(&self, family: FileFamily) -> bool
Whether the selected library provides family; see
status.
Sourcepub fn require_family(&self, family: FileFamily) -> Result<()>
pub fn require_family(&self, family: FileFamily) -> Result<()>
Require the complete native entry-point family.
Returns Error::UnsupportedCapability with the missing symbol when
the selected File library does not provide family.