pub struct StringInterner { /* private fields */ }Expand description
文字列インターナー
Implementations§
Source§impl StringInterner
impl StringInterner
Sourcepub fn intern(&mut self, s: &str) -> InternedStr
pub fn intern(&mut self, s: &str) -> InternedStr
文字列をインターンし、IDを返す
Sourcepub fn get(&self, id: InternedStr) -> &str
pub fn get(&self, id: InternedStr) -> &str
IDから文字列を取得
Sourcepub fn lookup(&self, s: &str) -> Option<InternedStr>
pub fn lookup(&self, s: &str) -> Option<InternedStr>
文字列がインターン済みか検索(新規登録しない)
Trait Implementations§
Source§impl Clone for StringInterner
impl Clone for StringInterner
Source§fn clone(&self) -> StringInterner
fn clone(&self) -> StringInterner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StringInterner
impl Debug for StringInterner
Source§impl Default for StringInterner
impl Default for StringInterner
Source§fn default() -> StringInterner
fn default() -> StringInterner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StringInterner
impl RefUnwindSafe for StringInterner
impl Send for StringInterner
impl Sync for StringInterner
impl Unpin for StringInterner
impl UnsafeUnpin for StringInterner
impl UnwindSafe for StringInterner
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