pub trait HeaderLanguage: UpcastAny {
    // Required methods
    fn emit_simple_enum(
        &self,
        ctx: &mut dyn Definer,
        docs: &'_ [&'_ str],
        self_ty: &dyn PhantomCType,
        backing_integer: Option<&dyn PhantomCType>,
        variants: &[EnumVariant<'_>]
    ) -> Result<()>;
    fn emit_struct(
        &self,
        ctx: &mut dyn Definer,
        docs: &'_ [&'_ str],
        self_ty: &dyn PhantomCType,
        fields: &[StructField<'_>]
    ) -> Result<()>;
    fn emit_opaque_type(
        &self,
        ctx: &mut dyn Definer,
        docs: &'_ [&'_ str],
        self_ty: &dyn PhantomCType
    ) -> Result<()>;
    fn emit_function(
        &self,
        ctx: &mut dyn Definer,
        docs: &'_ [&'_ str],
        fname: &str,
        args: &[FunctionArg<'_>],
        ret_ty: &dyn PhantomCType
    ) -> Result<()>;
    fn emit_constant(
        &self,
        ctx: &mut dyn Definer,
        docs: &'_ [&'_ str],
        name: &str,
        ty: &dyn PhantomCType,
        skip_type: bool,
        value: &dyn Debug
    ) -> Result<()>;

    // Provided methods
    fn language_name(&self) -> &'static str { ... }
    fn supports_type_aliases(
        &self
    ) -> Option<&dyn HeaderLanguageSupportingTypeAliases> { ... }
    fn emit_docs(
        &self,
        _ctx: &mut dyn Definer,
        _docs: &'_ [&'_ str],
        _indentation: &Indentation
    ) -> Result<()> { ... }
}
Available on crate feature headers only.

Required Methods§

source

fn emit_simple_enum( &self, ctx: &mut dyn Definer, docs: &'_ [&'_ str], self_ty: &dyn PhantomCType, backing_integer: Option<&dyn PhantomCType>, variants: &[EnumVariant<'_>] ) -> Result<()>

source

fn emit_struct( &self, ctx: &mut dyn Definer, docs: &'_ [&'_ str], self_ty: &dyn PhantomCType, fields: &[StructField<'_>] ) -> Result<()>

source

fn emit_opaque_type( &self, ctx: &mut dyn Definer, docs: &'_ [&'_ str], self_ty: &dyn PhantomCType ) -> Result<()>

source

fn emit_function( &self, ctx: &mut dyn Definer, docs: &'_ [&'_ str], fname: &str, args: &[FunctionArg<'_>], ret_ty: &dyn PhantomCType ) -> Result<()>

source

fn emit_constant( &self, ctx: &mut dyn Definer, docs: &'_ [&'_ str], name: &str, ty: &dyn PhantomCType, skip_type: bool, value: &dyn Debug ) -> Result<()>

Provided Methods§

source

fn language_name(&self) -> &'static str

source

fn supports_type_aliases( &self ) -> Option<&dyn HeaderLanguageSupportingTypeAliases>

source

fn emit_docs( &self, _ctx: &mut dyn Definer, _docs: &'_ [&'_ str], _indentation: &Indentation ) -> Result<()>

Implementations§

source§

impl dyn HeaderLanguage

source

pub fn is<Concrete: HeaderLanguage>(&self) -> bool

source

pub fn downcast_ref<Concrete: HeaderLanguage>(&self) -> Option<&Concrete>

Implementors§