Trait FmtWithCtx

Source
pub trait FmtWithCtx<C> {
    // Required method
    fn fmt_with_ctx(&self, ctx: &C, f: &mut Formatter<'_>) -> Result;

    // Provided methods
    fn with_ctx<'a>(&'a self, ctx: &'a C) -> WithCtx<'a, C, Self> { ... }
    fn to_string_with_ctx(&self, ctx: &C) -> String { ... }
}
Expand description

Format the AST type as a string.

Required Methods§

Source

fn fmt_with_ctx(&self, ctx: &C, f: &mut Formatter<'_>) -> Result

Provided Methods§

Source

fn with_ctx<'a>(&'a self, ctx: &'a C) -> WithCtx<'a, C, Self>

Returns a struct that implements Display. This allows the following:

    println!("{}", self.with_ctx(ctx));
Source

fn to_string_with_ctx(&self, ctx: &C) -> String

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C> FmtWithCtx<C> for GlobalDecl
where C: AstFormatter,

Source§

impl<C: AstFormatter> FmtWithCtx<C> for CastKind

Source§

impl<C: AstFormatter> FmtWithCtx<C> for NullOp

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Operand

Source§

impl<C: AstFormatter> FmtWithCtx<C> for RawConstantExpr

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Rvalue

Source§

impl<C: AstFormatter> FmtWithCtx<C> for UnOp

Source§

impl<C: AstFormatter> FmtWithCtx<C> for AbortKind

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Body

Source§

impl<C: AstFormatter> FmtWithCtx<C> for FnOperand

Source§

impl<C: AstFormatter> FmtWithCtx<C> for AnyTransId

Source§

impl<C: AstFormatter> FmtWithCtx<C> for AnyTransItem<'_>

Source§

impl<C: AstFormatter> FmtWithCtx<C> for ImplElem

Source§

impl<C: AstFormatter> FmtWithCtx<C> for PathElem

Source§

impl<C: AstFormatter> FmtWithCtx<C> for ConstGeneric

Source§

impl<C: AstFormatter> FmtWithCtx<C> for GenericsSource

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Region

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TraitRefKind

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TypeId

Source§

impl<C: AstFormatter> FmtWithCtx<C> for DeclarationGroup

Source§

impl<C: AstFormatter> FmtWithCtx<C> for ConstantExpr

Source§

impl<C: AstFormatter> FmtWithCtx<C> for FnPtr

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Place

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Assert

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Call

Source§

impl<C: AstFormatter> FmtWithCtx<C> for FunDecl

Source§

impl<C: AstFormatter> FmtWithCtx<C> for FunDeclRef

Source§

impl<C: AstFormatter> FmtWithCtx<C> for GExprBody<Block>

Source§

impl<C: AstFormatter> FmtWithCtx<C> for GExprBody<BodyContents>

Source§

impl<C: AstFormatter> FmtWithCtx<C> for GlobalDeclRef

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TraitDecl

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TraitImpl

Source§

impl<C: AstFormatter> FmtWithCtx<C> for FunDeclId

Source§

impl<C: AstFormatter> FmtWithCtx<C> for GlobalDeclId

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TraitDeclId

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TraitImplId

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TypeDeclId

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Block

Source§

impl<C: AstFormatter> FmtWithCtx<C> for charon_lib::ast::llbc_ast::Statement

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Name

Source§

impl<C: AstFormatter> FmtWithCtx<C> for ConstGenericVar

Source§

impl<C: AstFormatter> FmtWithCtx<C> for ExistentialPredicate

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Field

Source§

impl<C: AstFormatter> FmtWithCtx<C> for FunSig

Source§

impl<C: AstFormatter> FmtWithCtx<C> for GenericArgs

Source§

impl<C: AstFormatter> FmtWithCtx<C> for RegionVar

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TraitClause

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TraitDeclRef

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TraitRef

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TraitTypeConstraint

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Ty

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TypeDecl

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TypeVar

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Variant

Source§

impl<C: AstFormatter> FmtWithCtx<C> for BlockData

Source§

impl<C: AstFormatter> FmtWithCtx<C> for charon_lib::ast::ullbc_ast::Statement

Source§

impl<C: AstFormatter> FmtWithCtx<C> for Terminator

Source§

impl<C: AstFormatter> FmtWithCtx<C> for LocalId

Source§

impl<C: AstFormatter> FmtWithCtx<C> for ClauseDbVar

Source§

impl<C: AstFormatter> FmtWithCtx<C> for ConstGenericDbVar

Source§

impl<C: AstFormatter> FmtWithCtx<C> for PolyTraitDeclRef

Source§

impl<C: AstFormatter> FmtWithCtx<C> for RegionDbVar

Source§

impl<C: AstFormatter> FmtWithCtx<C> for TypeDbVar

Source§

impl<C: AstFormatter, T, U> FmtWithCtx<C> for OutlivesPred<T, U>
where T: FmtWithCtx<C>, U: FmtWithCtx<C>,

Source§

impl<Id, C: AstFormatter> FmtWithCtx<C> for GDeclarationGroup<Id>
where Id: FmtWithCtx<C> + Copy,