pub enum Typedef<'tu, 'ge> {
Clang {
entity: Entity<'tu>,
gen_env: &'ge GeneratorEnv<'tu>,
},
Desc(Rc<TypedefDesc<'tu, 'ge>>),
}
Variants§
Implementations§
Source§impl<'tu, 'ge> Typedef<'tu, 'ge>
impl<'tu, 'ge> Typedef<'tu, 'ge>
Sourcepub fn try_new(
entity: Entity<'tu>,
gen_env: &'ge GeneratorEnv<'tu>,
) -> NewTypedefResult<'tu, 'ge>
pub fn try_new( entity: Entity<'tu>, gen_env: &'ge GeneratorEnv<'tu>, ) -> NewTypedefResult<'tu, 'ge>
Create a corresponding type from EntityKind::TypedefDecl or EntityKind::TypeAliasDecl.
Sometimes the actual type is not a TypeDef
, but a Class
for example in case of:
typedef struct
{
int x, y, w, h;
float score;
} Box;
pub fn new_desc(desc: TypedefDesc<'tu, 'ge>) -> Self
pub fn type_ref(&self) -> TypeRef<'tu, 'ge>
pub fn underlying_type_ref(&self) -> TypeRef<'tu, 'ge>
pub fn generated_types(&self) -> Vec<GeneratedType<'tu, 'ge>>
Trait Implementations§
Source§impl Element for Typedef<'_, '_>
impl Element for Typedef<'_, '_>
fn exclude_kind(&self) -> ExcludeKind
fn is_system(&self) -> bool
fn is_public(&self) -> bool
fn doc_comment(&self) -> Cow<'_, str>
fn cpp_namespace(&self) -> Cow<'_, str>
fn cpp_name(&self, style: CppNameStyle) -> Cow<'_, str>
fn update_debug_struct<'dref, 'a, 'b>( &self, struct_debug: &'dref mut DebugStruct<'a, 'b>, ) -> &'dref mut DebugStruct<'a, 'b>
Source§impl RustElement for Typedef<'_, '_>
impl RustElement for Typedef<'_, '_>
Source§impl RustNativeGeneratedElement for Typedef<'_, '_>
impl RustNativeGeneratedElement for Typedef<'_, '_>
Auto Trait Implementations§
impl<'tu, 'ge> Freeze for Typedef<'tu, 'ge>
impl<'tu, 'ge> !RefUnwindSafe for Typedef<'tu, 'ge>
impl<'tu, 'ge> !Send for Typedef<'tu, 'ge>
impl<'tu, 'ge> !Sync for Typedef<'tu, 'ge>
impl<'tu, 'ge> Unpin for Typedef<'tu, 'ge>
impl<'tu, 'ge> !UnwindSafe for Typedef<'tu, 'ge>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more