pub struct InstanceEvent {
pub instance_id: String,
pub service: String,
pub from_state: InstanceState,
pub to_state: InstanceState,
pub timestamp: DateTime<Utc>,
pub message: String,
}Expand description
Event emitted by Box when an instance state changes.
Fields§
§instance_id: StringInstance (box) ID
service: StringService this instance belongs to
from_state: InstanceStatePrevious state
to_state: InstanceStateNew state
timestamp: DateTime<Utc>When the transition occurred
message: StringOptional message (e.g., error details for Failed state)
Implementations§
Source§impl InstanceEvent
impl InstanceEvent
Sourcepub fn transition(
instance_id: &str,
service: &str,
from: InstanceState,
to: InstanceState,
) -> Self
pub fn transition( instance_id: &str, service: &str, from: InstanceState, to: InstanceState, ) -> Self
Create a new state transition event.
Sourcepub fn with_message(self, msg: &str) -> Self
pub fn with_message(self, msg: &str) -> Self
Add a message to the event.
Trait Implementations§
Source§impl Clone for InstanceEvent
impl Clone for InstanceEvent
Source§fn clone(&self) -> InstanceEvent
fn clone(&self) -> InstanceEvent
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 InstanceEvent
impl Debug for InstanceEvent
Source§impl<'de> Deserialize<'de> for InstanceEvent
impl<'de> Deserialize<'de> for InstanceEvent
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 InstanceEvent
impl RefUnwindSafe for InstanceEvent
impl Send for InstanceEvent
impl Sync for InstanceEvent
impl Unpin for InstanceEvent
impl UnsafeUnpin for InstanceEvent
impl UnwindSafe for InstanceEvent
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