Struct ScopedContext

Source
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>

Source

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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<'a, Err: Debug + ErrorAccumulator> Debug for ScopedContext<'a, Err>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, Err: ErrorAccumulator> Scope for ScopedContext<'a, Err>

Source§

type Errors = Err

The type of errors that can occur when textifying a plan.
Source§

type Indent = IndentStack<'a>

Source§

fn indent(&self) -> impl Display

Get the current indent level.
Source§

fn push_indent(&self) -> Self

Push a new indent level.
Source§

fn options(&self) -> &OutputOptions

Get the options for formatting the plan.
Source§

fn errors(&self) -> &Self::Errors

Source§

fn extensions(&self) -> &SimpleExtensions

Source§

fn push_error(&self, e: FormatError)

Source§

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.
Source§

fn expect<'a, T: Textify>( &'a self, t: Option<&'a T>, ) -> MaybeToken<impl Display>

Source§

fn expect_ok<'a, T: Textify, E: Into<FormatError>>( &'a self, result: Result<&'a T, E>, ) -> MaybeToken<impl Display + 'a>

Source§

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>

Wrap an iterator over textifiable items into a displayable that will separate them with the given separator. Read more
Source§

fn option<'a, T: Textify>( &'a self, value: Option<&'a T>, ) -> OptionalDisplayable<'a, Self, T>

Source§

fn optional<'a, T: Textify>( &'a self, value: &'a T, option: bool, ) -> OptionalDisplayable<'a, Self, T>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.