pub struct Formatter<'a> { /* private fields */ }Implementations§
Source§impl<'a> Formatter<'a>
impl<'a> Formatter<'a>
Sourcepub fn handle_bracketing(
&'a self,
expression: &'a DatexExpression,
doc: Format<'a>,
parent_ctx: Option<ParentContext<'a>>,
is_left_child_of_parent: bool,
) -> Format<'a>
pub fn handle_bracketing( &'a self, expression: &'a DatexExpression, doc: Format<'a>, parent_ctx: Option<ParentContext<'a>>, is_left_child_of_parent: bool, ) -> Format<'a>
Handles bracketing of an expression based on the current formatting options.
Sourcepub fn maybe_wrap_by_parent(
&'a self,
expression: &'a DatexExpression,
inner: Format<'a>,
parent_ctx: Option<ParentContext<'a>>,
is_left_child_of_parent: bool,
) -> Format<'a>
pub fn maybe_wrap_by_parent( &'a self, expression: &'a DatexExpression, inner: Format<'a>, parent_ctx: Option<ParentContext<'a>>, is_left_child_of_parent: bool, ) -> Format<'a>
Decides whether to wrap an expression in parentheses based on its parent context.
Sourcepub fn binary_operator_info(&self, op: &BinaryOperator) -> (u8, Assoc, bool)
pub fn binary_operator_info(&self, op: &BinaryOperator) -> (u8, Assoc, bool)
Returns information about a binary operator: (precedence, associativity, is_associative)
Source§impl<'a> Formatter<'a>
impl<'a> Formatter<'a>
pub fn datex_expression_to_source_code( &'a self, expr: &'a DatexExpression, ) -> Format<'a>
Auto Trait Implementations§
impl<'a> Freeze for Formatter<'a>
impl<'a> !RefUnwindSafe for Formatter<'a>
impl<'a> !Send for Formatter<'a>
impl<'a> !Sync for Formatter<'a>
impl<'a> Unpin for Formatter<'a>
impl<'a> !UnwindSafe for Formatter<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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