pub struct EnumShape { /* private fields */ }Expand description
An enum declaration: its name and its constructors in declaration order.
Implementations§
Source§impl EnumShape
impl EnumShape
Sourcepub fn new(
name: &str,
constructors: impl IntoIterator<Item = Constructor>,
) -> Arc<Self> ⓘ
pub fn new( name: &str, constructors: impl IntoIterator<Item = Constructor>, ) -> Arc<Self> ⓘ
Returns the shape of the enum name declaring constructors, in
order.
Sourcepub fn constructor(&self, index: usize) -> Option<&Constructor>
pub fn constructor(&self, index: usize) -> Option<&Constructor>
Returns the constructor at a declaration index.
Sourcepub fn constructors(&self) -> &[Constructor]
pub fn constructors(&self) -> &[Constructor]
Returns the constructors, in declaration order.
Trait Implementations§
impl Eq for EnumShape
impl StructuralPartialEq for EnumShape
Auto Trait Implementations§
impl Forget for EnumShape
impl Freeze for EnumShapewhere
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const [Constructor] is !null: Freeze,
PhantomData<[Constructor]>: Freeze,
impl Move for EnumShape
impl RefUnwindSafe for EnumShape
impl Send for EnumShape
impl Sync for EnumShape
impl Unpin for EnumShape
impl UnsafeUnpin for EnumShapewhere
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const [Constructor] is !null: UnsafeUnpin,
PhantomData<[Constructor]>: UnsafeUnpin,
impl UnwindSafe for EnumShape
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