Struct spirt::qptr::layout::LayoutCache
source · pub(super) struct LayoutCache<'a> {
cx: Rc<Context>,
wk: &'static WellKnown,
config: &'a LayoutConfig,
cache: RefCell<IndexMap<Type, TypeLayout, BuildHasherDefault<FxHasher>>>,
}
Expand description
Context for computing TypeLayout
s from Type
s (with caching).
Fields§
§cx: Rc<Context>
§wk: &'static WellKnown
§config: &'a LayoutConfig
§cache: RefCell<IndexMap<Type, TypeLayout, BuildHasherDefault<FxHasher>>>
Implementations§
source§impl<'a> LayoutCache<'a>
impl<'a> LayoutCache<'a>
pub(super) fn new(cx: Rc<Context>, config: &'a LayoutConfig) -> Self
fn const_as_u32(&self, ct: Const) -> Option<u32>
sourcepub(super) fn layout_of(&self, ty: Type) -> Result<TypeLayout, LayoutError>
pub(super) fn layout_of(&self, ty: Type) -> Result<TypeLayout, LayoutError>
Attempt to compute a TypeLayout
for a given (SPIR-V) Type
.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LayoutCache<'a>
impl<'a> !Send for LayoutCache<'a>
impl<'a> !Sync for LayoutCache<'a>
impl<'a> Unpin for LayoutCache<'a>
impl<'a> !UnwindSafe for LayoutCache<'a>
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