pub struct Padding {
pub top: f32,
pub right: f32,
pub bottom: f32,
pub left: f32,
}Expand description
A set of four numbers representing padding around a box.
Fields§
§top: f32§right: f32§bottom: f32§left: f32Implementations§
Source§impl Padding
impl Padding
pub const fn new(top: f32, right: f32, bottom: f32, left: f32) -> Self
Sourcepub fn from_values(values: &[f32]) -> Result<Self, String>
pub fn from_values(values: &[f32]) -> Result<Self, String>
Padding values are in CSS order: top, right, bottom, left. C++ throws
std::invalid_argument for other lengths.
Sourcepub fn is_nonzero(&self) -> bool
pub fn is_nonzero(&self) -> bool
explicit operator bool.
Trait Implementations§
impl Copy for Padding
Source§impl Interpolate for Padding
impl Interpolate for Padding
fn interpolate(&self, to: &Self, t: f64) -> Self
Source§fn interpolate_f32(&self, to: &Self, t: f32) -> Self
fn interpolate_f32(&self, to: &Self, t: f32) -> Self
Interpolates with a float
t. Defaults to promoting t, which is
what C++ does for specializations without a float overload.impl StructuralPartialEq for Padding
Auto Trait Implementations§
impl Forget for Padding
impl Freeze for Padding
impl Move for Padding
impl RefUnwindSafe for Padding
impl Send for Padding
impl Sync for Padding
impl Unpin for Padding
impl UnsafeUnpin for Padding
impl UnwindSafe for Padding
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