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) -> Align
fn from(xy: FactorPercent) -> Align
Converts to this type from the input type.
source§impl From<FactorPercent> for CornerRadius
impl From<FactorPercent> for CornerRadius
source§fn from(percent: FactorPercent) -> CornerRadius
fn from(percent: FactorPercent) -> CornerRadius
All corners same relative length.
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) -> Factor2d
fn from(xy: FactorPercent) -> Factor2d
Converts to this type from the input type.
source§impl From<FactorPercent> for FactorSideOffsets
impl From<FactorPercent> for FactorSideOffsets
source§fn from(percent: FactorPercent) -> FactorSideOffsets
fn from(percent: FactorPercent) -> FactorSideOffsets
All sides equal.
source§impl From<FactorPercent> for FontStretch
impl From<FactorPercent> for FontStretch
source§fn from(pct: FactorPercent) -> FontStretch
fn from(pct: FactorPercent) -> FontStretch
Converts to this type from the input type.
source§impl From<FactorPercent> for GradientRadius
impl From<FactorPercent> for GradientRadius
source§fn from(percent: FactorPercent) -> GradientRadius
fn from(percent: FactorPercent) -> GradientRadius
Conversion to Length::Factor
and to radius.
source§impl From<FactorPercent> for GradientStop
impl From<FactorPercent> for GradientStop
source§fn from(color_hint: FactorPercent) -> GradientStop
fn from(color_hint: FactorPercent) -> GradientStop
Conversion to Length::Factor
color hint.
source§impl From<FactorPercent> for GridSpacing
impl From<FactorPercent> for GridSpacing
source§fn from(percent: FactorPercent) -> GridSpacing
fn from(percent: FactorPercent) -> GridSpacing
Column and row equal relative length.
source§impl From<FactorPercent> for Length
impl From<FactorPercent> for Length
source§fn from(percent: FactorPercent) -> Length
fn from(percent: FactorPercent) -> Length
Conversion to Length::Factor
source§impl From<FactorPercent> for Point
impl From<FactorPercent> for Point
source§fn from(percent: FactorPercent) -> Point
fn from(percent: FactorPercent) -> Point
Splat relative length.
source§impl From<FactorPercent> for Progress
impl From<FactorPercent> for Progress
source§fn from(completed: FactorPercent) -> Progress
fn from(completed: FactorPercent) -> Progress
Converts to this type from the input type.
source§impl From<FactorPercent> for SideOffsets
impl From<FactorPercent> for SideOffsets
source§fn from(percent: FactorPercent) -> SideOffsets
fn from(percent: FactorPercent) -> SideOffsets
All sides equal relative length.
source§impl From<FactorPercent> for Size
impl From<FactorPercent> for Size
source§fn from(percent: FactorPercent) -> Size
fn from(percent: FactorPercent) -> Size
Splat relative length.
source§impl From<FactorPercent> for Vector
impl From<FactorPercent> for Vector
source§fn from(percent: FactorPercent) -> Vector
fn from(percent: FactorPercent) -> Vector
Conversion to Length::Factor
then to vector.
source§impl From<Progress> for FactorPercent
impl From<Progress> for FactorPercent
source§fn from(status: Progress) -> FactorPercent
fn from(status: Progress) -> FactorPercent
Converts to this type from the input type.
source§impl IntoVar<Align> for FactorPercent
impl IntoVar<Align> for FactorPercent
source§impl IntoVar<CornerRadius> for FactorPercent
impl IntoVar<CornerRadius> for FactorPercent
source§fn into_var(self) -> <FactorPercent as IntoVar<CornerRadius>>::Var
fn into_var(self) -> <FactorPercent as IntoVar<CornerRadius>>::Var
All corners same relative length.
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<Factor> for FactorPercent
impl IntoVar<Factor> for FactorPercent
source§impl IntoVar<Factor2d> for FactorPercent
impl IntoVar<Factor2d> for FactorPercent
source§fn into_var(self) -> <FactorPercent as IntoVar<Factor2d>>::Var
fn into_var(self) -> <FactorPercent as IntoVar<Factor2d>>::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<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<FactorPercent> for Progress
impl IntoVar<FactorPercent> for Progress
source§fn into_var(self) -> <Progress as IntoVar<FactorPercent>>::Var
fn into_var(self) -> <Progress 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§fn into_var(self) -> <FactorPercent as IntoVar<FactorSideOffsets>>::Var
fn into_var(self) -> <FactorPercent as IntoVar<FactorSideOffsets>>::Var
All sides equal.
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<FontStretch> for FactorPercent
impl IntoVar<FontStretch> for FactorPercent
source§fn into_var(self) -> <FactorPercent as IntoVar<FontStretch>>::Var
fn into_var(self) -> <FactorPercent as IntoVar<FontStretch>>::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<GradientRadius> for FactorPercent
impl IntoVar<GradientRadius> for FactorPercent
source§fn into_var(self) -> <FactorPercent as IntoVar<GradientRadius>>::Var
fn into_var(self) -> <FactorPercent as IntoVar<GradientRadius>>::Var
Conversion to Length::Factor
and to radius.
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<GradientStop> for FactorPercent
impl IntoVar<GradientStop> for FactorPercent
source§fn into_var(self) -> <FactorPercent as IntoVar<GradientStop>>::Var
fn into_var(self) -> <FactorPercent as IntoVar<GradientStop>>::Var
Conversion to Length::Factor
color hint.
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<GridSpacing> for FactorPercent
impl IntoVar<GridSpacing> for FactorPercent
source§fn into_var(self) -> <FactorPercent as IntoVar<GridSpacing>>::Var
fn into_var(self) -> <FactorPercent as IntoVar<GridSpacing>>::Var
Column and row equal relative length.
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<Length> for FactorPercent
impl IntoVar<Length> for FactorPercent
source§impl IntoVar<Point> for FactorPercent
impl IntoVar<Point> for FactorPercent
source§impl IntoVar<Progress> for FactorPercent
impl IntoVar<Progress> for FactorPercent
source§fn into_var(self) -> <FactorPercent as IntoVar<Progress>>::Var
fn into_var(self) -> <FactorPercent as IntoVar<Progress>>::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<SideOffsets> for FactorPercent
impl IntoVar<SideOffsets> for FactorPercent
source§fn into_var(self) -> <FactorPercent as IntoVar<SideOffsets>>::Var
fn into_var(self) -> <FactorPercent as IntoVar<SideOffsets>>::Var
All sides equal relative length.
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<Size> for FactorPercent
impl IntoVar<Size> for FactorPercent
source§impl IntoVar<Vector> for FactorPercent
impl IntoVar<Vector> for FactorPercent
source§fn into_var(self) -> <FactorPercent as IntoVar<Vector>>::Var
fn into_var(self) -> <FactorPercent as IntoVar<Vector>>::Var
Conversion to Length::Factor
then to vector.
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 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 SelectorValue for FactorPercent
impl SelectorValue for FactorPercent
source§fn to_selector(
value: Box<dyn VarBoxed<FactorPercent>>,
min: FactorPercent,
max: FactorPercent,
) -> Selector
fn to_selector( value: Box<dyn VarBoxed<FactorPercent>>, min: FactorPercent, max: FactorPercent, ) -> Selector
Make the selector.
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<CornerRadius> for FactorPercent
impl IntoValue<Factor> for FactorPercent
impl IntoValue<Factor2d> for FactorPercent
impl IntoValue<FactorPercent> for Factor
impl IntoValue<FactorPercent> for Progress
impl IntoValue<FactorSideOffsets> for FactorPercent
impl IntoValue<FontStretch> for FactorPercent
impl IntoValue<GradientRadius> for FactorPercent
impl IntoValue<GradientStop> for FactorPercent
impl IntoValue<GridSpacing> for FactorPercent
impl IntoValue<Length> for FactorPercent
impl IntoValue<Point> for FactorPercent
impl IntoValue<Progress> 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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
)source§impl<T> DataNoteValue for T
impl<T> DataNoteValue for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§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> 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