Struct Primitive

Source
pub struct Primitive<ActualType: PrimitiveTypeTag<ActualType> + Default> { /* private fields */ }
Expand description

The object used to represent a pritmive type in the language-neutral protocol database

Implementations§

Source§

impl<T: PrimitiveTypeTag<T> + Default> Primitive<T>

Source

pub fn new() -> Primitive<T>

Create a new type primitive

Source

pub fn get(&self, type_inst: &mut TypeInstanceObject) -> Option<T>

Get a primitive value from the primitive descriptor.

This function will be valid only when it’s called from execution function and there’s type instance object has been created. Otherwise it will returns a failure

  • type_inst: Type instance object where we read the primitive from

Return the read result, None indicates we are unable to read the data

Source

pub fn set(&self, type_inst: &mut TypeInstanceObject, val: T) -> bool

Write a primitive to the primitive descriptor within current task context

This function will be valid only when it’s called from the execution function, because it requires the task context.

  • type_inst: The type instance object where we want to write to

Return the operation result, if the operation has successuflly done.

Auto Trait Implementations§

§

impl<ActualType> Freeze for Primitive<ActualType>

§

impl<ActualType> RefUnwindSafe for Primitive<ActualType>
where ActualType: RefUnwindSafe,

§

impl<ActualType> Send for Primitive<ActualType>
where ActualType: Send,

§

impl<ActualType> Sync for Primitive<ActualType>
where ActualType: Sync,

§

impl<ActualType> Unpin for Primitive<ActualType>
where ActualType: Unpin,

§

impl<ActualType> UnwindSafe for Primitive<ActualType>
where ActualType: UnwindSafe,

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.