Skip to main content

BorderRadiusGeometry

Enum BorderRadiusGeometry 

Source
#[non_exhaustive]
pub enum BorderRadiusGeometry { BorderRadius(BorderRadius), Directional(BorderRadiusDirectional), }
Expand description

Base class for BorderRadius that allows for text-direction aware resolution.

A property or argument of this type accepts classes created either with BorderRadius::only and its variants, or BorderRadiusDirectional::only and its variants.

To convert a BorderRadiusGeometry object of indeterminate type into a BorderRadius object, call the resolve method.

Non-exhaustive: _MixedBorderRadius (cross-kind add/subtract) is a later arm.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BorderRadius(BorderRadius)

Visual corners — Dart’s BorderRadius.

§

Directional(BorderRadiusDirectional)

Writing-direction corners — Dart’s BorderRadiusDirectional.

Implementations§

Source§

impl BorderRadiusGeometry

Source

pub const ZERO: BorderRadiusGeometry

A BorderRadius with all zero radii.

Source

pub const fn all(radius: Radius) -> BorderRadiusGeometry

Creates a BorderRadius where all radii are radius.

Source

pub fn circular(radius: f64) -> BorderRadiusGeometry

Creates a BorderRadius where all radii are Radius::circular(radius).

Source

pub fn horizontal( left: Option<Radius>, right: Option<Radius>, start: Option<Radius>, end: Option<Radius>, ) -> BorderRadiusGeometry

Creates a horizontally symmetrical border radius.

Utilizing the left and right properties will return a BorderRadius, while start and end will yield a BorderRadiusDirectional. These properties cannot be used interchangeably.

Source

pub const fn only( top_left: Radius, top_right: Radius, bottom_left: Radius, bottom_right: Radius, ) -> BorderRadiusGeometry

Creates a BorderRadius with only the given non-zero values.

The other corners will be right angles.

Source

pub const fn directional( top_start: Radius, top_end: Radius, bottom_start: Radius, bottom_end: Radius, ) -> BorderRadiusGeometry

Creates a BorderRadiusDirectional with only the given non-zero values.

The other corners will be right angles.

Source

pub const fn vertical(top: Radius, bottom: Radius) -> BorderRadiusGeometry

Creates a vertically symmetric BorderRadius where the top and bottom sides of the rectangle have the same radii.

Source

pub fn truncating_div(&self, other: f64) -> BorderRadiusGeometry

Integer divides the BorderRadiusGeometry object’s corners by the given factor.

Source

pub fn resolve(&self, direction: Option<TextDirection>) -> BorderRadius

Convert this instance into a BorderRadius, so that the radii are expressed for specific physical corners (top-left, top-right, etc) rather than in a direction-dependent manner.

See also:

Source

pub fn add(self, other: BorderRadiusGeometry) -> BorderRadiusGeometry

Returns the sum of two BorderRadiusGeometry objects.

Same-kind add returns that kind. Cross-kind add (_MixedBorderRadius) is deferred.

Source

pub fn subtract(self, other: BorderRadiusGeometry) -> BorderRadiusGeometry

Returns the difference between two BorderRadiusGeometry objects.

Same-kind subtract returns that kind. Cross-kind subtract (_MixedBorderRadius) is deferred.

Source

pub fn lerp( a: Option<BorderRadiusGeometry>, b: Option<BorderRadiusGeometry>, t: f64, ) -> Option<BorderRadiusGeometry>

Linearly interpolate between two BorderRadiusGeometry objects.

Same-kind lerp uses add / subtract. Cross-kind lerp (_MixedBorderRadius) is deferred.

Trait Implementations§

Source§

impl Clone for BorderRadiusGeometry

Source§

fn clone(&self) -> BorderRadiusGeometry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BorderRadiusGeometry

Source§

impl Debug for BorderRadiusGeometry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for BorderRadiusGeometry

Dart’s BorderRadiusGeometry.toString, which Debug already renders.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Div<f64> for BorderRadiusGeometry

Source§

type Output = BorderRadiusGeometry

The resulting type after applying the / operator.
Source§

fn div(self, other: f64) -> BorderRadiusGeometry

Performs the / operation. Read more
Source§

impl From<BorderRadius> for BorderRadiusGeometry

Source§

fn from(radius: BorderRadius) -> BorderRadiusGeometry

Converts to this type from the input type.
Source§

impl From<BorderRadiusDirectional> for BorderRadiusGeometry

Source§

fn from(radius: BorderRadiusDirectional) -> BorderRadiusGeometry

Converts to this type from the input type.
Source§

impl Mul<f64> for BorderRadiusGeometry

Source§

type Output = BorderRadiusGeometry

The resulting type after applying the * operator.
Source§

fn mul(self, other: f64) -> BorderRadiusGeometry

Performs the * operation. Read more
Source§

impl Neg for BorderRadiusGeometry

Source§

type Output = BorderRadiusGeometry

The resulting type after applying the - operator.
Source§

fn neg(self) -> BorderRadiusGeometry

Performs the unary - operation. Read more
Source§

impl PartialEq for BorderRadiusGeometry

Source§

fn eq(&self, other: &BorderRadiusGeometry) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Rem<f64> for BorderRadiusGeometry

Source§

type Output = BorderRadiusGeometry

The resulting type after applying the % operator.
Source§

fn rem(self, other: f64) -> BorderRadiusGeometry

Performs the % operation. Read more
Source§

impl StructuralPartialEq for BorderRadiusGeometry

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,