Struct zng_app::widget::border::BorderSides

source ·
pub struct BorderSides {
    pub left: BorderSide,
    pub right: BorderSide,
    pub top: BorderSide,
    pub bottom: BorderSide,
}
Expand description

The line style and color for each side of a widget’s border.

Fields§

§left: BorderSide

Color and style of the left border.

§right: BorderSide

Color and style of the right border.

§top: BorderSide

Color and style of the top border.

§bottom: BorderSide

Color and style of the bottom border.

Implementations§

source§

impl BorderSides

source

pub fn new_all<S: Into<BorderSide>>(side: S) -> Self

All sides equal.

source

pub fn new_vh<TB: Into<BorderSide>, LR: Into<BorderSide>>( top_bottom: TB, left_right: LR, ) -> Self

Top-bottom and left-right equal.

source

pub fn new<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>>( top: T, right: R, bottom: B, left: L, ) -> Self

New top, right, bottom left.

source

pub fn new_top<T: Into<BorderSide>>(top: T) -> Self

New top only, other sides hidden.

source

pub fn new_right<R: Into<BorderSide>>(right: R) -> Self

New right only, other sides hidden.

source

pub fn new_bottom<B: Into<BorderSide>>(bottom: B) -> Self

New bottom only, other sides hidden.

source

pub fn new_left<L: Into<BorderSide>>(left: L) -> Self

New left only, other sides hidden.

source

pub fn solid<C: Into<Rgba>>(color: C) -> Self

All sides a solid color.

source

pub fn double<C: Into<Rgba>>(color: C) -> Self

All sides a double line solid color.

source

pub fn dotted<C: Into<Rgba>>(color: C) -> Self

All sides a dotted color.

source

pub fn dashed<C: Into<Rgba>>(color: C) -> Self

All sides a dashed color.

source

pub fn groove<C: Into<Rgba>>(color: C) -> Self

All sides a grooved color.

source

pub fn ridge<C: Into<Rgba>>(color: C) -> Self

All sides a ridged color.

source

pub fn inset<C: Into<Rgba>>(color: C) -> Self

All sides a inset color.

source

pub fn outset<C: Into<Rgba>>(color: C) -> Self

All sides a outset color.

source

pub fn hidden() -> Self

All sides hidden.

source

pub fn all_eq(&self) -> bool

If all sides are equal.

source

pub fn dimensions_eq(&self) -> bool

If top and bottom are equal; and left and right are equal.

Trait Implementations§

source§

impl Clone for BorderSides

source§

fn clone(&self) -> BorderSides

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for BorderSides

source§

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

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

impl Default for BorderSides

source§

fn default() -> Self

Returns hidden.

source§

impl<'de> Deserialize<'de> for BorderSides

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<C: Into<Rgba>, S: Into<BorderStyle>> From<(C, S)> for BorderSides

source§

fn from((color, style): (C, S)) -> Self

(color, style) sides.

source§

impl<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>> From<(T, R, B, L)> for BorderSides

source§

fn from((top, right, bottom, left): (T, R, B, L)) -> Self

(top, right, bottom, left) sides.

source§

impl<T: Into<Rgba>, R: Into<Rgba>, B: Into<Rgba>, L: Into<Rgba>, S: Into<BorderStyle>> From<(T, R, B, L, S)> for BorderSides

source§

fn from((top, right, bottom, left, style): (T, R, B, L, S)) -> Self

(top-color, right-color, bottom-color, left-color, style) sides.

source§

impl<TB: Into<Rgba>, LR: Into<Rgba>, S: Into<BorderStyle>> From<(TB, LR, S)> for BorderSides

source§

fn from((top_bottom, left_right, style): (TB, LR, S)) -> Self

(top-bottom-color, left-right-color, style) sides.

source§

impl From<BorderStyle> for BorderSides

source§

fn from(style: BorderStyle) -> Self

All sides transparent black with the style.

This is only useful with BorderStyle::Hidden variant.

source§

impl From<Hsla> for BorderSides

source§

fn from(color: Hsla) -> Self

All sides solid color.

source§

impl From<Hsva> for BorderSides

source§

fn from(color: Hsva) -> Self

All sides solid color.

source§

impl From<Rgba> for BorderSides

source§

fn from(color: Rgba) -> Self

All sides solid color.

source§

impl<C: Into<Rgba>, S: Into<BorderStyle>> IntoVar<BorderSides> for (C, S)

source§

fn into_var(self) -> Self::Var

(color, style) sides.

source§

