pub struct LayoutCache { /* private fields */ }Expand description
Cached layout plans.
Offsets are invariant under endianness, so an entry serves both byte
orders; it is keyed by everything else that moves one, which is
LayoutKey::offset_key. Spec §7.
Implementations§
Source§impl LayoutCache
impl LayoutCache
Sourcepub fn layout(
&mut self,
ast: &Ast,
type_: Id<TypeNode>,
key: LayoutKey,
) -> Result<&TypeLayout, LayoutError>
pub fn layout( &mut self, ast: &Ast, type_: Id<TypeNode>, key: LayoutKey, ) -> Result<&TypeLayout, LayoutError>
Sourcepub fn invalidate(&mut self, changeset: &Changeset)
pub fn invalidate(&mut self, changeset: &Changeset)
Evict everything whose plan consulted any node the changeset touched.
Precise rather than wholesale: a change to one type leaves plans for unrelated types in place, and evicts the ones that contain it however deeply. Spec §7.
Trait Implementations§
Source§impl Clone for LayoutCache
impl Clone for LayoutCache
Source§impl Debug for LayoutCache
impl Debug for LayoutCache
Auto Trait Implementations§
impl Freeze for LayoutCache
impl RefUnwindSafe for LayoutCache
impl Send for LayoutCache
impl Sync for LayoutCache
impl Unpin for LayoutCache
impl UnsafeUnpin for LayoutCache
impl UnwindSafe for LayoutCache
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