Skip to main content

CodegenContext

Struct CodegenContext 

Source
pub struct CodegenContext {
    pub classes: HashMap<String, ClassInfo>,
    pub structs: HashMap<String, StructInfo>,
    pub enums: HashMap<String, EnumInfo>,
    pub package_to_module: HashMap<String, String>,
    pub module_to_feature: HashMap<String, String>,
    pub enabled_modules: HashSet<String>,
    pub module_classes: BTreeMap<String, Vec<ClassInfo>>,
    pub module_structs: BTreeMap<String, Vec<StructInfo>>,
    pub module_enums: BTreeMap<String, Vec<EnumInfo>>,
    pub func_table: Vec<FuncEntry>,
    pub module_deps: BTreeMap<String, BTreeSet<String>>,
    pub cpp_prefix: String,
}

Fields§

§classes: HashMap<String, ClassInfo>§structs: HashMap<String, StructInfo>§enums: HashMap<String, EnumInfo>§package_to_module: HashMap<String, String>§module_to_feature: HashMap<String, String>§enabled_modules: HashSet<String>§module_classes: BTreeMap<String, Vec<ClassInfo>>§module_structs: BTreeMap<String, Vec<StructInfo>>§module_enums: BTreeMap<String, Vec<EnumInfo>>§func_table: Vec<FuncEntry>§module_deps: BTreeMap<String, BTreeSet<String>>§cpp_prefix: String

Implementations§

Source§

impl CodegenContext

Source

pub fn new( classes: Vec<ClassInfo>, structs: Vec<StructInfo>, enums: Vec<EnumInfo>, config: &CodegenConfig, ) -> Self

Source

pub fn is_type_available(&self, type_name: &str) -> bool

Source

pub fn module_for_package(&self, package: &str) -> Option<&str>

Source

pub fn feature_for_module(&self, module: &str) -> Option<&str>

Source

pub fn enum_actual_repr(&self, enum_name: &str) -> Option<&'static str>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.