pub struct ProtocolExitError {
pub code: ProtocolExitCode,
pub context: String,
pub detail: String,
}Expand description
Error type for protocol commands that need to set a specific exit code.
This integrates with the ExitError pattern in main.rs so that protocol commands can signal operational failures (exit 1) via the standard error-handling path.
Fields§
§code: ProtocolExitCode§context: String§detail: StringImplementations§
Source§impl ProtocolExitError
impl ProtocolExitError
Sourcepub fn operational(
context: impl Into<String>,
detail: impl Into<String>,
) -> Self
pub fn operational( context: impl Into<String>, detail: impl Into<String>, ) -> Self
Create an operational error (exit 1).
Sourcepub fn into_exit_error(self) -> ExitError
pub fn into_exit_error(self) -> ExitError
Convert to an ExitError for main.rs error handling.
Trait Implementations§
Source§impl Debug for ProtocolExitError
impl Debug for ProtocolExitError
Source§impl Display for ProtocolExitError
impl Display for ProtocolExitError
Source§impl Error for ProtocolExitError
impl Error for ProtocolExitError
1.30.0 · Source§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 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ProtocolExitError
impl RefUnwindSafe for ProtocolExitError
impl Send for ProtocolExitError
impl Sync for ProtocolExitError
impl Unpin for ProtocolExitError
impl UnsafeUnpin for ProtocolExitError
impl UnwindSafe for ProtocolExitError
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.