pub struct InternPool { /* private fields */ }Expand description
Shared string interner used across the llmcc core.
Implementations§
Source§impl InternPool
impl InternPool
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 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 InternPool
impl Debug for InternPool
Auto Trait Implementations§
impl !Freeze for InternPool
impl !RefUnwindSafe for InternPool
impl Send for InternPool
impl !Sync for InternPool
impl Unpin for InternPool
impl UnwindSafe for InternPool
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> 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