Enum pax_runtime_api::Size
source · pub enum Size {
Pixels(Numeric),
Percent(Numeric),
Combined(Numeric, Numeric),
}
Expand description
A Size value that can be either a concrete pixel value or a percent of parent bounds.
Variants§
Implementations§
source§impl Size
impl Size
pub fn ZERO() -> Self
sourcepub fn expect_percent(&self) -> f64
pub fn expect_percent(&self) -> f64
Returns the wrapped percent value normalized as a float, such that 100% => 1.0. Panics if wrapped type is not a percentage.
sourcepub fn expect_pixels(&self) -> Numeric
pub fn expect_pixels(&self) -> Numeric
Returns the pixel value Panics if wrapped type is not pixels.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Size
impl<'de> Deserialize<'de> for Size
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 From<IntoableLiteral> for Size
impl From<IntoableLiteral> for Size
source§fn from(value: IntoableLiteral) -> Self
fn from(value: IntoableLiteral) -> Self
Converts to this type from the input type.
source§impl Interpolatable for Size
impl Interpolatable for Size
fn interpolate(&self, other: &Self, t: f64) -> Self
impl Copy for Size
Auto Trait Implementations§
impl Freeze for Size
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnwindSafe for Size
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, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.