pub struct StatusMessage {
pub status_type: StatusType,
pub text: Option<Cow<'static, str>>,
}Expand description
A status message for an Algorithm
Fields§
§status_type: StatusTypeThe status type
text: Option<Cow<'static, str>>The internal custom message
Implementations§
Source§impl StatusMessage
impl StatusMessage
Sourcepub fn uninitialize(&mut self)
pub fn uninitialize(&mut self)
Set the status message to uninitialized
Sourcepub fn initialize(&mut self)
pub fn initialize(&mut self)
Set the status message to initialized
Sourcepub fn set_initialized(self) -> Self
pub fn set_initialized(self) -> Self
Set the status message to initialized
Sourcepub fn initialize_with_message(&mut self, message: impl Into<Cow<'static, str>>)
pub fn initialize_with_message(&mut self, message: impl Into<Cow<'static, str>>)
Set the status message to initialized with a custom message
Sourcepub fn set_initialized_with_message(
self,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn set_initialized_with_message( self, message: impl Into<Cow<'static, str>>, ) -> Self
Set the status message to initialized with a custom message
Sourcepub fn step_with_message(&mut self, message: impl Into<Cow<'static, str>>)
pub fn step_with_message(&mut self, message: impl Into<Cow<'static, str>>)
Set the status message to a step with a custom message
Sourcepub fn set_step_with_message(
self,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn set_step_with_message( self, message: impl Into<Cow<'static, str>>, ) -> Self
Set the status message to a step with a custom message
Sourcepub fn set_success(self) -> Self
pub fn set_success(self) -> Self
Set the status message to success
Sourcepub fn succeed_with_message(&mut self, message: impl Into<Cow<'static, str>>)
pub fn succeed_with_message(&mut self, message: impl Into<Cow<'static, str>>)
Set the status message to converged with a custom message
Sourcepub fn set_success_with_message(
self,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn set_success_with_message( self, message: impl Into<Cow<'static, str>>, ) -> Self
Set the status message to converged with a custom message
Sourcepub fn set_failed(self) -> Self
pub fn set_failed(self) -> Self
Set the status message to failed
Sourcepub fn fail_with_message(&mut self, message: impl Into<Cow<'static, str>>)
pub fn fail_with_message(&mut self, message: impl Into<Cow<'static, str>>)
Set the status message to failed with a custom message
Sourcepub fn set_failed_with_message(
self,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn set_failed_with_message( self, message: impl Into<Cow<'static, str>>, ) -> Self
Set the status message to failed with a custom message
Sourcepub fn custom(&mut self, message: impl Into<Cow<'static, str>>)
pub fn custom(&mut self, message: impl Into<Cow<'static, str>>)
Set the status message to a custom message
Sourcepub fn custom_with_message(&mut self, message: impl Into<Cow<'static, str>>)
pub fn custom_with_message(&mut self, message: impl Into<Cow<'static, str>>)
Set the status message to a custom message.
Sourcepub fn set_custom(self, message: impl Into<Cow<'static, str>>) -> Self
pub fn set_custom(self, message: impl Into<Cow<'static, str>>) -> Self
Set the status message to a custom message
Sourcepub fn text_or_empty(&self) -> &str
pub fn text_or_empty(&self) -> &str
Returns the message text payload, or an empty string for message-less status transitions.
Sourcepub const fn success(&self) -> bool
pub const fn success(&self) -> bool
Returns true if the status message is StatusType::Success
Trait Implementations§
Source§impl Clone for StatusMessage
impl Clone for StatusMessage
Source§fn clone(&self) -> StatusMessage
fn clone(&self) -> StatusMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StatusMessage
impl Debug for StatusMessage
Source§impl Default for StatusMessage
impl Default for StatusMessage
Source§fn default() -> StatusMessage
fn default() -> StatusMessage
Source§impl<'de> Deserialize<'de> for StatusMessage
impl<'de> Deserialize<'de> for StatusMessage
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>,
Source§impl Display for StatusMessage
impl Display for StatusMessage
Auto Trait Implementations§
impl Freeze for StatusMessage
impl RefUnwindSafe for StatusMessage
impl Send for StatusMessage
impl Sync for StatusMessage
impl Unpin for StatusMessage
impl UnsafeUnpin for StatusMessage
impl UnwindSafe for StatusMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> SummaryExport for T
impl<T> SummaryExport for T
Source§fn to_pretty_string(&self) -> String
fn to_pretty_string(&self) -> String
Display implementation.Source§fn to_json_string(&self) -> Result<String, SerdeJsonError>
fn to_json_string(&self) -> Result<String, SerdeJsonError>
Source§fn to_json_string_pretty(&self) -> Result<String, SerdeJsonError>
fn to_json_string_pretty(&self) -> Result<String, SerdeJsonError>
Source§fn render(&self) -> Result<RenderedSummary, SerdeJsonError>
fn render(&self) -> Result<RenderedSummary, SerdeJsonError>
Source§fn render_pretty_json(&self) -> Result<RenderedSummary, SerdeJsonError>
fn render_pretty_json(&self) -> Result<RenderedSummary, SerdeJsonError>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.