pub struct InternerSnapshot {
pub strings: Vec<String>,
}Expand description
A per-file interner snapshot — strings[i] is the string value of the
Spur whose raw key equals i. Indexed by Key::into_usize, which for
lasso’s default Spur is NonZeroU32 minus one (i.e. the first
interned string has key 0, the second has key 1, etc.).
Fields§
§strings: Vec<String>Implementations§
Source§impl InternerSnapshot
impl InternerSnapshot
Sourcepub fn capture(interner: &ThreadedRodeo) -> Self
pub fn capture(interner: &ThreadedRodeo) -> Self
Build a snapshot from a ThreadedRodeo, capturing every interned
string in Spur::into_usize order.
Used at cache write time, after a file has finished parsing into its own per-file interner.
Sourcepub fn restore_into(&self, target: &ThreadedRodeo) -> Vec<Spur>
pub fn restore_into(&self, target: &ThreadedRodeo) -> Vec<Spur>
Re-intern every string into target, returning a remap table where
remap[i] is the new Spur for the cached string at index i.
Used at cache read time, after deserializing a CachedParseOutput
or CachedRirOutput, before the AST/RIR’s Spur values can be
trusted against the build’s shared interner.
Trait Implementations§
Source§impl Clone for InternerSnapshot
impl Clone for InternerSnapshot
Source§fn clone(&self) -> InternerSnapshot
fn clone(&self) -> InternerSnapshot
Returns a duplicate 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 moreSource§impl Debug for InternerSnapshot
impl Debug for InternerSnapshot
Source§impl Default for InternerSnapshot
impl Default for InternerSnapshot
Source§fn default() -> InternerSnapshot
fn default() -> InternerSnapshot
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for InternerSnapshot
impl<'de> Deserialize<'de> for InternerSnapshot
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
Auto Trait Implementations§
impl Freeze for InternerSnapshot
impl RefUnwindSafe for InternerSnapshot
impl Send for InternerSnapshot
impl Sync for InternerSnapshot
impl Unpin for InternerSnapshot
impl UnsafeUnpin for InternerSnapshot
impl UnwindSafe for InternerSnapshot
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
Check whether an item is contained within this sequence.
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
Convert an item of the sequence into a [
MaybeRef].