pub struct CoreSyncInstructionHap {}
Expand description

Index: type Description: Triggered when an synchronizing instruction is executed. The Automatically generated struct for the HAP

Implementations§

source§

impl CoreSyncInstructionHap

source

pub fn add_callback<F>(callback: F) -> Result<HapHandle>
where F: FnMut(*mut conf_object_t, int64) + 'static,

Add a callback to be called on each occurrence of this HAP. The callback may capture its environment.

§Arguments
  • callback - The closure to fire as a callback. The closure will be doubly boxed. Any program state accessed inside the closure must have the static lifetime. This is not enforced by the compiler, it is up to the programmer to ensure the soundness of their callback code.
source

pub fn add_callback_object<F>( callback: F, obj: *mut ConfObject, ) -> Result<HapHandle>
where F: FnMut(*mut conf_object_t, int64) + 'static,

Add a callback to be called on each occurrence of this HAP for a specific object. The callback may capture its environment.

§Arguments
  • callback - The closure to fire as a callback. The closure will be doubly boxed. Any program state accessed inside the closure must have the static lifetime. This is not enforced by the compiler, it is up to the programmer to ensure the soundness of their callback code.
  • obj - The object to fire this callback for. This HAP will not trigger the callback when firing on any object other than this one.
source

pub fn add_callback_index<F>(callback: F, index: i64) -> Result<HapHandle>
where F: FnMut(*mut conf_object_t, int64) + 'static,

Add a callback to be called on each occurrence of this HAP for a specific index value. The callback may capture its environment.

Only HAPs which support an index may add a callback in this manner, and the index varies for each HAP. For example, the CoreMagicInstructionHap supports an index equal to the magic value.

§Arguments
  • callback - The closure to fire as a callback. The closure will be doubly boxed. Any program state accessed inside the closure must have the static lifetime. This is not enforced by the compiler, it is up to the programmer to ensure the soundness of their callback code.
  • index - The index value for this HAP: Index: type Description: Triggered when an synchronizing instruction is executed. The
source

pub fn add_callback_range<F>( callback: F, start: i64, end: i64, ) -> Result<HapHandle>
where F: FnMut(*mut conf_object_t, int64) + 'static,

Add a callback to be called on each occurrence of this HAP for a specific index value range. The callback may capture its environment.

Only HAPs which support an index may add a callback in this manner, and the index varies for each HAP. For example, the CoreMagicInstructionHap supports an index equal to the magic value.

§Arguments
  • callback - The closure to fire as a callback. The closure will be doubly boxed. Any program state accessed inside the closure must have the static lifetime. This is not enforced by the compiler, it is up to the programmer to ensure the soundness of their callback code.
  • start - The start of the range of index values for this HAP: Index: type Description: Triggered when an synchronizing instruction is executed. The
  • end - The start of the range of index values for this HAP: Index: type Description: Triggered when an synchronizing instruction is executed. The
source

pub fn add_callback_object_index<F>( callback: F, obj: *mut ConfObject, index: i64, ) -> Result<HapHandle>
where F: FnMut(*mut conf_object_t, int64) + 'static,

Add a callback to be called on each occurrence of this HAP on a specific object for a specific index value. The callback may capture its environment.

Only HAPs which support an index may add a callback in this manner, and the index varies for each HAP. For example, the CoreMagicInstructionHap supports an index equal to the magic value.

§Arguments
  • callback - The closure to fire as a callback. The closure will be doubly boxed. Any program state accessed inside the closure must have the static lifetime. This is not enforced by the compiler, it is up to the programmer to ensure the soundness of their callback code.
  • obj - The object to fire this callback for. This HAP will not trigger the callback when firing on any object other than this one.
  • index - The index value for this HAP: Index: type Description: Triggered when an synchronizing instruction is executed. The
source

pub fn add_callback_object_range<F>( callback: F, obj: *mut ConfObject, start: i64, end: i64, ) -> Result<HapHandle>
where F: FnMut(*mut conf_object_t, int64) + 'static,

Add a callback to be called on each occurrence of this HAP on a specific object for a specific index value range. The callback may capture its environment.

Only HAPs which support an index may add a callback in this manner, and the index varies for each HAP. For example, the CoreMagicInstructionHap supports an index equal to the magic value.

§Arguments
  • callback - The closure to fire as a callback. The closure will be doubly boxed. Any program state accessed inside the closure must have the static lifetime. This is not enforced by the compiler, it is up to the programmer to ensure the soundness of their callback code.
  • obj - The object to fire this callback for. This HAP will not trigger the callback when firing on any object other than this one.
  • start - The start of the range of index values for this HAP: Index: type Description: Triggered when an synchronizing instruction is executed. The
  • end - The start of the range of index values for this HAP: Index: type Description: Triggered when an synchronizing instruction is executed. The

Trait Implementations§

source§

impl Hap for CoreSyncInstructionHap

source§

const NAME: Self::Name = crate::api::sys::CORE_SYNC_INSTRUCTION_HAP_NAME

The name of the HAP.
source§

type Name = &'static [u8]

The type of the name of the HAP, must be convertible to raw C string to pass to the simulator
source§

fn delete_callback_id(handle: HapHandle) -> Result<()>

A callback for a hap can be deleted by its handle
source§

fn delete_callback_obj_id(obj: *mut ConfObject, handle: HapHandle) -> Result<()>

A callback for a hap can be deleted by the object it is associated with

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.