Struct rhai::StringsInterner
source · pub struct StringsInterner { /* private fields */ }
Expand description
(internals) A cache for interned strings.
Exported under the internals
feature only.
Implementations§
source§impl StringsInterner
impl StringsInterner
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new StringsInterner
.
sourcepub fn get<S: AsRef<str> + Into<ImmutableString>>(
&mut self,
text: S
) -> ImmutableString
pub fn get<S: AsRef<str> + Into<ImmutableString>>( &mut self, text: S ) -> ImmutableString
Get an identifier from a text string, adding it to the interner if necessary.
sourcepub fn get_with_mapper<S: AsRef<str>>(
&mut self,
category: &str,
mapper: impl FnOnce(S) -> ImmutableString,
text: S
) -> ImmutableString
pub fn get_with_mapper<S: AsRef<str>>( &mut self, category: &str, mapper: impl FnOnce(S) -> ImmutableString, text: S ) -> ImmutableString
Get an identifier from a text string, adding it to the interner if necessary.
Trait Implementations§
source§impl AddAssign<&StringsInterner> for StringsInterner
impl AddAssign<&StringsInterner> for StringsInterner
source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
Performs the
+=
operation. Read moresource§impl AddAssign<StringsInterner> for StringsInterner
impl AddAssign<StringsInterner> for StringsInterner
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl Clone for StringsInterner
impl Clone for StringsInterner
source§fn clone(&self) -> StringsInterner
fn clone(&self) -> StringsInterner
Returns a copy 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 more