pub struct PyEnumSpec {
pub name: &'static str,
pub base: PyEnumBase,
pub variants: &'static [(&'static str, VariantLiteral)],
}Expand description
Static metadata emitted by #[derive(PyEnum)] for each derived enum.
Stored as const SPEC: PyEnumSpec on every impl PyEnum, driving class
construction (crate::add_enum) and conversion error messages.
Fields§
§name: &'static strPython class name — defaults to the Rust enum identifier, overridable
via #[pyenum(name = "...")].
base: PyEnumBaseChosen Python enum base class.
variants: &'static [(&'static str, VariantLiteral)]Variants in declaration order.
Trait Implementations§
Source§impl Clone for PyEnumSpec
impl Clone for PyEnumSpec
Source§fn clone(&self) -> PyEnumSpec
fn clone(&self) -> PyEnumSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PyEnumSpec
impl Debug for PyEnumSpec
impl Copy for PyEnumSpec
Auto Trait Implementations§
impl Freeze for PyEnumSpec
impl RefUnwindSafe for PyEnumSpec
impl Send for PyEnumSpec
impl Sync for PyEnumSpec
impl Unpin for PyEnumSpec
impl UnsafeUnpin for PyEnumSpec
impl UnwindSafe for PyEnumSpec
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