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
epsilon.
Tuple Fields§
§0: f32
Implementations§
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 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 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
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 IntoVar<Align> for FactorPercent
impl IntoVar<Align> for FactorPercent
source§impl IntoVar<Factor> for FactorPercent
impl IntoVar<Factor> for FactorPercent
source§impl IntoVar<Factor2d> for FactorPercent
impl IntoVar<Factor2d> for FactorPercent
source§impl IntoVar<FactorPercent> for Factor
impl IntoVar<FactorPercent> for Factor
source§fn into_var(self) -> <Factor as IntoVar<FactorPercent>>::Var
fn into_var(self) -> <Factor as IntoVar<FactorPercent>>::Var
Converts the source value into a var.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl IntoVar<FactorSideOffsets> for FactorPercent
impl IntoVar<FactorSideOffsets> for FactorPercent
source§impl IntoVar<GridSpacing> for FactorPercent
impl IntoVar<GridSpacing> for FactorPercent
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§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 moreimpl Copy 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 Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Access to mut
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
Clone the value.
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
Clone the value into a new boxed
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self
equals other
.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
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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