pub struct InternedSlice<T> { /* private fields */ }Expand description
A handle to an interned value in an ArenaSlice.
Implementations§
Source§impl<T> InternedSlice<T>
impl<T> InternedSlice<T>
Source§impl<T> InternedSlice<T>
impl<T> InternedSlice<T>
Sourcepub fn from(arena: &ArenaSlice<T>, value: &[T]) -> Self
pub fn from(arena: &ArenaSlice<T>, value: &[T]) -> Self
Interns the given value in the given ArenaSlice.
If the value was already interned in this arena, its interning index will simply be returned. Otherwise it will be stored into the arena.
Source§impl<T> InternedSlice<T>
impl<T> InternedSlice<T>
Sourcepub fn lookup<'a>(&self, arena: &'a ArenaSlice<T>) -> &'a [T]
pub fn lookup<'a>(&self, arena: &'a ArenaSlice<T>) -> &'a [T]
Retrieves this interned value from the given ArenaSlice.
The caller is responsible for ensuring that the same arena was used to intern this value, otherwise an arbitrary value will be returned or a panic will happen.
Trait Implementations§
Source§impl<T> Clone for InternedSlice<T>
impl<T> Clone for InternedSlice<T>
Source§impl<T> Debug for InternedSlice<T>
impl<T> Debug for InternedSlice<T>
Source§impl<'de, T> Deserialize<'de> for InternedSlice<T>
Available on crate feature serde only.
impl<'de, T> Deserialize<'de> for InternedSlice<T>
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> GetSize for InternedSlice<T>
Available on crate feature get-size2 only.
impl<T> GetSize for InternedSlice<T>
Available on crate feature
get-size2 only.Source§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack. Read more
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap. Read more
Source§fn get_heap_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_heap_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
Determines how many bytes this object occupies inside the heap while using a
tracker. Read moreSource§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
Determines the total size of the object while using a
tracker. Read moreSource§impl<T> Hash for InternedSlice<T>
impl<T> Hash for InternedSlice<T>
Source§impl<T> Ord for InternedSlice<T>
impl<T> Ord for InternedSlice<T>
Source§impl<T> PartialEq for InternedSlice<T>
impl<T> PartialEq for InternedSlice<T>
Source§impl<T> PartialOrd for InternedSlice<T>
impl<T> PartialOrd for InternedSlice<T>
Source§impl<T> Serialize for InternedSlice<T>
Available on crate feature serde only.
impl<T> Serialize for InternedSlice<T>
Available on crate feature
serde only.impl<T> Copy for InternedSlice<T>
impl<T> Eq for InternedSlice<T>
Auto Trait Implementations§
impl<T> Freeze for InternedSlice<T>
impl<T> RefUnwindSafe for InternedSlice<T>
impl<T> Send for InternedSlice<T>
impl<T> Sync for InternedSlice<T>
impl<T> Unpin for InternedSlice<T>
impl<T> UnwindSafe for InternedSlice<T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.