Skip to main content

VmbSystem

Struct VmbSystem 

Source
pub struct VmbSystem<R: VmbRuntime> { /* private fields */ }
Expand description

Owns the Vimba X runtime lifecycle.

On construction, calls VmbRuntime::startup; on drop, calls VmbRuntime::shutdown.

Implementations§

Source§

impl<R: VmbRuntime> VmbSystem<R>

Source

pub fn startup(runtime: R) -> Result<Self>

Start the Vimba runtime with the given backend.

Returns crate::VmbError::AlreadyStarted if another VmbSystem built on the same process-global runtime is still alive (applies to VmbFfiRuntime — fakes are per-instance).

Source

pub fn runtime(&self) -> &R

Borrow the underlying runtime. Rarely needed by user code — most operations are exposed directly on VmbSystem, Camera, or DiscoveryRegistration.

Source

pub fn list_cameras(&self) -> Result<Vec<CameraInfo>>

Enumerate currently-visible cameras.

Source

pub fn open_camera(&self, id: &str) -> Result<Camera<R>>

Open a camera by its transport-layer ID.

Source

pub fn register_discovery<F>( &self, callback: F, ) -> Result<DiscoveryRegistration<R>>
where F: Fn(DiscoveryEvent) + Send + Sync + 'static,

Register a camera-discovery subscription; the callback is invoked for every plug / unplug / reachability event the runtime surfaces.

Trait Implementations§

Source§

impl<R: VmbRuntime> Debug for VmbSystem<R>

Source§

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

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

impl<R: VmbRuntime> Drop for VmbSystem<R>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<R> Freeze for VmbSystem<R>

§

impl<R> RefUnwindSafe for VmbSystem<R>
where R: RefUnwindSafe,

§

impl<R> Send for VmbSystem<R>

§

impl<R> Sync for VmbSystem<R>

§

impl<R> Unpin for VmbSystem<R>

§

impl<R> UnsafeUnpin for VmbSystem<R>

§

impl<R> UnwindSafe for VmbSystem<R>
where R: RefUnwindSafe,

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, 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, 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.