pub struct FactorPercent(pub f32);Expand description
Multiplication factor in percentage (0%-100%).
See FactorUnits for more details.
§Equality
Equality is determined using about_eq with 0.001 granularity.
Tuple Fields§
§0: f32Implementations§
Source§impl FactorPercent
impl FactorPercent
Sourcepub fn clamp_range(self) -> FactorPercent
pub fn clamp_range(self) -> FactorPercent
Clamp factor to [0.0..=100.0] range.
Trait Implementations§
Source§impl Add for FactorPercent
impl Add for FactorPercent
Source§type Output = FactorPercent
type Output = FactorPercent
The resulting type after applying the
+ operator.Source§fn add(self, rhs: FactorPercent) -> <FactorPercent as Add>::Output
fn add(self, rhs: FactorPercent) -> <FactorPercent as Add>::Output
Performs the
+ operation. Read moreSource§impl AddAssign for FactorPercent
impl AddAssign for FactorPercent
Source§fn add_assign(&mut self, rhs: FactorPercent)
fn add_assign(&mut self, rhs: FactorPercent)
Performs the
+= operation. Read moreSource§impl Clone for FactorPercent
impl Clone for FactorPercent
Source§fn clone(&self) -> FactorPercent
fn clone(&self) -> FactorPercent
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 Debug for FactorPercent
impl Debug for FactorPercent
Source§impl<'de> Deserialize<'de> for FactorPercent
impl<'de> Deserialize<'de> for FactorPercent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FactorPercent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FactorPercent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for FactorPercent
impl Display for FactorPercent
Source§impl Div<Factor> for FactorPercent
impl Div<Factor> for FactorPercent
Source§type Output = FactorPercent
type Output = FactorPercent
The resulting type after applying the
/ operator.Source§impl Div for FactorPercent
impl Div for FactorPercent
Source§type Output = FactorPercent
type Output = FactorPercent
The resulting type after applying the
/ operator.Source§fn div(self, rhs: FactorPercent) -> <FactorPercent as Div>::Output
fn div(self, rhs: FactorPercent) -> <FactorPercent as Div>::Output
Performs the
/ operation. Read moreSource§impl DivAssign<Factor> for FactorPercent
impl DivAssign<Factor> for FactorPercent
Source§fn div_assign(&mut self, rhs: Factor)
fn div_assign(&mut self, rhs: Factor)
Performs the
/= operation. Read moreSource§impl DivAssign for FactorPercent
impl DivAssign for FactorPercent
Source§fn div_assign(&mut self, rhs: FactorPercent)
fn div_assign(&mut self, rhs: FactorPercent)
Performs the
/= operation. Read moreSource§impl From<Factor> for FactorPercent
impl From<Factor> for FactorPercent
Source§fn from(value: Factor) -> FactorPercent
fn from(value: Factor) -> FactorPercent
Converts to this type from the input type.
Source§impl From<FactorPercent> for Align
impl From<FactorPercent> for Align
Source§fn from(xy: FactorPercent) -> Self
fn from(xy: FactorPercent) -> Self
Converts to this type from the input type.
Source§impl From<FactorPercent> for Factor
impl From<FactorPercent> for Factor
Source§fn from(value: FactorPercent) -> Factor
fn from(value: FactorPercent) -> Factor
Converts to this type from the input type.
Source§impl From<FactorPercent> for Factor2d
impl From<FactorPercent> for Factor2d
Source§fn from(xy: FactorPercent) -> Self
fn from(xy: FactorPercent) -> Self
Converts to this type from the input type.
Source§impl From<FactorPercent> for FactorSideOffsets
impl From<FactorPercent> for FactorSideOffsets
Source§fn from(percent: FactorPercent) -> Self
fn from(percent: FactorPercent) -> Self
All sides equal.
Source§impl From<FactorPercent> for GridSpacing
impl From<FactorPercent> for GridSpacing
Source§fn from(percent: FactorPercent) -> Self
fn from(percent: FactorPercent) -> Self
Column and row equal relative length.
Source§impl From<FactorPercent> for Length
impl From<FactorPercent> for Length
Source§fn from(percent: FactorPercent) -> Self
fn from(percent: FactorPercent) -> Self
Conversion to Length::Factor
Source§impl From<FactorPercent> for Point
impl From<FactorPercent> for Point
Source§fn from(percent: FactorPercent) -> Self
fn from(percent: FactorPercent) -> Self
Splat relative length.
Source§impl From<FactorPercent> for RgbaComponent
Color channel value is in the [0..=100] range.
impl From<FactorPercent> for RgbaComponent
Color channel value is in the [0..=100] range.
Source§fn from(p: FactorPercent) -> RgbaComponent
fn from(p: FactorPercent) -> RgbaComponent
Converts to this type from the input type.
Source§impl From<FactorPercent> for SideOffsets
impl From<FactorPercent> for SideOffsets
Source§fn from(percent: FactorPercent) -> Self
fn from(percent: FactorPercent) -> Self
All sides equal relative length.
Source§impl From<FactorPercent> for Size
impl From<FactorPercent> for Size
Source§fn from(percent: FactorPercent) -> Self
fn from(percent: FactorPercent) -> Self
Splat relative length.
Source§impl From<FactorPercent> for Vector
impl From<FactorPercent> for Vector
Source§fn from(percent: FactorPercent) -> Self
fn from(percent: FactorPercent) -> Self
Conversion to Length::Factor then to vector.
Source§impl FromStr for FactorPercent
Parses "##", "##%" and "##.fct()" where ## is a f32.
impl FromStr for FactorPercent
Parses "##", "##%" and "##.fct()" where ## is a f32.
Source§type Err = ParseFloatError
type Err = ParseFloatError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<FactorPercent, <FactorPercent as FromStr>::Err>
fn from_str(s: &str) -> Result<FactorPercent, <FactorPercent as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl IntoVar<FactorPercent> for Factor
impl IntoVar<FactorPercent> for Factor
fn into_var(self) -> Var<FactorPercent>
Source§impl IntoVar<FactorSideOffsets> for FactorPercent
impl IntoVar<FactorSideOffsets> for FactorPercent
Source§fn into_var(self) -> Var<FactorSideOffsets>
fn into_var(self) -> Var<FactorSideOffsets>
All sides equal.
Source§impl IntoVar<GridSpacing> for FactorPercent
impl IntoVar<GridSpacing> for FactorPercent
Source§fn into_var(self) -> Var<GridSpacing>
fn into_var(self) -> Var<GridSpacing>
Column and row equal relative length.
Source§impl IntoVar<Length> for FactorPercent
impl IntoVar<Length> for FactorPercent
Source§impl IntoVar<Point> for FactorPercent
impl IntoVar<Point> for FactorPercent
Source§impl IntoVar<SideOffsets> for FactorPercent
impl IntoVar<SideOffsets> for FactorPercent
Source§fn into_var(self) -> Var<SideOffsets>
fn into_var(self) -> Var<SideOffsets>
All sides equal relative length.
Source§impl IntoVar<Size> for FactorPercent
impl IntoVar<Size> for FactorPercent
Source§impl IntoVar<Vector> for FactorPercent
impl IntoVar<Vector> for FactorPercent
Source§impl Mul<Factor> for FactorPercent
impl Mul<Factor> for FactorPercent
Source§type Output = FactorPercent
type Output = FactorPercent
The resulting type after applying the
* operator.Source§impl Mul for FactorPercent
impl Mul for FactorPercent
Source§type Output = FactorPercent
type Output = FactorPercent
The resulting type after applying the
* operator.Source§fn mul(self, rhs: FactorPercent) -> <FactorPercent as Mul>::Output
fn mul(self, rhs: FactorPercent) -> <FactorPercent as Mul>::Output
Performs the
* operation. Read moreSource§impl MulAssign<Factor> for FactorPercent
impl MulAssign<Factor> for FactorPercent
Source§fn mul_assign(&mut self, rhs: Factor)
fn mul_assign(&mut self, rhs: Factor)
Performs the
*= operation. Read moreSource§impl MulAssign for FactorPercent
impl MulAssign for FactorPercent
Source§fn mul_assign(&mut self, rhs: FactorPercent)
fn mul_assign(&mut self, rhs: FactorPercent)
Performs the
*= operation. Read moreSource§impl Neg for FactorPercent
impl Neg for FactorPercent
Source§impl PartialEq for FactorPercent
impl PartialEq for FactorPercent
Source§impl Serialize for FactorPercent
impl Serialize for FactorPercent
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 Sub for FactorPercent
impl Sub for FactorPercent
Source§type Output = FactorPercent
type Output = FactorPercent
The resulting type after applying the
- operator.Source§fn sub(self, rhs: FactorPercent) -> <FactorPercent as Sub>::Output
fn sub(self, rhs: FactorPercent) -> <FactorPercent as Sub>::Output
Performs the
- operation. Read moreSource§impl SubAssign for FactorPercent
impl SubAssign for FactorPercent
Source§fn sub_assign(&mut self, rhs: FactorPercent)
fn sub_assign(&mut self, rhs: FactorPercent)
Performs the
-= operation. Read moreSource§impl Transitionable for FactorPercent
impl Transitionable for FactorPercent
Source§fn lerp(self, to: &FactorPercent, step: Factor) -> FactorPercent
fn lerp(self, to: &FactorPercent, step: Factor) -> FactorPercent
Sample the linear interpolation from
self -> to by step.impl Copy for FactorPercent
impl Eq for FactorPercent
impl IntoValue<Align> for FactorPercent
impl IntoValue<Factor> for FactorPercent
impl IntoValue<Factor2d> for FactorPercent
impl IntoValue<FactorPercent> for Factor
impl IntoValue<FactorSideOffsets> for FactorPercent
impl IntoValue<GridSpacing> for FactorPercent
impl IntoValue<Length> for FactorPercent
impl IntoValue<Point> for FactorPercent
impl IntoValue<SideOffsets> for FactorPercent
impl IntoValue<Size> for FactorPercent
impl IntoValue<Vector> for FactorPercent
Auto Trait Implementations§
impl Freeze for FactorPercent
impl RefUnwindSafe for FactorPercent
impl Send for FactorPercent
impl Sync for FactorPercent
impl Unpin for FactorPercent
impl UnwindSafe for FactorPercent
Blanket Implementations§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Clone the value.
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
Swap value with
other if both are of the same type.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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more