pub struct Envelope {
pub ok: bool,
pub environment: &'static str,
pub dry_run: bool,
pub data: Option<Value>,
pub error: Option<ErrorPayload>,
pub correlation_id: Option<String>,
pub security_warnings: Vec<SecurityWarning>,
}Fields§
§ok: bool§environment: &'static str§dry_run: bool§data: Option<Value>§error: Option<ErrorPayload>§correlation_id: Option<String>Server x-request-id (gh#91), present whenever the invocation made an
HTTP call. Lets a consumer reading only stdout JSON join back to the
server-side mix taskfast.trace, without the server’s Error schema
having to carry it (additionalProperties: false).
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.
Sourcepub fn with_correlation_id(self, id: Option<String>) -> Self
pub fn with_correlation_id(self, id: Option<String>) -> Self
Attach the server correlation id captured for this invocation
(gh#91). None when no HTTP call was made or none carried the
header.
pub fn emit(&self)
Trait Implementations§
Auto Trait Implementations§
impl Forget for Envelope
impl Freeze for Envelope
impl Move 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
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> ⓘ
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> ⓘ
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