Skip to main content

AnyBorderSide

Struct AnyBorderSide 

Source
pub struct AnyBorderSide { /* private fields */ }
Expand description

A BorderSide that may be an instance of a BorderSide subclass, as AnyColor is for Color.

The framework stores this wherever Flutter stores a BorderSide that may be a subclass (WidgetStateBorderSide). The plain value is the one the subclass passed to super, reached by value or by deref; the subclass is recovered with extension, Dart’s is check.

Equality follows Dart’s: two plain values compare by value, two extended ones by value and by the subclass’s ==, and a plain value never equals an extended one.

Implementations§

Source§

impl AnyBorderSide

Source

pub fn new(value: BorderSide) -> AnyBorderSide

A plain value.

Source

pub fn with_shared( value: BorderSide, extension: Rc<dyn BorderSideExtension>, ) -> AnyBorderSide

A subclass instance: value is what it passed to super.

Source

pub fn value(&self) -> &BorderSide

The plain value: the subclass’s super value.

Source

pub fn extension<E>(&self) -> Option<&E>

Dart’s value is T: the subclass instance, if this value is one.

Source

pub fn has_extension(&self) -> bool

Whether this value is a subclass instance.

Methods from Deref<Target = BorderSide>§

Source

pub fn copy_with( &self, color: Option<Color>, width: Option<f64>, style: Option<BorderStyle>, stroke_align: Option<f64>, ) -> BorderSide

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

Source

pub fn scale(&self, t: f64) -> BorderSide

Creates a copy of this border side description but with the width scaled by the factor t.

Since a zero width is normally painted as a hairline width rather than no border at all, the zero factor is special-cased to instead change the style to BorderStyle::None.

Negative values are treated like zero.

Source

pub fn to_paint(&self) -> Paint

Create a Paint object that, if used to stroke a line, will draw the line in this border’s style.

The stroke_align property is not reflected in the Paint; consumers must implement that directly by inflating or deflating their region appropriately.

Source

pub fn stroke_inset(&self) -> f64

Get the amount of the stroke width that lies inside of the BorderSide.

Source

pub fn stroke_outset(&self) -> f64

Get the amount of the stroke width that lies outside of the BorderSide.

Source

pub fn stroke_offset(&self) -> f64

The offset of the stroke, taking into account the stroke alignment.

Trait Implementations§

Source§

impl Clone for AnyBorderSide

Source§

fn clone(&self) -> AnyBorderSide

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 Debug for AnyBorderSide

Source§

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

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

impl Deref for AnyBorderSide

Source§

type Target = BorderSide

The resulting type after dereferencing.
Source§

fn deref(&self) -> &BorderSide

Dereferences the value.
Source§

impl Display for AnyBorderSide

Source§

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

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

Source§

impl From<BorderSide> for AnyBorderSide

Source§

fn from(value: BorderSide) -> AnyBorderSide

Converts to this type from the input type.
Source§

impl From<WidgetStateBorderSide> for AnyBorderSide

Source§

fn from(side: WidgetStateBorderSide) -> AnyBorderSide

Converts to this type from the input type.
Source§

impl PartialEq for AnyBorderSide

Source§

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

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

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

Inequality operator !=. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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>