#[repr(C)]pub struct GenericAnchorSizeFunction<Fallback> {
pub target_element: DashedIdent,
pub size: AnchorSizeKeyword,
pub fallback: Optional<Fallback>,
}
Expand description
Anchor size function used by sizing, margin and inset properties. This resolves to the size of the anchor at computed time.
https://drafts.csswg.org/css-anchor-position-1/#funcdef-anchor-size
Fields§
§target_element: DashedIdent
Anchor name of the element to anchor to. If omitted (i.e. empty), selects the implicit anchor element.
size: AnchorSizeKeyword
Size of the positioned element, expressed in that of the anchor element. If omitted, defaults to the axis of the property the function is used in.
fallback: Optional<Fallback>
Value to use in case the anchor function is invalid.
Implementations§
Source§impl<Fallback> GenericAnchorSizeFunction<Fallback>
impl<Fallback> GenericAnchorSizeFunction<Fallback>
Sourcepub fn valid_for(&self, position_property: PositionProperty) -> bool
pub fn valid_for(&self, position_property: PositionProperty) -> bool
Is the anchor-size use valid for given property?
Source§impl<LengthPercentage> GenericAnchorSizeFunction<LengthPercentage>
impl<LengthPercentage> GenericAnchorSizeFunction<LengthPercentage>
Sourcepub fn parse_inner<'i, 't, F>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
f: F,
) -> Result<Self, ParseError<'i>>
pub fn parse_inner<'i, 't, F>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, f: F, ) -> Result<Self, ParseError<'i>>
Parse the inner part of anchor-size()
, after the parser has consumed “anchor-size(”.
Source§impl GenericAnchorSizeFunction<Box<CalcNode>>
impl GenericAnchorSizeFunction<Box<CalcNode>>
fn parse_in_calc<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
Trait Implementations§
Source§impl<Fallback> Animate for GenericAnchorSizeFunction<Fallback>where
Fallback: Animate,
impl<Fallback> Animate for GenericAnchorSizeFunction<Fallback>where
Fallback: Animate,
Source§impl<Fallback: Clone> Clone for GenericAnchorSizeFunction<Fallback>
impl<Fallback: Clone> Clone for GenericAnchorSizeFunction<Fallback>
Source§fn clone(&self) -> GenericAnchorSizeFunction<Fallback>
fn clone(&self) -> GenericAnchorSizeFunction<Fallback>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Fallback> ComputeSquaredDistance for GenericAnchorSizeFunction<Fallback>where
Fallback: ComputeSquaredDistance,
impl<Fallback> ComputeSquaredDistance for GenericAnchorSizeFunction<Fallback>where
Fallback: ComputeSquaredDistance,
Source§fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
Computes the squared distance between two animatable values.
Source§impl<Fallback: Debug> Debug for GenericAnchorSizeFunction<Fallback>
impl<Fallback: Debug> Debug for GenericAnchorSizeFunction<Fallback>
Source§impl<'de, Fallback> Deserialize<'de> for GenericAnchorSizeFunction<Fallback>where
Fallback: Deserialize<'de>,
impl<'de, Fallback> Deserialize<'de> for GenericAnchorSizeFunction<Fallback>where
Fallback: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Fallback> MallocSizeOf for GenericAnchorSizeFunction<Fallback>where
Fallback: MallocSizeOf,
impl<Fallback> MallocSizeOf for GenericAnchorSizeFunction<Fallback>where
Fallback: MallocSizeOf,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl<Fallback> Parse for GenericAnchorSizeFunction<Fallback>where
Fallback: Parse,
impl<Fallback> Parse for GenericAnchorSizeFunction<Fallback>where
Fallback: Parse,
Source§fn parse<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>>
fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>>
Parse a value of this type. Read more
Source§impl<Fallback: PartialEq> PartialEq for GenericAnchorSizeFunction<Fallback>
impl<Fallback: PartialEq> PartialEq for GenericAnchorSizeFunction<Fallback>
Source§fn eq(&self, other: &GenericAnchorSizeFunction<Fallback>) -> bool
fn eq(&self, other: &GenericAnchorSizeFunction<Fallback>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<Fallback> Serialize for GenericAnchorSizeFunction<Fallback>where
Fallback: Serialize,
impl<Fallback> Serialize for GenericAnchorSizeFunction<Fallback>where
Fallback: Serialize,
Source§impl<Fallback> SpecifiedValueInfo for GenericAnchorSizeFunction<Fallback>where
Fallback: SpecifiedValueInfo,
impl<Fallback> SpecifiedValueInfo for GenericAnchorSizeFunction<Fallback>where
Fallback: SpecifiedValueInfo,
Source§const SUPPORTED_TYPES: u8
const SUPPORTED_TYPES: u8
Supported CssTypes by the given value type. Read more
Source§impl<Fallback> ToAnimatedValue for GenericAnchorSizeFunction<Fallback>where
Fallback: ToAnimatedValue,
impl<Fallback> ToAnimatedValue for GenericAnchorSizeFunction<Fallback>where
Fallback: ToAnimatedValue,
Source§type AnimatedValue = GenericAnchorSizeFunction<<Fallback as ToAnimatedValue>::AnimatedValue>
type AnimatedValue = GenericAnchorSizeFunction<<Fallback as ToAnimatedValue>::AnimatedValue>
The type of the animated value.
Source§fn from_animated_value(from: Self::AnimatedValue) -> Self
fn from_animated_value(from: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.
Source§fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
Converts this value to an animated value.
Source§impl<Fallback> ToAnimatedZero for GenericAnchorSizeFunction<Fallback>where
Fallback: ToAnimatedZero,
impl<Fallback> ToAnimatedZero for GenericAnchorSizeFunction<Fallback>where
Fallback: ToAnimatedZero,
Source§fn to_animated_zero(&self) -> Result<Self, ()>
fn to_animated_zero(&self) -> Result<Self, ()>
Returns a value that, when added with an underlying value, will produce the underlying
value. This is used for SMIL animation’s “by-animation” where SMIL first interpolates from
the zero value to the ‘by’ value, and then adds the result to the underlying value. Read more
Source§impl<Fallback> ToComputedValue for GenericAnchorSizeFunction<Fallback>where
Fallback: ToComputedValue,
impl<Fallback> ToComputedValue for GenericAnchorSizeFunction<Fallback>where
Fallback: ToComputedValue,
Source§type ComputedValue = GenericAnchorSizeFunction<<Fallback as ToComputedValue>::ComputedValue>
type ComputedValue = GenericAnchorSizeFunction<<Fallback as ToComputedValue>::ComputedValue>
The computed value type we’re going to be converted to.
Source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
Convert a computed value to specified value form. Read more
Source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Convert a specified value to a computed value, using itself and the data
inside the
Context
.Source§impl<Fallback> ToCss for GenericAnchorSizeFunction<Fallback>where
Fallback: ToCss,
impl<Fallback> ToCss for GenericAnchorSizeFunction<Fallback>where
Fallback: ToCss,
Source§impl<Fallback> ToResolvedValue for GenericAnchorSizeFunction<Fallback>where
Fallback: ToResolvedValue,
impl<Fallback> ToResolvedValue for GenericAnchorSizeFunction<Fallback>where
Fallback: ToResolvedValue,
Source§type ResolvedValue = GenericAnchorSizeFunction<<Fallback as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericAnchorSizeFunction<<Fallback as ToResolvedValue>::ResolvedValue>
The resolved value type we’re going to be converted to.
Source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
Source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.
Source§impl<Fallback> ToShmem for GenericAnchorSizeFunction<Fallback>where
Fallback: ToShmem,
impl<Fallback> ToShmem for GenericAnchorSizeFunction<Fallback>where
Fallback: ToShmem,
impl<Fallback> StructuralPartialEq for GenericAnchorSizeFunction<Fallback>
Auto Trait Implementations§
impl<Fallback> Freeze for GenericAnchorSizeFunction<Fallback>where
Fallback: Freeze,
impl<Fallback> RefUnwindSafe for GenericAnchorSizeFunction<Fallback>where
Fallback: RefUnwindSafe,
impl<Fallback> Send for GenericAnchorSizeFunction<Fallback>where
Fallback: Send,
impl<Fallback> Sync for GenericAnchorSizeFunction<Fallback>where
Fallback: Sync,
impl<Fallback> Unpin for GenericAnchorSizeFunction<Fallback>where
Fallback: Unpin,
impl<Fallback> UnwindSafe for GenericAnchorSizeFunction<Fallback>where
Fallback: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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