Struct layout_2020::taffy::stylo_taffy::convert::stylo::Percentage
source · #[repr(C)]pub(crate) struct Percentage(pub f32);
Expand description
A computed percentage.
Tuple Fields§
§0: f32
Implementations§
source§impl Percentage
impl Percentage
sourcepub fn hundred() -> Percentage
pub fn hundred() -> Percentage
100%
sourcepub fn abs(&self) -> Percentage
pub fn abs(&self) -> Percentage
Returns the absolute value for this percentage.
sourcepub fn clamp_to_non_negative(self) -> Percentage
pub fn clamp_to_non_negative(self) -> Percentage
Clamps this percentage to a non-negative percentage.
Trait Implementations§
source§impl Add for Percentage
impl Add for Percentage
source§type Output = Percentage
type Output = Percentage
The resulting type after applying the
+
operator.source§fn add(self, other: Percentage) -> Percentage
fn add(self, other: Percentage) -> Percentage
Performs the
+
operation. Read moresource§impl AddAssign for Percentage
impl AddAssign for Percentage
source§fn add_assign(&mut self, other: Percentage)
fn add_assign(&mut self, other: Percentage)
Performs the
+=
operation. Read moresource§impl Animate for Percentage
impl Animate for Percentage
source§fn animate(
&self,
other: &Percentage,
procedure: Procedure,
) -> Result<Percentage, ()>
fn animate( &self, other: &Percentage, procedure: Procedure, ) -> Result<Percentage, ()>
Animate a value towards another one, given an animation procedure.
source§impl Clone for Percentage
impl Clone for Percentage
source§fn clone(&self) -> Percentage
fn clone(&self) -> Percentage
Returns a copy 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 ComputeSquaredDistance for Percentage
impl ComputeSquaredDistance for Percentage
source§fn compute_squared_distance(
&self,
other: &Percentage,
) -> Result<SquaredDistance, ()>
fn compute_squared_distance( &self, other: &Percentage, ) -> Result<SquaredDistance, ()>
Computes the squared distance between two animatable values.
source§impl Debug for Percentage
impl Debug for Percentage
source§impl Default for Percentage
impl Default for Percentage
source§fn default() -> Percentage
fn default() -> Percentage
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for Percentage
impl<'de> Deserialize<'de> for Percentage
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Percentage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Percentage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl MallocSizeOf for Percentage
impl MallocSizeOf for Percentage
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 PartialEq for Percentage
impl PartialEq for Percentage
source§impl PartialOrd for Percentage
impl PartialOrd for Percentage
source§impl Rem for Percentage
impl Rem for Percentage
source§type Output = Percentage
type Output = Percentage
The resulting type after applying the
%
operator.source§fn rem(self, other: Percentage) -> Percentage
fn rem(self, other: Percentage) -> Percentage
Performs the
%
operation. Read moresource§impl Serialize for Percentage
impl Serialize for Percentage
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl SpecifiedValueInfo for Percentage
impl SpecifiedValueInfo for Percentage
source§const SUPPORTED_TYPES: u8 = 0u8
const SUPPORTED_TYPES: u8 = 0u8
Supported CssTypes by the given value type. Read more
source§impl Sub for Percentage
impl Sub for Percentage
source§type Output = Percentage
type Output = Percentage
The resulting type after applying the
-
operator.source§fn sub(self, other: Percentage) -> Percentage
fn sub(self, other: Percentage) -> Percentage
Performs the
-
operation. Read moresource§impl ToAnimatedValue for Percentage
impl ToAnimatedValue for Percentage
source§type AnimatedValue = Percentage
type AnimatedValue = Percentage
The type of the animated value.
source§fn from_animated_value(
from: <Percentage as ToAnimatedValue>::AnimatedValue,
) -> Percentage
fn from_animated_value( from: <Percentage as ToAnimatedValue>::AnimatedValue, ) -> Percentage
Converts back an animated value into a computed value.
source§fn to_animated_value(
self,
context: &Context<'_>,
) -> <Percentage as ToAnimatedValue>::AnimatedValue
fn to_animated_value( self, context: &Context<'_>, ) -> <Percentage as ToAnimatedValue>::AnimatedValue
Converts this value to an animated value.
source§impl ToAnimatedZero for Percentage
impl ToAnimatedZero for Percentage
source§fn to_animated_zero(&self) -> Result<Percentage, ()>
fn to_animated_zero(&self) -> Result<Percentage, ()>
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 ToComputedValue for Percentage
impl ToComputedValue for Percentage
source§type ComputedValue = Percentage
type ComputedValue = Percentage
The computed value type we’re going to be converted to.
source§fn from_computed_value(
from: &<Percentage as ToComputedValue>::ComputedValue,
) -> Percentage
fn from_computed_value( from: &<Percentage as ToComputedValue>::ComputedValue, ) -> Percentage
Convert a computed value to specified value form. Read more
source§fn to_computed_value(
&self,
context: &Context<'_>,
) -> <Percentage as ToComputedValue>::ComputedValue
fn to_computed_value( &self, context: &Context<'_>, ) -> <Percentage as ToComputedValue>::ComputedValue
Convert a specified value to a computed value, using itself and the data
inside the
Context
.source§impl ToCss for Percentage
impl ToCss for Percentage
source§impl ToPercentage for Percentage
impl ToPercentage for Percentage
source§impl ToResolvedValue for Percentage
impl ToResolvedValue for Percentage
source§type ResolvedValue = Percentage
type ResolvedValue = Percentage
The resolved value type we’re going to be converted to.
source§fn from_resolved_value(
from: <Percentage as ToResolvedValue>::ResolvedValue,
) -> Percentage
fn from_resolved_value( from: <Percentage as ToResolvedValue>::ResolvedValue, ) -> Percentage
Convert a resolved value to resolved value form.
source§fn to_resolved_value(
self,
context: &Context<'_>,
) -> <Percentage as ToResolvedValue>::ResolvedValue
fn to_resolved_value( self, context: &Context<'_>, ) -> <Percentage as ToResolvedValue>::ResolvedValue
Convert a resolved value to a resolved value.
source§impl ToShmem for Percentage
impl ToShmem for Percentage
source§fn to_shmem(
&self,
builder: &mut SharedMemoryBuilder,
) -> Result<ManuallyDrop<Percentage>, String>
fn to_shmem( &self, builder: &mut SharedMemoryBuilder, ) -> Result<ManuallyDrop<Percentage>, String>
Clones this value into a form suitable for writing into a
SharedMemoryBuilder. Read more
source§impl Zero for Percentage
impl Zero for Percentage
impl Copy for Percentage
impl StructuralPartialEq for Percentage
Auto Trait Implementations§
impl Freeze for Percentage
impl RefUnwindSafe for Percentage
impl Send for Percentage
impl Sync for Percentage
impl Unpin for Percentage
impl UnwindSafe for Percentage
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.