pub struct Out {
pub lines: Vec<String>,
pub rc: i32,
pub rec: Box<Map<String, Value>>,
pub parts: Vec<Out>,
}Expand description
One command’s output. rec = the JSON record fields beyond what emit derives.
Fields§
§lines: Vec<String>§rc: i32§rec: Box<Map<String, Value>>Boxed: an IndexMap (key order kept) would make every Result<_, Out> large.
parts: Vec<Out>One per input of a multi-input command: json prints these records, not the summary.
Implementations§
Source§impl Out
impl Out
pub fn new(lines: Vec<String>) -> Out
Sourcepub fn ask(line: &str) -> Out
pub fn ask(line: &str) -> Out
THE ? printer: a usage row, exit 2; a key-shaped word in it (what was typed may be a key) as its tail.
Sourcepub fn fail(code: &str, eq: String, hint: String) -> Out
pub fn fail(code: &str, eq: String, hint: String) -> Out
Whole-command failure (= ! line + fix, exit 1).
pub fn set(&mut self, k: &str, v: impl Into<Value>) -> &mut Out
Sourcepub fn with(self, k: &str, v: impl Into<Value>) -> Out
pub fn with(self, k: &str, v: impl Into<Value>) -> Out
set on an answer being built: Out::new(lines).with("id", id).
Trait Implementations§
Auto Trait Implementations§
impl Forget for Out
impl Freeze for Out
impl RefUnwindSafe for Out
impl Send for Out
impl Sync for Out
impl Unpin for Out
impl UnsafeUnpin for Out
impl UnwindSafe for Out
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.