Trait planus_cli::codegen::backend::Backend[][src]

pub trait Backend {
    type NamespaceInfo: Debug + Clone;
    type TableInfo: Debug + Clone;
    type StructInfo: Debug + Clone;
    type EnumInfo: Debug + Clone;
    type UnionInfo: Debug + Clone;
    type RpcServiceInfo: Debug + Clone;
    type TableFieldInfo: Debug + Clone;
    type StructFieldInfo: Debug + Clone;
    type EnumVariantInfo: Debug + Clone;
    type UnionVariantInfo: Debug + Clone;
    type RpcMethodInfo: Debug + Clone;

    const KEYWORDS: &'static [&'static str];

    fn generate_namespace(
        &mut self,
        namespace_names: &mut NamespaceNames<'_, '_>,
        namespace_name: &AbsolutePath,
        namespace: &Namespace
    ) -> Self::NamespaceInfo;
fn generate_table(
        &mut self,
        declaration_names: &mut DeclarationNames<'_, '_>,
        translated_namespaces: &[Self::NamespaceInfo],
        decl_name: &AbsolutePath,
        decl: &Table
    ) -> Self::TableInfo;
fn generate_struct(
        &mut self,
        declaration_names: &mut DeclarationNames<'_, '_>,
        translated_namespaces: &[Self::NamespaceInfo],
        decl_name: &AbsolutePath,
        decl: &Struct
    ) -> Self::StructInfo;
fn generate_enum(
        &mut self,
        declaration_names: &mut DeclarationNames<'_, '_>,
        translated_namespaces: &[Self::NamespaceInfo],
        decl_name: &AbsolutePath,
        decl: &Enum
    ) -> Self::EnumInfo;
fn generate_union(
        &mut self,
        declaration_names: &mut DeclarationNames<'_, '_>,
        translated_namespaces: &[Self::NamespaceInfo],
        decl_name: &AbsolutePath,
        decl: &Union
    ) -> Self::UnionInfo;
fn generate_rpc_service(
        &mut self,
        declaration_names: &mut DeclarationNames<'_, '_>,
        translated_namespaces: &[Self::NamespaceInfo],
        decl_name: &AbsolutePath,
        decl: &RpcService
    ) -> Self::RpcServiceInfo;
fn generate_table_field(
        &mut self,
        translation_context: &mut DeclarationTranslationContext<'_, '_, Self>,
        parent_info: &Self::TableInfo,
        parent: &Table,
        field_name: &str,
        field: &TableField,
        resolved_type: ResolvedType<'_, Self>
    ) -> Self::TableFieldInfo;
fn generate_struct_field(
        &mut self,
        translation_context: &mut DeclarationTranslationContext<'_, '_, Self>,
        parent_info: &Self::StructInfo,
        parent: &Struct,
        field_name: &str,
        field: &StructField,
        resolved_type: ResolvedType<'_, Self>
    ) -> Self::StructFieldInfo;
fn generate_enum_variant(
        &mut self,
        translation_context: &mut DeclarationTranslationContext<'_, '_, Self>,
        parent_info: &Self::EnumInfo,
        parent: &Enum,
        key: &str,
        value: &IntegerLiteral
    ) -> Self::EnumVariantInfo;
fn generate_union_variant(
        &mut self,
        translation_context: &mut DeclarationTranslationContext<'_, '_, Self>,
        parent_info: &Self::UnionInfo,
        parent: &Union,
        key: &str,
        index: u8,
        value: &UnionVariant,
        resolved_type: ResolvedType<'_, Self>
    ) -> Self::UnionVariantInfo;
fn generate_rpc_method(
        &mut self,
        translation_context: &mut DeclarationTranslationContext<'_, '_, Self>,
        parent_info: &Self::RpcServiceInfo,
        parent: &RpcService,
        method_name: &str,
        method: &RpcMethod
    ) -> Self::RpcMethodInfo; }

Associated Types

Associated Constants

Required methods

Implementors