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>
impl<T: PrimitiveTypeTag<T> + Default> Primitive<T>
Sourcepub fn get(&self, type_inst: &mut TypeInstanceObject) -> Option<T>
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
Sourcepub fn set(&self, type_inst: &mut TypeInstanceObject, val: T) -> bool
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> 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