pub struct InternPoolInner { /* private fields */ }Expand description
Inner implementation of the string interner.
Implementations§
Source§impl InternPoolInner
impl InternPoolInner
Sourcepub fn intern<S>(&self, value: S) -> InternedStr
pub fn intern<S>(&self, value: S) -> InternedStr
Intern the provided string slice and return its symbol.
Sourcepub fn intern_batch<S>(
&self,
values: impl IntoIterator<Item = S>,
) -> Vec<InternedStr> ⓘ
pub fn intern_batch<S>( &self, values: impl IntoIterator<Item = S>, ) -> Vec<InternedStr> ⓘ
Intern multiple strings and return a vector of their symbols.
Sourcepub fn resolve_owned(&self, symbol: InternedStr) -> Option<String>
pub fn resolve_owned(&self, symbol: InternedStr) -> Option<String>
Resolve an interned symbol back into an owned string.
Clones the underlying string from the interner to avoid lifetime issues.
Sourcepub fn with_resolved<R, F>(&self, symbol: InternedStr, f: F) -> Option<R>
pub fn with_resolved<R, F>(&self, symbol: InternedStr, f: F) -> Option<R>
Resolve an interned symbol and apply a closure while the borrow is active.
Trait Implementations§
Source§impl Debug for InternPoolInner
impl Debug for InternPoolInner
Auto Trait Implementations§
impl !Freeze for InternPoolInner
impl !RefUnwindSafe for InternPoolInner
impl Send for InternPoolInner
impl Sync for InternPoolInner
impl Unpin for InternPoolInner
impl UnwindSafe for InternPoolInner
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more