pub trait EngineBitfield: Copy {
// Required methods
fn try_from_ord(ord: u64) -> Option<Self>;
fn ord(self) -> u64;
fn all_constants() -> &'static [EnumConstant<Self>];
// Provided methods
fn from_ord(ord: u64) -> Self { ... }
fn is_set(self, flag: Self) -> bool { ... }
}
Expand description
Auto-implemented for all engine-provided bitfields.
Required Methods§
fn try_from_ord(ord: u64) -> Option<Self>
Sourcefn all_constants() -> &'static [EnumConstant<Self>]
fn all_constants() -> &'static [EnumConstant<Self>]
Returns metadata for all bitfield constants.
This includes all constants as they appear in the bitfield definition.
Enables introspection of available constants:
use godot::global::KeyModifierMask;
use godot::obj::EngineBitfield;
for constant in KeyModifierMask::all_constants() {
println!("* KeyModifierMask.{} (original {}) has ordinal value {}.",
constant.rust_name(),
constant.godot_name(),
constant.value().ord()
);
}
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.