pub struct ExprFormatter<'a> {
pub db: &'a (dyn SemanticGroup + 'static),
pub function_id: FunctionWithBodyId,
}
Expand description
Holds all the information needed for formatting expressions. Acts like a “db” for DebugWithDb.
Fields§
§db: &'a (dyn SemanticGroup + 'static)
§function_id: FunctionWithBodyId
Trait Implementations§
source§impl DebugWithDb<ExprFormatter<'_>> for ExprId
impl DebugWithDb<ExprFormatter<'_>> for ExprId
source§impl DebugWithDb<ExprFormatter<'_>> for PatternId
impl DebugWithDb<ExprFormatter<'_>> for PatternId
source§impl DebugWithDb<ExprFormatter<'_>> for StatementId
impl DebugWithDb<ExprFormatter<'_>> for StatementId
source§impl DebugWithDb<ExprFormatter<'_>> for PatternVariable
impl DebugWithDb<ExprFormatter<'_>> for PatternVariable
source§impl<'a> DebugWithDb<ExprFormatter<'a>> for ExprVar
impl<'a> DebugWithDb<ExprFormatter<'a>> for ExprVar
source§impl<'a> DebugWithDb<ExprFormatter<'a>> for ExprVarMemberPath
impl<'a> DebugWithDb<ExprFormatter<'a>> for ExprVarMemberPath
source§impl Upcast<dyn DefsGroup> for ExprFormatter<'_>
impl Upcast<dyn DefsGroup> for ExprFormatter<'_>
source§impl Upcast<dyn SemanticGroup> for ExprFormatter<'_>
impl Upcast<dyn SemanticGroup> for ExprFormatter<'_>
fn upcast(&self) -> &(dyn SemanticGroup + 'static)
Auto Trait Implementations§
impl<'a> Freeze for ExprFormatter<'a>
impl<'a> !RefUnwindSafe for ExprFormatter<'a>
impl<'a> !Send for ExprFormatter<'a>
impl<'a> !Sync for ExprFormatter<'a>
impl<'a> Unpin for ExprFormatter<'a>
impl<'a> !UnwindSafe for ExprFormatter<'a>
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> Elongate for Twhere
T: Upcast<dyn SemanticGroup>,
impl<T> Elongate for Twhere
T: Upcast<dyn SemanticGroup>,
fn elongate(&self) -> &(dyn SemanticGroup + '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 moresource§impl<'a, T> SemanticEnumEx<'a> for T
impl<'a, T> SemanticEnumEx<'a> for T
source§fn concrete_enum_variant(
&self,
concrete_enum_id: ConcreteEnumId,
variant: &Variant,
) -> Maybe<ConcreteVariant>
fn concrete_enum_variant( &self, concrete_enum_id: ConcreteEnumId, variant: &Variant, ) -> Maybe<ConcreteVariant>
source§fn concrete_enum_variants(
&self,
concrete_enum_id: ConcreteEnumId,
) -> Maybe<Vec<ConcreteVariant>>
fn concrete_enum_variants( &self, concrete_enum_id: ConcreteEnumId, ) -> Maybe<Vec<ConcreteVariant>>
Retrieves all the ConcreteVariants for a ConcreteEnumId.
source§impl<'a, T> SemanticExprLookup<'a> for T
impl<'a, T> SemanticExprLookup<'a> for T
fn lookup_expr_by_ptr( &self, function_id: FunctionWithBodyId, ptr: ExprPtr, ) -> Maybe<ExprId>
fn lookup_pattern_by_ptr( &self, function_id: FunctionWithBodyId, ptr: PatternPtr, ) -> Maybe<PatternId>
source§impl<T0, T1, E, TRewriter> SemanticRewriter<(T0, T1), E> for TRewriterwhere
TRewriter: SemanticRewriter<T0, E> + SemanticRewriter<T1, E>,
impl<T0, T1, E, TRewriter> SemanticRewriter<(T0, T1), E> for TRewriterwhere
TRewriter: SemanticRewriter<T0, E> + SemanticRewriter<T1, E>,
fn internal_rewrite(&mut self, value: &mut (T0, T1)) -> Result<RewriteResult, E>
fn rewrite(&mut self, value: T) -> Result<T, Error>
source§impl<T, E, TRewriter> SemanticRewriter<Box<T>, E> for TRewriterwhere
TRewriter: SemanticRewriter<T, E>,
impl<T, E, TRewriter> SemanticRewriter<Box<T>, E> for TRewriterwhere
TRewriter: SemanticRewriter<T, E>,
fn internal_rewrite(&mut self, value: &mut Box<T>) -> Result<RewriteResult, E>
fn rewrite(&mut self, value: T) -> Result<T, Error>
source§impl<T, E, TRewriter> SemanticRewriter<Option<T>, E> for TRewriterwhere
TRewriter: SemanticRewriter<T, E>,
impl<T, E, TRewriter> SemanticRewriter<Option<T>, E> for TRewriterwhere
TRewriter: SemanticRewriter<T, E>,
fn internal_rewrite( &mut self, value: &mut Option<T>, ) -> Result<RewriteResult, E>
fn rewrite(&mut self, value: T) -> Result<T, Error>
source§impl<T, V, E, TRewriter> SemanticRewriter<OrderedHashMap<T, V>, E> for TRewriter
impl<T, V, E, TRewriter> SemanticRewriter<OrderedHashMap<T, V>, E> for TRewriter
fn internal_rewrite( &mut self, value: &mut OrderedHashMap<T, V>, ) -> Result<RewriteResult, E>
fn rewrite(&mut self, value: T) -> Result<T, Error>
source§impl<T, E, TRewriter, E2> SemanticRewriter<Result<T, E2>, E> for TRewriterwhere
TRewriter: SemanticRewriter<T, E>,
impl<T, E, TRewriter, E2> SemanticRewriter<Result<T, E2>, E> for TRewriterwhere
TRewriter: SemanticRewriter<T, E>,
fn internal_rewrite( &mut self, value: &mut Result<T, E2>, ) -> Result<RewriteResult, E>
fn rewrite(&mut self, value: T) -> Result<T, Error>
source§impl<T, E, TRewriter> SemanticRewriter<Vec<T>, E> for TRewriterwhere
T: Clone,
TRewriter: SemanticRewriter<T, E>,
impl<T, E, TRewriter> SemanticRewriter<Vec<T>, E> for TRewriterwhere
T: Clone,
TRewriter: SemanticRewriter<T, E>,
fn internal_rewrite(&mut self, value: &mut Vec<T>) -> Result<RewriteResult, E>
fn rewrite(&mut self, value: T) -> Result<T, Error>
source§impl<T, E, TRewriter> SemanticRewriter<VecDeque<T>, E> for TRewriterwhere
TRewriter: SemanticRewriter<T, E>,
impl<T, E, TRewriter> SemanticRewriter<VecDeque<T>, E> for TRewriterwhere
TRewriter: SemanticRewriter<T, E>,
fn internal_rewrite( &mut self, value: &mut VecDeque<T>, ) -> Result<RewriteResult, E>
fn rewrite(&mut self, value: T) -> Result<T, Error>
source§impl<'a, T> SemanticUseEx<'a> for T
impl<'a, T> SemanticUseEx<'a> for T
source§fn use_resolved_item(&self, use_id: UseId) -> Maybe<ResolvedGenericItem>
fn use_resolved_item(&self, use_id: UseId) -> Maybe<ResolvedGenericItem>
Returns the resolved item or an error if it can’t be resolved. Read more