pub struct State(/* private fields */);Expand description
A light weight reference counted wrapper around a state for Printable.
Implementations§
Source§impl State
impl State
Sourcepub fn indent_width(&self) -> u16
pub fn indent_width(&self) -> u16
Number of spaces per indentation
Sourcepub fn set_indent_width(&self, indent_width: u16)
pub fn set_indent_width(&self, indent_width: u16)
Set the current indentation width
Sourcepub fn current_indent(&self) -> u16
pub fn current_indent(&self) -> u16
What’s the indentation we’re at right now?
Sourcepub fn indent(&self) -> IndentGuard<'_>
pub fn indent(&self) -> IndentGuard<'_>
Increase the current indentation by Self::indent_width until the returned guard is dropped.
Sourcepub fn set_region_print_depth_limit(&self, limit: RegionPrintDepthLimit)
pub fn set_region_print_depth_limit(&self, limit: RegionPrintDepthLimit)
Set the maximum number of nested region levels to print.
Sourcepub fn current_region_print_depth_limit(&self) -> RegionPrintDepthLimit
pub fn current_region_print_depth_limit(&self) -> RegionPrintDepthLimit
The number of nested region levels that can still be printed. Entering / exiting a region decreases / increases this limit.
Sourcepub fn enter_region(&self) -> Option<RegionDepthGuard<'_>>
pub fn enter_region(&self) -> Option<RegionDepthGuard<'_>>
Enter a region (if Self::current_region_print_depth_limit permits it)
until the returned guard is dropped.
Returns None without changing the limit when the region must be elided.
Sourcepub fn aux_data_ref(&self) -> Ref<'_, HMap<Identifier, Box<dyn Any>>>
pub fn aux_data_ref(&self) -> Ref<'_, HMap<Identifier, Box<dyn Any>>>
Sourcepub fn aux_data_mut(&self) -> RefMut<'_, HMap<Identifier, Box<dyn Any>>>
pub fn aux_data_mut(&self) -> RefMut<'_, HMap<Identifier, Box<dyn Any>>>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for State
impl !Send for State
impl !Sync for State
impl !UnwindSafe for State
impl Freeze for State
impl Unpin for State
impl UnsafeUnpin for State
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
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 more