struct CacheMode(u8);Expand description
The layout inputs that affect a node’s layout but are not part of the CacheKey: the
SizingMode and whether each of the node’s vertical margins is collapsible, packed into a u8.
These are determined by the layout algorithm of the node’s parent and by the node’s own style,
so they only change for a given node when one of those changes. Rather than keying every entry
on them, a Cache records the single mode that all of its entries were computed with.
Tuple Fields§
§0: u8Implementations§
Source§impl CacheMode
impl CacheMode
Sourceconst INHERENT_SIZE_BIT: u8 = 0b001
const INHERENT_SIZE_BIT: u8 = 0b001
Set if the sizing mode is SizingMode::InherentSize
Sourceconst COLLAPSIBLE_START_MARGIN_BIT: u8 = 0b010
const COLLAPSIBLE_START_MARGIN_BIT: u8 = 0b010
Set if the node’s top margin is collapsible
Sourceconst COLLAPSIBLE_END_MARGIN_BIT: u8 = 0b100
const COLLAPSIBLE_END_MARGIN_BIT: u8 = 0b100
Set if the node’s bottom margin is collapsible
Trait Implementations§
impl Copy for CacheMode
impl Eq for CacheMode
Source§impl From<&LayoutInput> for CacheMode
impl From<&LayoutInput> for CacheMode
Source§fn from(input: &LayoutInput) -> Self
fn from(input: &LayoutInput) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for CacheMode
Auto Trait Implementations§
impl Freeze for CacheMode
impl RefUnwindSafe for CacheMode
impl Send for CacheMode
impl Sync for CacheMode
impl Unpin for CacheMode
impl UnsafeUnpin for CacheMode
impl UnwindSafe for CacheMode
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