Struct rhai::StringsInterner
source · [−]pub struct StringsInterner { /* private fields */ }
Expand description
(internals) A factory of identifiers from text strings.
Exported under the internals
feature only.
Normal identifiers, property getters and setters are interned separately.
Implementations
sourceimpl StringsInterner
impl StringsInterner
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new StringsInterner
.
sourcepub fn get(
&mut self,
prefix: impl AsRef<str>,
text: impl AsRef<str>
) -> ImmutableString
pub fn get(
&mut self,
prefix: impl AsRef<str>,
text: impl AsRef<str>
) -> ImmutableString
Get an identifier from a text string and prefix, adding it to the interner if necessary.
Prefix
Currently recognized prefixes are:
""
- None (normal string)"get$"
- Property getter, not available underno_object
"set$"
- Property setter, not available underno_object
Panics
Panics if the prefix is not recognized.
Trait Implementations
sourceimpl AddAssign<&'_ StringsInterner> for StringsInterner
impl AddAssign<&'_ StringsInterner> for StringsInterner
sourcefn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
Performs the +=
operation. Read more
sourceimpl AddAssign<StringsInterner> for StringsInterner
impl AddAssign<StringsInterner> for StringsInterner
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the +=
operation. Read more
sourceimpl Clone for StringsInterner
impl Clone for StringsInterner
sourcefn clone(&self) -> StringsInterner
fn clone(&self) -> StringsInterner
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for StringsInterner
impl Debug for StringsInterner
sourceimpl Default for StringsInterner
impl Default for StringsInterner
sourcefn default() -> StringsInterner
fn default() -> StringsInterner
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for StringsInterner
impl !Send for StringsInterner
impl !Sync for StringsInterner
impl Unpin for StringsInterner
impl UnwindSafe for StringsInterner
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more