pub(crate) struct LazySize<'a> {
result: OnceCell<Au>,
data: Option<LazySizeData<'a>>,
}Expand description
Represents a size that can’t be fully resolved until the intrinsic size is known. This is useful in the block axis, since the intrinsic size depends on layout, but the other inputs are known beforehand.
Fields§
§result: OnceCell<Au>§data: Option<LazySizeData<'a>>Implementations§
Source§impl<'a> LazySize<'a>
impl<'a> LazySize<'a>
pub(crate) fn new( sizes: &'a Sizes, axis: Direction, automatic_size: Size<Au>, get_automatic_minimum_size: fn() -> Au, stretch_size: Option<Au>, is_table: bool, ) -> Self
Sourcepub(crate) fn intrinsic() -> Self
pub(crate) fn intrinsic() -> Self
Creates a LazySize that will resolve to the intrinsic size.
Should be equivalent to LazySize::new() with default parameters,
but avoiding the trouble of getting a reference to a Sizes::default()
which lives long enough.
TODO: It’s not clear what this should do if/when LazySize::resolve()
is changed to accept a ContentSizes as the intrinsic size.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for LazySize<'a>
impl<'a> !RefUnwindSafe for LazySize<'a>
impl<'a> Send for LazySize<'a>
impl<'a> !Sync for LazySize<'a>
impl<'a> Unpin for LazySize<'a>
impl<'a> UnwindSafe for LazySize<'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
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert