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