pub enum ContainerSizeQuery<'a> {
NotEvaluated(Box<dyn Fn() -> ContainerSizeQueryResult + 'a>),
Evaluated(ContainerSizeQueryResult),
}
Expand description
Unevaluated lazy container size query.
Variants§
NotEvaluated(Box<dyn Fn() -> ContainerSizeQueryResult + 'a>)
Query prior to evaluation.
Evaluated(ContainerSizeQueryResult)
Cached evaluated result.
Implementations§
source§impl<'a> ContainerSizeQuery<'a>
impl<'a> ContainerSizeQuery<'a>
fn evaluate_potential_size_container<E>(
e: E,
originating_element_style: Option<&ComputedValues>,
) -> TraversalResult<ContainerSizeQueryResult>where
E: TElement,
sourcefn lookup<E>(
element: E,
originating_element_style: Option<&ComputedValues>,
) -> ContainerSizeQueryResultwhere
E: TElement + 'a,
fn lookup<E>(
element: E,
originating_element_style: Option<&ComputedValues>,
) -> ContainerSizeQueryResultwhere
E: TElement + 'a,
Find the query container size for a given element. Meant to be used as a callback for new().
sourcepub fn for_element<E>(
element: E,
known_parent_style: Option<&'a ComputedValues>,
is_pseudo: bool,
) -> Selfwhere
E: TElement + 'a,
pub fn for_element<E>(
element: E,
known_parent_style: Option<&'a ComputedValues>,
is_pseudo: bool,
) -> Selfwhere
E: TElement + 'a,
Create a new instance of the container size query for given element, with a deferred lookup callback.
sourcepub fn for_option_element<E>(
element: Option<E>,
known_parent_style: Option<&'a ComputedValues>,
is_pseudo: bool,
) -> Selfwhere
E: TElement + 'a,
pub fn for_option_element<E>(
element: Option<E>,
known_parent_style: Option<&'a ComputedValues>,
is_pseudo: bool,
) -> Selfwhere
E: TElement + 'a,
Create a new instance, but with optional element.
sourcepub fn none() -> Self
pub fn none() -> Self
Create a query that evaluates to empty, for cases where container size query is not required.
sourcepub fn get(&mut self) -> ContainerSizeQueryResult
pub fn get(&mut self) -> ContainerSizeQueryResult
Get the result of the container size query, doing the lookup if called for the first time.
Auto Trait Implementations§
impl<'a> Freeze for ContainerSizeQuery<'a>
impl<'a> !RefUnwindSafe for ContainerSizeQuery<'a>
impl<'a> !Send for ContainerSizeQuery<'a>
impl<'a> !Sync for ContainerSizeQuery<'a>
impl<'a> Unpin for ContainerSizeQuery<'a>
impl<'a> !UnwindSafe for ContainerSizeQuery<'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> 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