pub struct ClassName { /* private fields */ }
Expand description
Name of a class registered with Godot.
Holds the Godot name, not the Rust name (they sometimes differ, e.g. Godot CSGMesh3D
vs Rust CsgMesh3D
).
You cannot construct instances of this type yourself; use GodotClass::class_name()
.
This struct is very cheap to copy.
Implementations§
§impl ClassName
impl ClassName
pub fn from_ascii_cstr(bytes: &'static [u8]) -> ClassName
pub fn from_ascii_cstr(bytes: &'static [u8]) -> ClassName
Construct from a null-terminated ASCII string.
§Panics
If the string is not null-terminated or contains internal null bytes.
pub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Returns the class name as a string slice with static storage duration.
pub fn to_gstring(&self) -> GString
pub fn to_gstring(&self) -> GString
Converts the class name to a GString
.
pub fn to_string_name(&self) -> StringName
pub fn to_string_name(&self) -> StringName
Converts the class name to a StringName
.
Trait Implementations§
impl Copy for ClassName
impl Eq for ClassName
Auto Trait Implementations§
impl Freeze for ClassName
impl RefUnwindSafe for ClassName
impl Send for ClassName
impl Sync for ClassName
impl Unpin for ClassName
impl UnwindSafe for ClassName
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)