pub struct StringCache<'a> { /* private fields */ }
Expand description
Caches StringName
instances at initialization.
Implementations§
Source§impl<'a> StringCache<'a>
impl<'a> StringCache<'a>
pub fn new( interface: &'a GDExtensionInterface, builtin_lifecycle: &'a BuiltinLifecycleTable, ) -> Self
Sourcepub fn fetch(&mut self, key: &'static str) -> GDExtensionStringNamePtr
pub fn fetch(&mut self, key: &'static str) -> GDExtensionStringNamePtr
Get a pointer to a StringName
. Reuses cached instances, only deallocates on destruction of this cache.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for StringCache<'a>
impl<'a> RefUnwindSafe for StringCache<'a>
impl<'a> !Send for StringCache<'a>
impl<'a> !Sync for StringCache<'a>
impl<'a> Unpin for StringCache<'a>
impl<'a> UnwindSafe for StringCache<'a>
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