pub struct Document { /* private fields */ }Expand description
A command’s output, one sequence of blocks per stream: results, then notes (summaries, hints, warnings).
Implementations§
Source§impl Document
impl Document
pub fn new() -> Self
Sourcepub fn body(&mut self, lines: impl IntoIterator<Item = Line>)
pub fn body(&mut self, lines: impl IntoIterator<Item = Line>)
Append bare lines to the result stream.
Sourcepub fn notes(&mut self, lines: impl IntoIterator<Item = Line>)
pub fn notes(&mut self, lines: impl IntoIterator<Item = Line>)
Append bare lines to the note stream.
Sourcepub fn block_body(&mut self, block: Block)
pub fn block_body(&mut self, block: Block)
Append one structured block to the result stream.
Sourcepub fn block_note(&mut self, block: Block)
pub fn block_note(&mut self, block: Block)
Append one structured block to the note stream.
Sourcepub fn of(answer: &Answer, options: Options) -> Self
pub fn of(answer: &Answer, options: Options) -> Self
Compose one answer into the blocks its command prints.
pub fn search(matches: &[Match], skipped: &[Skipped]) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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