pub struct EnumConstant<T: Copy + 'static> { /* private fields */ }
Expand description
Metadata for a single enum or bitfield constant.
Returned by EngineEnum::all_constants()
and
EngineBitfield::all_constants()
.
Implementations§
Source§impl<T> EnumConstant<T>
impl<T> EnumConstant<T>
Sourcepub const fn rust_name(&self) -> &'static str
pub const fn rust_name(&self) -> &'static str
Rust name of the constant, usually without prefix (e.g. "ESCAPE"
for Key::ESCAPE
).
For enums, this is the value returned by EngineEnum::as_str()
if the value is unique.
If multiple enum values share the same ordinal, then this function will return each one separately, while as_str()
will return the
first one.
Sourcepub const fn godot_name(&self) -> &'static str
pub const fn godot_name(&self) -> &'static str
Godot constant name (e.g. "KEY_ESCAPE"
for Key::ESCAPE
).
Trait Implementations§
Source§impl<T: Clone + Copy + 'static> Clone for EnumConstant<T>
impl<T: Clone + Copy + 'static> Clone for EnumConstant<T>
Source§fn clone(&self) -> EnumConstant<T>
fn clone(&self) -> EnumConstant<T>
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 moreimpl<T: Copy + Copy + 'static> Copy for EnumConstant<T>
impl<T: Eq + Copy + 'static> Eq for EnumConstant<T>
impl<T: Copy + 'static> StructuralPartialEq for EnumConstant<T>
Auto Trait Implementations§
impl<T> Freeze for EnumConstant<T>where
T: Freeze,
impl<T> RefUnwindSafe for EnumConstant<T>where
T: RefUnwindSafe,
impl<T> Send for EnumConstant<T>where
T: Send,
impl<T> Sync for EnumConstant<T>where
T: Sync,
impl<T> Unpin for EnumConstant<T>where
T: Unpin,
impl<T> UnwindSafe for EnumConstant<T>where
T: UnwindSafe,
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