type Var = LocalVar<BorderSides>

Variable type that will wrap the T value. Read more
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
source§

impl<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>> IntoVar<BorderSides> for (T, R, B, L)

source§

fn into_var(self) -> Self::Var

(top, right, bottom, left) sides.

source§

type Var = LocalVar<BorderSides>

Variable type that will wrap the T value. Read more
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
source§

impl<T: Into<Rgba>, R: Into<Rgba>, B: Into<Rgba>, L: Into<Rgba>, S: Into<BorderStyle>> IntoVar<BorderSides> for (T, R, B, L, S)

source§

fn into_var(self) -> Self::Var

(top-color, right-color, bottom-color, left-color, style) sides.

source§

type Var = LocalVar<BorderSides>

Variable type that will wrap the T value. Read more
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
source§

impl<TB: Into<Rgba>, LR: Into<Rgba>, S: Into<BorderStyle>> IntoVar<BorderSides> for (TB, LR, S)

source§

fn into_var(self) -> Self::Var

(top-bottom-color, left-right-color, style) sides.

source§

type Var = LocalVar<BorderSides>

Variable type that will wrap the T value. Read more
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
source§

impl IntoVar<BorderSides> for BorderStyle

source§

fn into_var(self) -> Self::Var

All sides transparent black with the style.

This is only useful with BorderStyle::Hidden variant.

source§

type Var = LocalVar<BorderSides>

Variable type that will wrap the T value. Read more
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
source§

impl IntoVar<BorderSides> for Hsla

source§

fn into_var(self) -> Self::Var

All sides solid color.

source§

type Var = LocalVar<BorderSides>

Variable type that will wrap the T value. Read more
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
source§

impl IntoVar<BorderSides> for Hsva

source§

fn into_var(self) -> Self::Var

All sides solid color.

source§

type Var = LocalVar<BorderSides>

Variable type that will wrap the T value. Read more
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
source§

impl IntoVar<BorderSides> for Rgba

source§

fn into_var(self) -> Self::Var

All sides solid color.

source§

type Var = LocalVar<BorderSides>

Variable type that will wrap the T value. Read more
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
source§

impl PartialEq for BorderSides

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for BorderSides

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Transitionable for BorderSides

source§

fn lerp(self, to: &Self, step: EasingStep) -> Self

Sample the linear interpolation from self -> to by step.
source§

impl Copy for BorderSides

source§

impl<C: Into<Rgba>, S: Into<BorderStyle>> IntoValue<BorderSides> for (C, S)

source§

impl<T: Into<BorderSide>, R: Into<BorderSide>, B: Into<BorderSide>, L: Into<BorderSide>> IntoValue<BorderSides> for (T, R, B, L)

source§

impl<T: Into<Rgba>, R: Into<Rgba>, B: Into<Rgba>, L: Into<Rgba>, S: Into<BorderStyle>> IntoValue<BorderSides> for (T, R, B, L, S)

source§

impl<TB: Into<Rgba>, LR: Into<Rgba>, S: Into<BorderStyle>> IntoValue<BorderSides> for (TB, LR, S)

source§

impl IntoValue<BorderSides> for BorderStyle

source§

impl IntoValue<BorderSides> for Hsla

source§

impl IntoValue<BorderSides> for Hsva

source§

impl IntoValue<BorderSides> for Rgba

source§

impl StructuralPartialEq for BorderSides

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> AnyVarValue for T
where T: VarValue,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Access to dyn Any methods.
source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Access to mut dyn Any methods.
source§

fn clone_boxed(&self) -> Box<dyn AnyVarValue>

Clone the value.
source§

fn clone_boxed_var(&self) -> Box<dyn AnyVar>

Clone the value into a new boxed LocalVar<Self>.
source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Access to Box<dyn Any> methods.
source§

fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool

Gets if self equals other.
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<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> IntoVar<T> for T
where T: VarValue,

source§

type Var = LocalVar<T>

Variable type that will wrap the T value. Read more
source§

fn into_var(self) -> <T as IntoVar<T>>::Var

Converts the source value into a var.
source§

fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>
where Self: Sized,

Converts into BoxedVar<T>. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> IntoValue<T> for T
where T: VarValue,

source§

impl<T> IpcValue for T
where T: Debug + Serialize + for<'d> Deserialize<'d> + Send + 'static,

source§

impl<T> StateValue for T
where T: Any + Send + Sync,

source§

impl<T> VarValue for T
where T: Debug + Clone + PartialEq + Any + Send + Sync,