pub struct BorderRadius {
pub horizontal: [LengthPercentage; 4],
pub vertical: Option<[LengthPercentage; 4]>,
}Expand description
Value for the border-radius shorthand. Stores per-corner
radii, optionally with an elliptical second axis.
Fields§
§horizontal: [LengthPercentage; 4]Horizontal radii: top-left, top-right, bottom-right, bottom-left.
vertical: Option<[LengthPercentage; 4]>Optional vertical radii for an elliptical corner.
Implementations§
Source§impl BorderRadius
impl BorderRadius
Sourcepub fn all(v: impl Into<LengthPercentage>) -> Self
pub fn all(v: impl Into<LengthPercentage>) -> Self
All four corners share the same radius.
Sourcepub fn corners(
tl: impl Into<LengthPercentage>,
tr: impl Into<LengthPercentage>,
br: impl Into<LengthPercentage>,
bl: impl Into<LengthPercentage>,
) -> Self
pub fn corners( tl: impl Into<LengthPercentage>, tr: impl Into<LengthPercentage>, br: impl Into<LengthPercentage>, bl: impl Into<LengthPercentage>, ) -> Self
Specify each corner explicitly (top-left, top-right, bottom-right, bottom-left).
Sourcepub fn elliptical(
horizontal: [LengthPercentage; 4],
vertical: [LengthPercentage; 4],
) -> Self
pub fn elliptical( horizontal: [LengthPercentage; 4], vertical: [LengthPercentage; 4], ) -> Self
Elliptical radius: horizontal and vertical components.
Trait Implementations§
Source§impl Clone for BorderRadius
impl Clone for BorderRadius
Source§fn clone(&self) -> BorderRadius
fn clone(&self) -> BorderRadius
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BorderRadius
impl Debug for BorderRadius
Source§impl PartialEq for BorderRadius
impl PartialEq for BorderRadius
Source§fn eq(&self, other: &BorderRadius) -> bool
fn eq(&self, other: &BorderRadius) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BorderRadius
Auto Trait Implementations§
impl Freeze for BorderRadius
impl RefUnwindSafe for BorderRadius
impl Send for BorderRadius
impl Sync for BorderRadius
impl Unpin for BorderRadius
impl UnsafeUnpin for BorderRadius
impl UnwindSafe for BorderRadius
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