PluginStore

Struct PluginStore 

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

Dynamic plugin store.

This structure scans various directories upon its construction and contains a list of various plugins that could be loaded.

Implementations§

Source§

impl PluginStore

Source

pub fn new() -> Self

Create a new PluginStore.

Source

pub fn scan_dir(&mut self, dir: PathBuf) -> Result<&mut Self>

Scan a directory and collect all plugins inside of it.

Source

pub fn load(&mut self, path: PathBuf) -> &mut Self

Adds a single library to the store

§Safety

Same as previous functions - compiler can not guarantee the safety of third party library implementations.

Source

pub fn available_decoders(&self) -> Vec<String>

Returns the names of all currently available decoders that can be used.

Source

pub fn available_estimators(&self) -> Vec<String>

Returns the names of all currently available estimators that can be used.

Source

pub fn available_detectors(&self) -> Vec<String>

Returns the names of all currently available detectors that can be used.

Source

pub fn create_decoder(&self, name: &str, args: String) -> Result<DecoderPlugin>

Create a new instance of a decoder.

Source

pub fn create_estimator( &self, name: &str, args: String, ) -> Result<EstimatorPlugin>

Create a new instance of motion estimator.

Source

pub fn create_detector( &self, name: &str, args: String, ) -> Result<DetectorPlugin>

Create a new instance of motion detector.

Trait Implementations§

Source§

impl Default for PluginStore

Source§

fn default() -> Self

Returns the “default value” for a type. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, F> From2<T> for F
where T: Into<F>,

Source§

fn from2(other: T) -> F

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> GenericTypeBounds for T