Skip to main content

Configuration

Struct Configuration 

Source
pub struct Configuration {
    pub identity: DocumentIdentity,
    pub values: Vec<SavedValue>,
    pub omitted: Vec<Omission>,
}
Expand description

A camera configuration: the streamable features’ values, and the camera they were read from.

Fields§

§identity: DocumentIdentity

The camera the configuration was saved from, as its XML names it. Empty fields when a file does not say.

§values: Vec<SavedValue>

The values, in the order a restore writes them.

§omitted: Vec<Omission>

What a save left out. Written to a file as comments, so a reader sees why a feature is missing; not read back.

Implementations§

Source§

impl Configuration

Source

pub fn to_text(&self) -> String

The configuration as a file, in the layout GenApi’s reference implementation writes (CFeatureBag, ADR-0028):

# {05D8C294-F295-4dfb-9D01-096BD04049F4}
# viva-genicam configuration
# VendorName = Basler
# ModelName = acA1600-20gm
# DeviceXmlVersion = 3.2.1
# not saved: ExposureTime: locked by ExposureAuto
GainSelector<TAB>AnalogAll
Gain<TAB>{GainSelector=DigitalAll}<TAB>9

One value per line, the feature name and the value separated by a tab (<TAB> above); a value read under selectors puts them between the two, in braces. Lines starting with # are comments: the camera’s identity, and what the save left out and why.

Source

pub fn parse(text: &str) -> Result<Self, ParseConfigurationError>

Read a configuration file: ours, or one in the same layout from another GenApi-based tool.

Blank lines and # comments are skipped, and line endings may be \n or \r\n. The camera’s identity is read from the comments this crate writes; a file without them has an empty Configuration::identity. A file of GenApi’s other format (CFeatureBagger) is refused, as is a line with no value.

Trait Implementations§

Source§

impl Clone for Configuration

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 Configuration

Source§

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

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

impl Default for Configuration

Source§

fn default() -> Self

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

impl Eq for Configuration

Source§

impl PartialEq for Configuration

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 Configuration

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more