#[repr(C)]pub struct BorderRadius<T, U> {
pub top_left: T,
pub top_right: T,
pub bottom_right: T,
pub bottom_left: T,
/* private fields */
}
Expand description
Top-left, top-right, bottom-right, and bottom-left border radius, optionally tagged with a unit.
Fields§
§top_left: T
The top-left radius.
top_right: T
The top-right radius.
bottom_right: T
The bottom-right radius.
bottom_left: T
The bottom-left radius.
Implementations§
Source§impl<T, U> BorderRadius<T, U>
impl<T, U> BorderRadius<T, U>
Sourcepub const fn new(
top_left: T,
top_right: T,
bottom_right: T,
bottom_left: T,
) -> Self
pub const fn new( top_left: T, top_right: T, bottom_right: T, bottom_left: T, ) -> Self
Constructor taking a scalar for each radius.
Radii are specified in top-left, top-right, bottom-right, bottom-left order following CSS’s convention.
Sourcepub fn from_lengths(
top_left: Length<T, U>,
top_right: Length<T, U>,
bottom_right: Length<T, U>,
bottom_left: Length<T, U>,
) -> Self
pub fn from_lengths( top_left: Length<T, U>, top_right: Length<T, U>, bottom_right: Length<T, U>, bottom_left: Length<T, U>, ) -> Self
Constructor taking a typed Length for each radius.
Radii are specified in top-left, top-right, bottom-right, bottom-left order following CSS’s convention.
Sourcepub fn new_uniform(all: T) -> Selfwhere
T: Copy,
pub fn new_uniform(all: T) -> Selfwhere
T: Copy,
Constructor taking the same scalar value for all radii.
Sourcepub fn from_length(all: Length<T, U>) -> Selfwhere
T: Copy,
pub fn from_length(all: Length<T, U>) -> Selfwhere
T: Copy,
Constructor taking the same typed Length for all radii.
Sourcepub fn is_uniform(&self) -> boolwhere
T: ApproxEq<T>,
pub fn is_uniform(&self) -> boolwhere
T: ApproxEq<T>,
Returns true
if all radii are equal.
Sourcepub fn as_uniform(&self) -> Option<T>
pub fn as_uniform(&self) -> Option<T>
Returns the uniform radius if all are equal, or None
otherwise.
Source§impl<T, U> BorderRadius<T, U>where
T: PartialOrd,
impl<T, U> BorderRadius<T, U>where
T: PartialOrd,
Source§impl<T, U> BorderRadius<T, U>
impl<T, U> BorderRadius<T, U>
Sourcepub fn cast<NewT: NumCast>(self) -> BorderRadius<NewT, U>
pub fn cast<NewT: NumCast>(self) -> BorderRadius<NewT, U>
Cast from one numeric representation to another, preserving the units.
Sourcepub fn try_cast<NewT: NumCast>(self) -> Option<BorderRadius<NewT, U>>
pub fn try_cast<NewT: NumCast>(self) -> Option<BorderRadius<NewT, U>>
Fallible cast from one numeric representation to another, preserving the units.
Trait Implementations§
Source§impl<T, U> Add for BorderRadius<T, U>where
T: Add<T, Output = T>,
impl<T, U> Add for BorderRadius<T, U>where
T: Add<T, Output = T>,
Source§impl<T, U> AddAssign for BorderRadius<T, U>where
T: AddAssign<T>,
impl<T, U> AddAssign for BorderRadius<T, U>where
T: AddAssign<T>,
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+=
operation. Read moreSource§impl<T, U> Clone for BorderRadius<T, U>where
T: Clone,
impl<T, U> Clone for BorderRadius<T, U>where
T: Clone,
Source§impl<T, U> Debug for BorderRadius<T, U>where
T: Debug,
impl<T, U> Debug for BorderRadius<T, U>where
T: Debug,
Source§impl<T, U> Default for BorderRadius<T, U>where
T: Default,
impl<T, U> Default for BorderRadius<T, U>where
T: Default,
Source§impl<T, U1, U2> Div<Scale<T, U1, U2>> for BorderRadius<T, U2>
impl<T, U1, U2> Div<Scale<T, U1, U2>> for BorderRadius<T, U2>
Source§impl<T, U> Div<T> for BorderRadius<T, U>
impl<T, U> Div<T> for BorderRadius<T, U>
Source§impl<T, U> DivAssign<Scale<T, U, U>> for BorderRadius<T, U>
impl<T, U> DivAssign<Scale<T, U, U>> for BorderRadius<T, U>
Source§fn div_assign(&mut self, other: Scale<T, U, U>)
fn div_assign(&mut self, other: Scale<T, U, U>)
/=
operation. Read moreSource§impl<T, U> DivAssign<T> for BorderRadius<T, U>
impl<T, U> DivAssign<T> for BorderRadius<T, U>
Source§fn div_assign(&mut self, other: T)
fn div_assign(&mut self, other: T)
/=
operation. Read moreSource§impl<T, U1, U2> Mul<Scale<T, U1, U2>> for BorderRadius<T, U1>
impl<T, U1, U2> Mul<Scale<T, U1, U2>> for BorderRadius<T, U1>
Source§impl<T, U> Mul<T> for BorderRadius<T, U>
impl<T, U> Mul<T> for BorderRadius<T, U>
Source§impl<T, U> MulAssign<Scale<T, U, U>> for BorderRadius<T, U>
impl<T, U> MulAssign<Scale<T, U, U>> for BorderRadius<T, U>
Source§fn mul_assign(&mut self, other: Scale<T, U, U>)
fn mul_assign(&mut self, other: Scale<T, U, U>)
*=
operation. Read moreSource§impl<T, U> MulAssign<T> for BorderRadius<T, U>
impl<T, U> MulAssign<T> for BorderRadius<T, U>
Source§fn mul_assign(&mut self, other: T)
fn mul_assign(&mut self, other: T)
*=
operation. Read moreSource§impl<T, U> Neg for BorderRadius<T, U>where
T: Neg<Output = T>,
impl<T, U> Neg for BorderRadius<T, U>where
T: Neg<Output = T>,
Source§impl<T, U> PartialEq for BorderRadius<T, U>where
T: PartialEq,
impl<T, U> PartialEq for BorderRadius<T, U>where
T: PartialEq,
Source§impl<T, U> Sub for BorderRadius<T, U>where
T: Sub<T, Output = T>,
impl<T, U> Sub for BorderRadius<T, U>where
T: Sub<T, Output = T>,
Source§impl<T, U> SubAssign for BorderRadius<T, U>where
T: SubAssign<T>,
impl<T, U> SubAssign for BorderRadius<T, U>where
T: SubAssign<T>,
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-=
operation. Read more