PropertyValue

Enum PropertyValue 

Source
#[non_exhaustive]
pub enum PropertyValue { Command, Bool(bool), Int(i64), Float(f64), Unsigned(u64), PixelFmt(GenCamPixelBpp), Duration(Duration), EnumStr(String), }
Expand description

A property value

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Command

A command

§

Bool(bool)

A boolean value

§

Int(i64)

An integer value

§

Float(f64)

A floating point value

§

Unsigned(u64)

An unsigned integer value

§

PixelFmt(GenCamPixelBpp)

A pixel format value

§

Duration(Duration)

A duration value

§

EnumStr(String)

An enum string value

Implementations§

Source§

impl PropertyValue

Source

pub fn get_type(&self) -> PropertyType

Get the type of the property value

Source§

impl PropertyValue

Source

pub fn as_bool(&self) -> Option<bool>

Get the value as a boolean

Source

pub fn as_i64(&self) -> Option<i64>

Get the value as an integer

Source

pub fn as_f64(&self) -> Option<f64>

Get the value as a floating point number

Source

pub fn as_u64(&self) -> Option<u64>

Get the value as an unsigned integer

Source

pub fn as_duration(&self) -> Option<Duration>

Get the value as a duration

Source

pub fn as_pixel_fmt(&self) -> Option<GenCamPixelBpp>

Get the value as a pixel format

Source

pub fn as_enum_str(&self) -> Option<&str>

Get the value as an enum string

Trait Implementations§

Source§

impl Clone for PropertyValue

Source§

fn clone(&self) -> PropertyValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PropertyValue

Source§

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

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

impl<'de> Deserialize<'de> for PropertyValue

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&PropertyValue> for PropertyType

Source§

fn from(prop: &PropertyValue) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for PropertyValue

Source§

fn from(val: &str) -> Self

Converts to this type from the input type.
Source§

impl From<()> for PropertyValue

Source§

fn from(_: ()) -> Self

Converts to this type from the input type.
Source§

impl From<Duration> for PropertyValue

Source§

fn from(val: Duration) -> Self

Converts to this type from the input type.
Source§

impl From<GenCamPixelBpp> for PropertyValue

Source§

fn from(val: GenCamPixelBpp) -> Self

Converts to this type from the input type.
Source§

impl From<PropertyValue> for GenSrvValue

Available on crate feature server only.
Source§

fn from(value: PropertyValue) -> Self

Converts to this type from the input type.
Source§

impl From<String> for PropertyValue

Source§

fn from(val: String) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for PropertyValue

Source§

fn from(val: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for PropertyValue

Source§

fn from(val: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for PropertyValue

Source§

fn from(val: i64) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for PropertyValue

Source§

fn from(val: u64) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for PropertyValue

Source§

fn eq(&self, other: &PropertyValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for PropertyValue

Source§

fn partial_cmp(&self, other: &PropertyValue) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for PropertyValue

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<&PropertyValue> for ()

Source§

type Error = PropertyError

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

fn try_from(value: &PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&PropertyValue> for Duration

Source§

type Error = PropertyError

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

fn try_from(value: &PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&PropertyValue> for GenCamPixelBpp

Source§

type Error = PropertyError

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

fn try_from(value: &PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&PropertyValue> for String

Source§

type Error = PropertyError

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

fn try_from(value: &PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&PropertyValue> for bool

Source§

type Error = PropertyError

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

fn try_from(value: &PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&PropertyValue> for f64

Source§

type Error = PropertyError

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

fn try_from(value: &PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&PropertyValue> for i64

Source§

type Error = PropertyError

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

fn try_from(value: &PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&PropertyValue> for u64

Source§

type Error = PropertyError

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

fn try_from(value: &PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PropertyValue> for ()

Source§

type Error = PropertyError

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

fn try_from(value: PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PropertyValue> for Duration

Source§

type Error = PropertyError

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

fn try_from(value: PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PropertyValue> for GenCamPixelBpp

Source§

type Error = PropertyError

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

fn try_from(value: PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PropertyValue> for String

Source§

type Error = PropertyError

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

fn try_from(value: PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PropertyValue> for bool

Source§

type Error = PropertyError

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

fn try_from(value: PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PropertyValue> for f64

Source§

type Error = PropertyError

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

fn try_from(value: PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PropertyValue> for i64

Source§

type Error = PropertyError

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

fn try_from(value: PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PropertyValue> for u64

Source§

type Error = PropertyError

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

fn try_from(value: PropertyValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl StructuralPartialEq for PropertyValue

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.

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 = 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,