Skip to main content

BorderRadiusDirectional

Struct BorderRadiusDirectional 

Source
pub struct BorderRadiusDirectional {
    pub top_start: Radius,
    pub top_end: Radius,
    pub bottom_start: Radius,
    pub bottom_end: Radius,
}
Expand description

An immutable set of radii for each corner of a rectangle, but with the corners specified in a manner dependent on the writing direction.

This can be used to specify a corner radius on the leading or trailing edge of a box, so that it flips to the other side when the text alignment flips (e.g. being on the top right in English text but the top left in Arabic text).

See also:

  • BorderRadius, a variant that uses physical labels (topLeft and topRight instead of topStart and topEnd).

Fields§

§top_start: Radius

The top-start Radius.

§top_end: Radius

The top-end Radius.

§bottom_start: Radius

The bottom-start Radius.

§bottom_end: Radius

The bottom-end Radius.

Implementations§

Source§

impl BorderRadiusDirectional

Source

pub const ZERO: BorderRadiusDirectional

A border radius with all zero radii.

Consider using BorderRadius::ZERO instead, since that object has the same effect, but will be cheaper to resolve.

Source

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

Creates a border radius where all radii are radius.

Source

pub fn circular(radius: f64) -> BorderRadiusDirectional

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

Source

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

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

Source

pub const fn horizontal(start: Radius, end: Radius) -> BorderRadiusDirectional

Creates a horizontally symmetrical border radius where the start and end sides of the rectangle have the same radii.

Source

pub const fn only( top_start: Radius, top_end: Radius, bottom_start: Radius, bottom_end: Radius, ) -> BorderRadiusDirectional

Creates a border radius with only the given non-zero values. The other corners will be right angles.

Source

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

Integer divides each corner of the BorderRadiusDirectional by the given factor.

Source

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

Linearly interpolate between two BorderRadiusDirectional objects.

If either is null, this function interpolates from BorderRadiusDirectional::ZERO.

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.

Trait Implementations§

Source§

impl Add for BorderRadiusDirectional

Source§

type Output = BorderRadiusDirectional

The resulting type after applying the + operator.
Source§

fn add(self, other: BorderRadiusDirectional) -> BorderRadiusDirectional

Performs the + operation. Read more
Source§

impl Clone for BorderRadiusDirectional

Source§

fn clone(&self) -> BorderRadiusDirectional

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 BorderRadiusDirectional

Source§

impl Debug for BorderRadiusDirectional

Source§

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

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

impl Div<f64> for BorderRadiusDirectional

Source§

type Output = BorderRadiusDirectional

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
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 BorderRadiusDirectional

Source§

type Output = BorderRadiusDirectional

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Neg for BorderRadiusDirectional

Source§

type Output = BorderRadiusDirectional

The resulting type after applying the - operator.
Source§

fn neg(self) -> BorderRadiusDirectional

Performs the unary - operation. Read more
Source§

impl PartialEq for BorderRadiusDirectional

Source§

fn eq(&self, other: &BorderRadiusDirectional) -> 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 BorderRadiusDirectional

Source§

type Output = BorderRadiusDirectional

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl StructuralPartialEq for BorderRadiusDirectional

Source§

impl Sub for BorderRadiusDirectional

Source§

type Output = BorderRadiusDirectional

The resulting type after applying the - operator.
Source§

fn sub(self, other: BorderRadiusDirectional) -> BorderRadiusDirectional

Performs the - operation. Read more

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, 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,