pub enum Class<'tu, 'ge> {
Clang {
entity: Entity<'tu>,
custom_fullname: Option<Rc<str>>,
gen_env: &'ge GeneratorEnv<'tu>,
},
Desc(Rc<ClassDesc<'tu, 'ge>>),
}
Variants§
Implementations§
Source§impl<'tu, 'ge> Class<'tu, 'ge>
impl<'tu, 'ge> Class<'tu, 'ge>
pub fn new(entity: Entity<'tu>, gen_env: &'ge GeneratorEnv<'tu>) -> Self
pub fn new_ext( entity: Entity<'tu>, custom_fullname: impl Into<Rc<str>>, gen_env: &'ge GeneratorEnv<'tu>, ) -> Self
pub fn new_desc(desc: ClassDesc<'tu, 'ge>) -> Self
Sourcepub fn can_be_simple(&self) -> bool
pub fn can_be_simple(&self) -> bool
Checks whether a class can be simple on Rust side, i.e. represented by plain struct with fields
pub fn kind(&self) -> ClassKind
pub fn type_ref(&self) -> TypeRef<'tu, 'ge>
Sourcepub fn string_type(&self) -> Option<StrType>
pub fn string_type(&self) -> Option<StrType>
Returns Some
with the string type if the current class name refers to a C++ std::string
or cv::String
pub fn template_kind(&self) -> TemplateKind<'tu, 'ge>
pub fn is_abstract(&self) -> bool
Sourcepub fn is_polymorphic(&self) -> bool
pub fn is_polymorphic(&self) -> bool
True if a class has virtual methods
Sourcepub fn as_enum(&self) -> Option<Enum<'tu>>
pub fn as_enum(&self) -> Option<Enum<'tu>>
Special case of an empty class with only an anonymous enum inside (e.g., DrawLinesMatchesFlags)
Sourcepub fn has_explicit_clone(&self) -> bool
pub fn has_explicit_clone(&self) -> bool
Class has an explicit method named clone()
Sourcepub fn has_implicit_clone(&self) -> bool
pub fn has_implicit_clone(&self) -> bool
Class is simple (i.e. constructor-copiable in C++), but can’t be simple in Rust
pub fn has_implicit_default_constructor(&self) -> bool
pub fn has_virtual_destructor(&self) -> bool
pub fn has_private_destructor(&self) -> bool
pub fn has_bases(&self) -> bool
pub fn bases(&self) -> Cow<'_, [Class<'tu, 'ge>]>
pub fn all_bases(&self) -> HashSet<Class<'tu, 'ge>>
pub fn has_descendants(&self) -> bool
pub fn descendants(&self) -> HashSet<Class<'tu, 'ge>>
pub fn all_descendants(&self) -> HashSet<Class<'tu, 'ge>>
pub fn all_family(&self) -> HashSet<Class<'tu, 'ge>>
pub fn has_methods(&self) -> bool
pub fn for_each_method( &self, predicate: impl FnMut(Func<'tu, 'ge>) -> ControlFlow<()>, ) -> ControlFlow<()>
pub fn methods( &self, filter: impl Fn(&Func<'_, '_>) -> bool, ) -> Vec<Func<'tu, 'ge>>
pub fn has_fields(&self) -> bool
pub fn for_each_field( &self, predicate: impl FnMut(Field<'tu, 'ge>) -> ControlFlow<()>, ) -> ControlFlow<()>
pub fn fields( &self, filter: impl Fn(&Field<'_, '_>) -> bool, ) -> Vec<Field<'tu, 'ge>>
pub fn for_each_const( &self, predicate: impl FnMut(Const<'tu>) -> ControlFlow<()>, ) -> ControlFlow<()>
pub fn consts(&self) -> Vec<Const<'tu>>
pub fn field_methods<'f>( &self, fields: &'f [Field<'tu, 'ge>], constness_filter: Option<Constness>, ) -> impl Iterator<Item = Func<'tu, 'ge>> + 'f
pub fn is_definition(&self) -> bool
pub fn generated_types(&self) -> Vec<GeneratedType<'tu, 'ge>>
Trait Implementations§
Source§impl Element for Class<'_, '_>
impl Element for Class<'_, '_>
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 Class<'_, '_>
impl RustElement for Class<'_, '_>
fn rust_module(&self) -> SupportedModule
fn rust_name(&self, style: NameStyle) -> Cow<'_, str>
Source§fn rust_leafname(&self, _fish_style: FishStyle) -> Cow<'_, str>
fn rust_leafname(&self, _fish_style: FishStyle) -> Cow<'_, str>
The very last concrete part of the name in Rust Read more
fn rendered_doc_comment( &self, comment_marker: &str, opencv_version: &str, ) -> String
fn rust_module_reference(&self) -> Cow<'_, str>
Source§impl RustNativeGeneratedElement for Class<'_, '_>
impl RustNativeGeneratedElement for Class<'_, '_>
impl Eq for Class<'_, '_>
Auto Trait Implementations§
impl<'tu, 'ge> Freeze for Class<'tu, 'ge>
impl<'tu, 'ge> !RefUnwindSafe for Class<'tu, 'ge>
impl<'tu, 'ge> !Send for Class<'tu, 'ge>
impl<'tu, 'ge> !Sync for Class<'tu, 'ge>
impl<'tu, 'ge> Unpin for Class<'tu, 'ge>
impl<'tu, 'ge> !UnwindSafe for Class<'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