Struct i_slint_core::BorderRadius
source · #[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 moreimpl<T, U> Copy for BorderRadius<T, U>where
T: Copy,
impl<T, U> Eq for BorderRadius<T, U>where
T: Eq,
Auto Trait Implementations§
impl<T, U> Freeze for BorderRadius<T, U>where
T: Freeze,
impl<T, U> RefUnwindSafe for BorderRadius<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for BorderRadius<T, U>
impl<T, U> Sync for BorderRadius<T, U>
impl<T, U> Unpin for BorderRadius<T, U>
impl<T, U> UnwindSafe for BorderRadius<T, U>where
T: UnwindSafe,
U: UnwindSafe,
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
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)
clone_to_uninit
)