pub struct Envelope {
pub ok: bool,
pub environment: &'static str,
pub dry_run: bool,
pub data: Option<Value>,
pub error: Option<ErrorPayload>,
pub security_warnings: Vec<SecurityWarning>,
}Fields§
§ok: bool§environment: &'static str§dry_run: bool§data: Option<Value>§error: Option<ErrorPayload>§security_warnings: Vec<SecurityWarning>F15: machine-readable non-fatal security signals. Always present
(possibly empty) so orchestrators can unconditionally .jq
.security_warnings | length > 0 without needing a null check.
Populated by command code via Self::with_warnings.
Implementations§
Source§impl Envelope
impl Envelope
pub fn success(env: Environment, dry_run: bool, data: Value) -> Self
pub fn error(env: Environment, dry_run: bool, err: &CmdError) -> Self
Sourcepub fn with_warnings(self, warnings: Vec<SecurityWarning>) -> Self
pub fn with_warnings(self, warnings: Vec<SecurityWarning>) -> Self
Attach non-fatal security warnings to this envelope. Idempotent — appends to whatever is already set; callers can accumulate across the request pipeline.
pub fn emit(&self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more