Var

Struct Var 

Source
pub struct Var { /* private fields */ }
Expand description

Var is a handle to a variable or telemetry data point.

Var’s are obtained via the find_var() method on Session, and are then valid for the lifetime of that Session. They can only be used with the Session that generated them. In addition the metadata available from Var, Var is also used as a key to read the current value for the item.

Implementations§

Source§

impl Var

Source

pub fn var_type(&self) -> VarType

returns the data type of this item, e.g. Float, Int

Source

pub fn name(&self) -> &str

Source

pub fn desc(&self) -> &str

Source

pub fn unit(&self) -> &str

Source

pub fn count(&self) -> usize

returns the count. This indicates how many instances of the datapoint value are associated with this variable. Typically its one, but there is a small subset of points that have more, typically 64 (i.e. one per driver). Values for Var’s with a count > 1 are returned as slices of the relevent type

Trait Implementations§

Source§

impl Debug for Var

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Var

§

impl RefUnwindSafe for Var

§

impl Send for Var

§

impl Sync for Var

§

impl Unpin for Var

§

impl UnwindSafe for Var

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.