pub struct Thickness {
pub left: f64,
pub top: f64,
pub right: f64,
pub bottom: f64,
}Expand description
Describes the thickness of a frame around a rectangle.
Fields§
§left: f64The thickness on the left.
top: f64The thickness on the top.
right: f64The thickness on the right.
bottom: f64The thickness on the bottom.
Implementations§
Source§impl Thickness
impl Thickness
Sourcepub const fn new(left: f64, top: f64, right: f64, bottom: f64) -> Self
pub const fn new(left: f64, top: f64, right: f64, bottom: f64) -> Self
Initializes a new instance of the Thickness structure from the four sides.
Sourcepub const fn uniform(uniform_length: f64) -> Self
pub const fn uniform(uniform_length: f64) -> Self
Initializes a Thickness with the same length on every side.
Sourcepub const fn symmetric(horizontal: f64, vertical: f64) -> Self
pub const fn symmetric(horizontal: f64, vertical: f64) -> Self
Initializes a Thickness from the thickness on the left and right, and
the thickness on the top and bottom.
Sourcepub fn is_uniform(&self) -> bool
pub fn is_uniform(&self) -> bool
Gets a value indicating whether all sides are equal (NaN compares equal to NaN here).
Sourcepub fn parse(s: &str) -> Result<Self, FormatError>
pub fn parse(s: &str) -> Result<Self, FormatError>
Parses a Thickness string: one, two or four numbers.
Trait Implementations§
Source§impl AddAssign for Thickness
impl AddAssign for Thickness
Source§fn add_assign(&mut self, b: Thickness)
fn add_assign(&mut self, b: Thickness)
Performs the
+= operation. Read moreSource§impl AddAssign<Thickness> for Size
impl AddAssign<Thickness> for Size
Source§fn add_assign(&mut self, thickness: Thickness)
fn add_assign(&mut self, thickness: Thickness)
Performs the
+= operation. Read moreimpl Copy for Thickness
Source§impl MarkupTyped for Thickness
impl MarkupTyped for Thickness
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
The markup metadata of the type.
Source§impl MulAssign<f64> for Thickness
impl MulAssign<f64> for Thickness
Source§fn mul_assign(&mut self, b: f64)
fn mul_assign(&mut self, b: f64)
Performs the
*= operation. Read moreimpl StructuralPartialEq for Thickness
Source§impl SubAssign for Thickness
impl SubAssign for Thickness
Source§fn sub_assign(&mut self, b: Thickness)
fn sub_assign(&mut self, b: Thickness)
Performs the
-= operation. Read moreSource§impl SubAssign<Thickness> for Size
impl SubAssign<Thickness> for Size
Source§fn sub_assign(&mut self, thickness: Thickness)
fn sub_assign(&mut self, thickness: Thickness)
Performs the
-= operation. Read moreSource§impl Transition<Thickness> for ThicknessTransition
impl Transition<Thickness> for ThicknessTransition
Source§fn do_transition(
this: &Self,
progress: Rc<dyn IObservable<f64>>,
old_value: Thickness,
new_value: Thickness,
) -> Rc<dyn IObservable<Thickness>>
fn do_transition( this: &Self, progress: Rc<dyn IObservable<f64>>, old_value: Thickness, new_value: Thickness, ) -> Rc<dyn IObservable<Thickness>>
Creates the observable of the values of the transition from
old_value to new_value, driven by progress (from 0 to 1).Auto Trait Implementations§
impl Freeze for Thickness
impl RefUnwindSafe for Thickness
impl Send for Thickness
impl Sync for Thickness
impl Unpin for Thickness
impl UnsafeUnpin for Thickness
impl UnwindSafe for Thickness
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more