Struct TurnStop
pub struct TurnStop {
pub class: TurnStopClass,
pub code: TurnStopCode,
pub detail: String,
}Expand description
A typed control-flow abort on the turn path.
Fields§
§class: TurnStopClassHow the turn should be treated.
code: TurnStopCodeWhat stopped it.
detail: StringThe message the turn would have carried anyway; this is the whole of
the Display, so tagging never changes what an error stringifies to.
Implementations§
Source§impl TurnStop
impl TurnStop
Sourcepub fn new(
class: TurnStopClass,
code: TurnStopCode,
detail: impl Into<String>,
) -> Self
pub fn new( class: TurnStopClass, code: TurnStopCode, detail: impl Into<String>, ) -> Self
Build a stop with the given classification and message.
Sourcepub fn recoverable(code: TurnStopCode, detail: impl Into<String>) -> Self
pub fn recoverable(code: TurnStopCode, detail: impl Into<String>) -> Self
A stop whose condition may clear on its own.
Sourcepub fn close_out(code: TurnStopCode, detail: impl Into<String>) -> Self
pub fn close_out(code: TurnStopCode, detail: impl Into<String>) -> Self
A stop that ends the turn but leaves its work worth reporting.
Sourcepub fn fatal(code: TurnStopCode, detail: impl Into<String>) -> Self
pub fn fatal(code: TurnStopCode, detail: impl Into<String>) -> Self
A stop that cannot be retried.
Trait Implementations§
impl Eq for TurnStop
Source§impl Error for TurnStop
impl Error for TurnStop
1.30.0 · §fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · §fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for TurnStop
Auto Trait Implementations§
impl Freeze for TurnStop
impl RefUnwindSafe for TurnStop
impl Send for TurnStop
impl Sync for TurnStop
impl Unpin for TurnStop
impl UnsafeUnpin for TurnStop
impl UnwindSafe for TurnStop
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