charon_lib::pretty::fmt_with_ctx

Trait FmtWithCtx

Source
pub trait FmtWithCtx<C> {
    // Provided methods
    fn fmt_with_ctx(&self, ctx: &C) -> String { ... }
    fn fmt_with_ctx_and_indent(&self, _tab: &str, _ctx: &C) -> String { ... }
    fn with_ctx<'a>(&'a self, ctx: &'a C) -> impl Display + 'a { ... }
}
Expand description

Format the AST type as a string.

Provided Methods§

Source

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

Source

fn fmt_with_ctx_and_indent(&self, _tab: &str, _ctx: &C) -> String

Source

fn with_ctx<'a>(&'a self, ctx: &'a C) -> impl Display + 'a

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

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

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 FunDecl
where C: AstFormatter + for<'a> SetGenerics<'a>, for<'a, 'a, 'b> <C as SetGenerics<'a>>::C: AstFormatter + SetLocals<'b>, for<'a, 'b> <<C as SetGenerics<'a>>::C as SetLocals<'b>>::C: AstFormatter,

Source§

impl<C> FmtWithCtx<C> for GlobalDecl
where C: AstFormatter + for<'a> SetLocals<'a>, for<'a> <C as SetGenerics<'a>>::C: AstFormatter, for<'a, 'b, 'a, 'b, 'c> <<C as SetGenerics<'a>>::C as SetLocals<'b>>::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 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 LiteralTy

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 FunDeclRef

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 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 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 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 Variant

Source§

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

Source§

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

Source§

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

Source§

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

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 PolyTraitDeclRef

Source§

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

Source§

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

Source§

impl<T, C> FmtWithCtx<C> for GExprBody<T>
where C: for<'a> SetLocals<'a>, for<'a, 'a, 'b> <C as SetLocals<'a>>::C: AstFormatter + Formatter<&'b T>,