#[non_exhaustive]pub enum PropValue {
Bool(bool),
Int(i64),
Uint(u64),
Double(f64),
Fraction(i32, i32),
Str(String),
Flags(Vec<String>),
}Expand description
A runtime property value. The variants mirror PropKind.
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.
Bool(bool)
Int(i64)
Uint(u64)
Double(f64)
Fraction(i32, i32)
(numerator, denominator).
Str(String)
Flags(Vec<String>)
The nicks of a set-valued property, in the order they were written.
Implementations§
Source§impl PropValue
impl PropValue
Sourcepub fn parse(kind: PropKind, text: &str) -> Result<PropValue, PropError>
pub fn parse(kind: PropKind, text: &str) -> Result<PropValue, PropError>
Parse a textual value (as it appears in a gst-launch pipeline) for the
given PropKind. true/false for bools; n/d for fractions; a bare
integer is also accepted as a fraction n/1. The string kind takes the
text verbatim.
Sourcepub fn as_fraction(&self) -> Option<(i32, i32)>
pub fn as_fraction(&self) -> Option<(i32, i32)>
Borrow the value as a (num, den) fraction, if it is one.
Trait Implementations§
impl StructuralPartialEq for PropValue
Auto Trait Implementations§
impl Freeze for PropValue
impl RefUnwindSafe for PropValue
impl Send for PropValue
impl Sync for PropValue
impl Unpin for PropValue
impl UnsafeUnpin for PropValue
impl UnwindSafe for PropValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more