Struct Enumerator
pub struct Enumerator {
pub name: Cow<'static, str>,
pub value: Option<i64>,
}Expand description
A single enumerator entry: display name and ordinal value. Used in GodotShape::Enum.
Fields§
§name: Cow<'static, str>§value: Option<i64>Ordinal value. None for string-backed enums (hint string omits ordinals: "Grass,Rock,Water").
Implementations§
§impl Enumerator
impl Enumerator
pub const fn new_int(name: &'static str, value: i64) -> Enumerator
pub const fn new_int(name: &'static str, value: i64) -> Enumerator
Creates a new int-backed enumerator.
pub const fn new_string(name: &'static str) -> Enumerator
pub const fn new_string(name: &'static str) -> Enumerator
Creates a new string-backed enumerator (no ordinal in hint string).
Trait Implementations§
§impl Clone for Enumerator
impl Clone for Enumerator
§fn clone(&self) -> Enumerator
fn clone(&self) -> Enumerator
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 moreAuto Trait Implementations§
impl Freeze for Enumerator
impl RefUnwindSafe for Enumerator
impl Send for Enumerator
impl Sync for Enumerator
impl Unpin for Enumerator
impl UnsafeUnpin for Enumerator
impl UnwindSafe for Enumerator
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