pub enum Value<'a> {
Char(u8),
Chars(&'a [u8]),
Bool(bool),
Bools(&'a [bool]),
Int(i32),
Ints(&'a [i32]),
Bitfield(i32),
Bitfields(&'a [i32]),
Float(f32),
Floats(&'a [f32]),
Double(f64),
Doubles(&'a [f64]),
}Expand description
An instance of a value for a variable.
Variants§
Char(u8)
Chars(&'a [u8])
Bool(bool)
Bools(&'a [bool])
Int(i32)
Ints(&'a [i32])
Bitfield(i32)
Bitfields(&'a [i32])
Float(f32)
Floats(&'a [f32])
Double(f64)
Doubles(&'a [f64])
Implementations§
Source§impl<'a> Value<'a>
impl<'a> Value<'a>
pub fn as_f64(&self) -> Result<f64, Error>
pub fn as_f32(&self) -> Result<f32, Error>
pub fn as_i32(&self) -> Result<i32, Error>
pub fn as_bool(&self) -> Result<bool, Error>
pub fn as_u8(&self) -> Result<u8, Error>
pub fn as_f64s(&self) -> Result<&'a [f64], Error>
pub fn as_f32s(self) -> Result<&'a [f32], Error>
pub fn as_i32s(&self) -> Result<&'a [i32], Error>
pub fn as_bools(&self) -> Result<&'a [bool], Error>
pub fn as_u8s(&self) -> Result<&'a [u8], Error>
Trait Implementations§
Source§impl TryFrom<Value<'_>> for CameraState
impl TryFrom<Value<'_>> for CameraState
Source§impl TryFrom<Value<'_>> for CarLeftRight
impl TryFrom<Value<'_>> for CarLeftRight
Source§impl TryFrom<Value<'_>> for EngineWarnings
impl TryFrom<Value<'_>> for EngineWarnings
Source§impl TryFrom<Value<'_>> for PitSvcFlags
impl TryFrom<Value<'_>> for PitSvcFlags
Source§impl TryFrom<Value<'_>> for PitSvcStatus
impl TryFrom<Value<'_>> for PitSvcStatus
Source§impl TryFrom<Value<'_>> for SessionState
impl TryFrom<Value<'_>> for SessionState
Source§impl TryFrom<Value<'_>> for TrackLocation
impl TryFrom<Value<'_>> for TrackLocation
Source§impl TryFrom<Value<'_>> for TrackSurface
impl TryFrom<Value<'_>> for TrackSurface
impl<'a> Copy for Value<'a>
impl<'a> StructuralPartialEq for Value<'a>
Auto Trait Implementations§
impl<'a> Freeze for Value<'a>
impl<'a> RefUnwindSafe for Value<'a>
impl<'a> Send for Value<'a>
impl<'a> Sync for Value<'a>
impl<'a> Unpin for Value<'a>
impl<'a> UnwindSafe for Value<'a>
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