pub struct CairoEnum {
pub abi: AbiTypeAny,
pub variants: Vec<(String, AbiTypeAny)>,
pub generic_variants: HashMap<String, (String, bool)>,
}
Fields§
§abi: AbiTypeAny
§variants: Vec<(String, AbiTypeAny)>
Parsed types for each variants.
generic_variants: HashMap<String, (String, bool)>
Variant name => (generic representation, is_generic).
Implementations§
Source§impl CairoEnum
impl CairoEnum
Sourcepub fn is_generic(&self) -> bool
pub fn is_generic(&self) -> bool
Returns true if the enum is generic, false otherwise.
Sourcepub fn get_gentys(&self) -> Vec<String>
pub fn get_gentys(&self) -> Vec<String>
Returns the list of generic types, if any.
Sourcepub fn new(abi_name: &str, abi_variants: &Vec<AbiNamedMember>) -> CairoEnum
pub fn new(abi_name: &str, abi_variants: &Vec<AbiNamedMember>) -> CairoEnum
Initializes a new instance from the abi name and it’s variants.
Sourcepub fn compare_generic_types(&self, existing_ce: &mut CairoEnum)
pub fn compare_generic_types(&self, existing_ce: &mut CairoEnum)
Compares the generic types for each variants with an other CairoEnum
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CairoEnum
impl RefUnwindSafe for CairoEnum
impl Send for CairoEnum
impl Sync for CairoEnum
impl Unpin for CairoEnum
impl UnwindSafe for CairoEnum
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