pub struct BorderSpecs {
pub top: BorderSpec,
pub right: BorderSpec,
pub bottom: BorderSpec,
pub left: BorderSpec,
}Expand description
Per-side border specification: each edge of a rectangle may carry its own
BorderSpec. Use BorderSpecs::uniform when all four edges agree.
Fields§
§top: BorderSpecTop edge.
right: BorderSpecRight edge.
bottom: BorderSpecBottom edge.
left: BorderSpecLeft edge.
Implementations§
Source§impl BorderSpecs
impl BorderSpecs
Sourcepub const fn uniform(spec: BorderSpec) -> Self
pub const fn uniform(spec: BorderSpec) -> Self
Build a per-side spec where every edge is the same BorderSpec.
Sourcepub const fn solid(width: f32, color: Color) -> Self
pub const fn solid(width: f32, color: Color) -> Self
Build a per-side spec with the same width, style, and color.
Sourcepub fn is_invisible(&self) -> bool
pub fn is_invisible(&self) -> bool
true if every edge would draw nothing.
Sourcepub fn is_uniform(&self) -> bool
pub fn is_uniform(&self) -> bool
true if every edge is identical (allowing renderers to take a fast
uniform-border path).
Trait Implementations§
Source§impl Clone for BorderSpecs
impl Clone for BorderSpecs
Source§fn clone(&self) -> BorderSpecs
fn clone(&self) -> BorderSpecs
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BorderSpecs
Source§impl Debug for BorderSpecs
impl Debug for BorderSpecs
Source§impl PartialEq for BorderSpecs
impl PartialEq for BorderSpecs
Source§fn eq(&self, other: &BorderSpecs) -> bool
fn eq(&self, other: &BorderSpecs) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BorderSpecs
Auto Trait Implementations§
impl Freeze for BorderSpecs
impl RefUnwindSafe for BorderSpecs
impl Send for BorderSpecs
impl Sync for BorderSpecs
impl Unpin for BorderSpecs
impl UnsafeUnpin for BorderSpecs
impl UnwindSafe for BorderSpecs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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