Skip to main content

EdgeInsetsDirectional

Struct EdgeInsetsDirectional 

Source
pub struct EdgeInsetsDirectional {
    pub start: f64,
    pub top: f64,
    pub end: f64,
    pub bottom: f64,
}
Expand description

An immutable set of offsets in each of the four cardinal directions, but whose horizontal components are dependent on the writing direction.

This can be used to indicate padding from the left in TextDirection::Ltr text and padding from the right in TextDirection::Rtl text without having to be aware of the current text direction.

See also:

  • EdgeInsets, a variant that uses physical labels (left and right instead of start and end).

Fields§

§start: f64

The offset from the start side, the side from which the user will start reading text.

This value is normalized into an EdgeInsets::left or EdgeInsets::right value by the resolve method.

§top: f64

The offset from the top.

This value is passed through to EdgeInsets::top unmodified by the resolve method.

§end: f64

The offset from the end side, the side on which the user ends reading text.

This value is normalized into an EdgeInsets::left or EdgeInsets::right value by the resolve method.

§bottom: f64

The offset from the bottom.

This value is passed through to EdgeInsets::bottom unmodified by the resolve method.

Implementations§

Source§

impl EdgeInsetsDirectional

Source

pub const ZERO: EdgeInsetsDirectional

An EdgeInsetsDirectional with zero offsets in each direction.

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

Source

pub const fn from_steb( start: f64, top: f64, end: f64, bottom: f64, ) -> EdgeInsetsDirectional

Creates insets from offsets from the start, top, end, and bottom.

Source

pub const fn only( start: f64, top: f64, end: f64, bottom: f64, ) -> EdgeInsetsDirectional

Creates insets with only the given values non-zero.

Source

pub const fn symmetric(horizontal: f64, vertical: f64) -> EdgeInsetsDirectional

Creates insets with symmetric vertical and horizontal offsets.

This is equivalent to EdgeInsets::symmetric, since the inset is the same with either TextDirection. This constructor is just a convenience for type compatibility.

Source

pub const fn all(value: f64) -> EdgeInsetsDirectional

Creates insets where all the offsets are value.

Source

pub const fn with_start(self, start: f64) -> EdgeInsetsDirectional

The same insets with the start side start: one of Dart’s copyWith arguments, named, so a chain of them reads as Dart’s named arguments do.

Source

pub const fn with_top(self, top: f64) -> EdgeInsetsDirectional

The same insets with the top side top: one of Dart’s copyWith arguments, named, so a chain of them reads as Dart’s named arguments do.

Source

pub const fn with_end(self, end: f64) -> EdgeInsetsDirectional

The same insets with the end side end: one of Dart’s copyWith arguments, named, so a chain of them reads as Dart’s named arguments do.

Source

pub const fn with_bottom(self, bottom: f64) -> EdgeInsetsDirectional

The same insets with the bottom side bottom: one of Dart’s copyWith arguments, named, so a chain of them reads as Dart’s named arguments do.

Source

pub const fn with_horizontal(self, horizontal: f64) -> EdgeInsetsDirectional

The same insets with the start and end sides each horizontal, as Dart’s EdgeInsetsDirectional.symmetric(horizontal:) sets them.

Source

pub const fn with_vertical(self, vertical: f64) -> EdgeInsetsDirectional

The same insets with the top and bottom sides each vertical, as Dart’s EdgeInsetsDirectional.symmetric(vertical:) sets them.

Source

pub fn is_non_negative(&self) -> bool

Whether every dimension is non-negative.

Source

pub fn flipped(&self) -> EdgeInsetsDirectional

An EdgeInsetsDirectional with top and bottom as well as start and end flipped.

Source

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

Integer divides the EdgeInsetsDirectional object in each dimension by the given factor.

Source

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

Linearly interpolate between two EdgeInsetsDirectional.

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

To interpolate between two EdgeInsetsGeometry objects of arbitrary type (either EdgeInsets or EdgeInsetsDirectional), consider the EdgeInsetsGeometry.lerp static method.

Source

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

Convert this instance into an EdgeInsets, which uses literal coordinates.

Source

pub fn copy_with( &self, start: Option<f64>, top: Option<f64>, end: Option<f64>, bottom: Option<f64>, ) -> EdgeInsetsDirectional

Creates a copy of this EdgeInsetsDirectional but with the given fields replaced with the new values.

Trait Implementations§

Source§

impl Add for EdgeInsetsDirectional

Returns the sum of two EdgeInsetsDirectional objects.

Source§

type Output = EdgeInsetsDirectional

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Clone for EdgeInsetsDirectional

Source§

fn clone(&self) -> EdgeInsetsDirectional

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 EdgeInsetsDirectional

Source§

impl Debug for EdgeInsetsDirectional

Source§

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

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

impl Default for EdgeInsetsDirectional

Source§

fn default() -> EdgeInsetsDirectional

Returns the “default value” for a type. Read more
Source§

impl Div<f64> for EdgeInsetsDirectional

Divides the EdgeInsetsDirectional object in each dimension by the given factor.

Source§

type Output = EdgeInsetsDirectional

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

impl From<EdgeInsetsDirectional> for EdgeInsetsGeometry

Source§

fn from(insets: EdgeInsetsDirectional) -> EdgeInsetsGeometry

Converts to this type from the input type.
Source§

impl Mul<f64> for EdgeInsetsDirectional

Scales the EdgeInsetsDirectional object in each dimension by the given factor.

Source§

type Output = EdgeInsetsDirectional

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Neg for EdgeInsetsDirectional

Returns the EdgeInsetsDirectional object with each dimension negated.

This is the same as multiplying the object by -1.0.

Source§

type Output = EdgeInsetsDirectional

The resulting type after applying the - operator.
Source§

fn neg(self) -> EdgeInsetsDirectional

Performs the unary - operation. Read more
Source§

impl PartialEq for EdgeInsetsDirectional

Source§

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

Computes the remainder in each dimension by the given factor.

Source§

type Output = EdgeInsetsDirectional

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl StructuralPartialEq for EdgeInsetsDirectional

Source§

impl Sub for EdgeInsetsDirectional

Returns the difference between two EdgeInsetsDirectional objects.

Source§

type Output = EdgeInsetsDirectional

The resulting type after applying the - operator.
Source§

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

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,