pub struct KernelAction { /* private fields */ }Expand description
An action emitted by the kernel
Implementations§
Source§impl KernelAction
impl KernelAction
Sourcepub fn new(
action_type: ActionType,
payload: Value,
tenant_id: impl Into<String>,
) -> Self
pub fn new( action_type: ActionType, payload: Value, tenant_id: impl Into<String>, ) -> Self
Create a new kernel action
Sourcepub fn id(&self) -> KernelActionId
pub fn id(&self) -> KernelActionId
Get action ID
Sourcepub fn action_type(&self) -> &ActionType
pub fn action_type(&self) -> &ActionType
Get action type
Sourcepub fn with_idempotence(self, mode: IdempotenceMode) -> Self
pub fn with_idempotence(self, mode: IdempotenceMode) -> Self
Set idempotence mode
Sourcepub fn idempotent(self) -> Self
pub fn idempotent(self) -> Self
Mark as idempotent
Sourcepub fn with_triggering_observation(self, obs_id: ObservationId) -> Self
pub fn with_triggering_observation(self, obs_id: ObservationId) -> Self
Add triggering observation
Sourcepub fn idempotence(&self) -> IdempotenceMode
pub fn idempotence(&self) -> IdempotenceMode
Get idempotence mode
Sourcepub fn triggering_observations(&self) -> &[ObservationId]
pub fn triggering_observations(&self) -> &[ObservationId]
Get triggering observations
Trait Implementations§
Source§impl Clone for KernelAction
impl Clone for KernelAction
Source§fn clone(&self) -> KernelAction
fn clone(&self) -> KernelAction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KernelAction
impl Debug for KernelAction
Source§impl<'de> Deserialize<'de> for KernelAction
impl<'de> Deserialize<'de> for KernelAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KernelAction
impl RefUnwindSafe for KernelAction
impl Send for KernelAction
impl Sync for KernelAction
impl Unpin for KernelAction
impl UnwindSafe for KernelAction
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