Skip to main content

GCDatapoint

Struct GCDatapoint 

#[repr(transparent)]
pub struct GCDatapoint(sGCDatapoint);
Expand description

Safe zero cost abstraction over the [gc_abi_sys::GCDatapoint] This struct is meant to be initialized only by the gateway or another internal module.

Tuple Fields§

§0: sGCDatapoint

Implementations§

§

impl GCDatapoint

pub fn new(id: u64, name: &str, description: &str, unit: &str) -> GCDatapoint

pub fn get_c_name(&self) -> &CStr

Get the CStr representation of the name

pub fn get_c_description(&self) -> &CStr

Get the CStr representation of the description

pub fn get_c_unit(&self) -> &CStr

Get the CStr representation of the unit

pub fn get_name(&self) -> String

Get the name as a native String

pub fn get_description(&self) -> String

Get the description as a native String

pub fn get_unit(&self) -> String

Get the unit as a native String

pub fn get_id(&self) -> u64

Get the ID of the datapoint

Trait Implementations§

§

impl Debug for GCDatapoint

§

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

Formats the value using the given formatter. Read more
§

impl Drop for GCDatapoint

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl GCAbiConversion for GCDatapoint

§

type CType = sGCDatapoint

§

fn from_c(c_type: <GCDatapoint as GCAbiConversion>::CType) -> GCDatapoint

Convert from the C type to the Rust type
§

fn into_c(self) -> <GCDatapoint as GCAbiConversion>::CType

Convert from the Rust type to the C type
§

fn ref_c(&self) -> &Self::CType

Get a reference to the C type
§

fn from_c_ref(c_type: &Self::CType) -> &Self

Get a reference to the converted type
§

unsafe fn from_c_ptr(ptr: *const Self::CType) -> &'static Self

Get a mutable reference to the C type Read more
§

unsafe fn as_ptr(&self) -> *const Self::CType

Get a immutable reference to the C type Read more
§

unsafe fn as_mut_ptr(&mut self) -> *mut Self::CType

Get a mutable reference to the C type Read more

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> 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.