pub struct AstFormatter<W> {
buf: W,
mode: FormatMode,
}
Fields§
§buf: W
§mode: FormatMode
Implementations§
Source§impl<W> AstFormatter<W>where
W: Write,
impl<W> AstFormatter<W>where
W: Write,
pub fn write_node<T: AstDisplay>(&mut self, s: &T)
pub fn write_str<T: Display>(&mut self, s: T)
pub fn stable(&self) -> bool
Sourcepub fn simple(&self) -> bool
pub fn simple(&self) -> bool
Whether the AST should be printed out in a more human readable format.
Sourcepub fn unredact(&mut self) -> FormatMode
pub fn unredact(&mut self) -> FormatMode
Sets the current mode to a compatible version that does not redact
values; returns the current mode, which should be reset when the
unredacted printing is complete using Self::set_mode
.
Note that this is the simplest means of unredacting values opt-out rather than opt-in. We must monitor usage of this API carefully to ensure we don’t end up leaking values.
pub fn set_mode(&mut self, mode: FormatMode)
pub fn new(buf: W, mode: FormatMode) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for AstFormatter<W>where
W: Freeze,
impl<W> RefUnwindSafe for AstFormatter<W>where
W: RefUnwindSafe,
impl<W> Send for AstFormatter<W>where
W: Send,
impl<W> Sync for AstFormatter<W>where
W: Sync,
impl<W> Unpin for AstFormatter<W>where
W: Unpin,
impl<W> UnwindSafe for AstFormatter<W>where
W: UnwindSafe,
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request