pub struct ScopedContext<'a, Err: ErrorAccumulator> {
errors: &'a Err,
options: &'a OutputOptions,
extensions: &'a SimpleExtensions,
indent: IndentStack<'a>,
}
Fields§
§errors: &'a Err
§options: &'a OutputOptions
§extensions: &'a SimpleExtensions
§indent: IndentStack<'a>
Implementations§
Source§impl<'a, Err: ErrorAccumulator> ScopedContext<'a, Err>
impl<'a, Err: ErrorAccumulator> ScopedContext<'a, Err>
pub fn new( options: &'a OutputOptions, errors: &'a Err, extensions: &'a SimpleExtensions, ) -> Self
Trait Implementations§
Source§impl<'a, Err: Clone + ErrorAccumulator> Clone for ScopedContext<'a, Err>
impl<'a, Err: Clone + ErrorAccumulator> Clone for ScopedContext<'a, Err>
Source§fn clone(&self) -> ScopedContext<'a, Err>
fn clone(&self) -> ScopedContext<'a, Err>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a, Err: Debug + ErrorAccumulator> Debug for ScopedContext<'a, Err>
impl<'a, Err: Debug + ErrorAccumulator> Debug for ScopedContext<'a, Err>
Source§impl<'a, Err: ErrorAccumulator> Scope for ScopedContext<'a, Err>
impl<'a, Err: ErrorAccumulator> Scope for ScopedContext<'a, Err>
type Indent = IndentStack<'a>
Source§fn push_indent(&self) -> Self
fn push_indent(&self) -> Self
Push a new indent level.
Source§fn options(&self) -> &OutputOptions
fn options(&self) -> &OutputOptions
Get the options for formatting the plan.
fn errors(&self) -> &Self::Errors
fn extensions(&self) -> &SimpleExtensions
fn push_error(&self, e: FormatError)
Source§fn failure<E: Into<FormatError>>(&self, e: E) -> ErrorToken
fn failure<E: Into<FormatError>>(&self, e: E) -> ErrorToken
Handle a failure to textify a value. Textify errors are written as
“!{name}” to the output (where “name” is the type name), and
the error is pushed to the error accumulator.
fn expect<'a, T: Textify>( &'a self, t: Option<&'a T>, ) -> MaybeToken<impl Display>
fn expect_ok<'a, T: Textify, E: Into<FormatError>>( &'a self, result: Result<&'a T, E>, ) -> MaybeToken<impl Display + 'a>
fn display<'a, T: Textify>(&'a self, value: &'a T) -> Displayable<'a, Self, T>
Source§fn separated<'a, T: Textify, I: IntoIterator<Item = &'a T> + Clone>(
&'a self,
items: I,
separator: &'static str,
) -> Separated<'a, Self, T, I>
fn separated<'a, T: Textify, I: IntoIterator<Item = &'a T> + Clone>( &'a self, items: I, separator: &'static str, ) -> Separated<'a, Self, T, I>
Wrap an iterator over textifiable items into a displayable that will
separate them with the given separator. Read more
fn option<'a, T: Textify>( &'a self, value: Option<&'a T>, ) -> OptionalDisplayable<'a, Self, T>
fn optional<'a, T: Textify>( &'a self, value: &'a T, option: bool, ) -> OptionalDisplayable<'a, Self, T>
impl<'a, Err: Copy + ErrorAccumulator> Copy for ScopedContext<'a, Err>
Auto Trait Implementations§
impl<'a, Err> Freeze for ScopedContext<'a, Err>
impl<'a, Err> RefUnwindSafe for ScopedContext<'a, Err>where
Err: RefUnwindSafe,
impl<'a, Err> Send for ScopedContext<'a, Err>where
Err: Sync,
impl<'a, Err> Sync for ScopedContext<'a, Err>where
Err: Sync,
impl<'a, Err> Unpin for ScopedContext<'a, Err>
impl<'a, Err> UnwindSafe for ScopedContext<'a, Err>where
Err: RefUnwindSafe,
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