Struct embedded_graphics::primitives::rounded_rectangle::CornerRadiiBuilder [−][src]
pub struct CornerRadiiBuilder { /* fields omitted */ }Expand description
CornerRadii builder.
Implementations
Create a new corner radii builder.
All radii are defaulted to 0px x 0px.
Set all corner radii to the same value.
Examples
use embedded_graphics::{ geometry::Size, primitives::{CornerRadii, CornerRadiiBuilder}, }; let corners = CornerRadiiBuilder::new().all(Size::new(10, 20)).build(); assert_eq!( corners, CornerRadii { top_left: Size::new(10, 20), top_right: Size::new(10, 20), bottom_right: Size::new(10, 20), bottom_left: Size::new(10, 20), } );
Set the top left and top right corner radii to the same value.
Examples
use embedded_graphics::{ geometry::Size, primitives::{CornerRadii, CornerRadiiBuilder}, }; let corners = CornerRadiiBuilder::new().top(Size::new(10, 20)).build(); assert_eq!( corners, CornerRadii { top_left: Size::new(10, 20), top_right: Size::new(10, 20), bottom_right: Size::zero(), bottom_left: Size::zero(), } );
Set the top right and bottom right corner radii to the same value.
Examples
use embedded_graphics::{ geometry::Size, primitives::{CornerRadii, CornerRadiiBuilder}, }; let corners = CornerRadiiBuilder::new().right(Size::new(10, 20)).build(); assert_eq!( corners, CornerRadii { top_left: Size::zero(), top_right: Size::new(10, 20), bottom_right: Size::new(10, 20), bottom_left: Size::zero(), } );
Set the bottom left and bottom right corner radii to the same value.
Examples
use embedded_graphics::{ geometry::Size, primitives::{CornerRadii, CornerRadiiBuilder}, }; let corners = CornerRadiiBuilder::new().bottom(Size::new(10, 20)).build(); assert_eq!( corners, CornerRadii { top_left: Size::zero(), top_right: Size::zero(), bottom_right: Size::new(10, 20), bottom_left: Size::new(10, 20), } );
Set the top left and bottom left corner radii to the same value.
Examples
use embedded_graphics::{ geometry::Size, primitives::{CornerRadii, CornerRadiiBuilder}, }; let corners = CornerRadiiBuilder::new().left(Size::new(10, 20)).build(); assert_eq!( corners, CornerRadii { top_left: Size::new(10, 20), top_right: Size::zero(), bottom_right: Size::zero(), bottom_left: Size::new(10, 20), } );
Set the top left corner radius.
Examples
use embedded_graphics::{ geometry::Size, primitives::{CornerRadii, CornerRadiiBuilder}, }; let corners = CornerRadiiBuilder::new() .top_left(Size::new(10, 20)) .build(); assert_eq!( corners, CornerRadii { top_left: Size::new(10, 20), top_right: Size::zero(), bottom_right: Size::zero(), bottom_left: Size::zero(), } );
Set the top right corner radius.
Examples
use embedded_graphics::{ geometry::Size, primitives::{CornerRadii, CornerRadiiBuilder}, }; let corners = CornerRadiiBuilder::new() .top_right(Size::new(10, 20)) .build(); assert_eq!( corners, CornerRadii { top_left: Size::zero(), top_right: Size::new(10, 20), bottom_right: Size::zero(), bottom_left: Size::zero(), } );
Set the bottom right corner radius.
Examples
use embedded_graphics::{ geometry::Size, primitives::{CornerRadii, CornerRadiiBuilder}, }; let corners = CornerRadiiBuilder::new() .bottom_right(Size::new(10, 20)) .build(); assert_eq!( corners, CornerRadii { top_left: Size::zero(), top_right: Size::zero(), bottom_right: Size::new(10, 20), bottom_left: Size::zero(), } );
Set the bottom left corner radius.
Examples
use embedded_graphics::{ geometry::Size, primitives::{CornerRadii, CornerRadiiBuilder}, }; let corners = CornerRadiiBuilder::new() .bottom_left(Size::new(10, 20)) .build(); assert_eq!( corners, CornerRadii { top_left: Size::zero(), top_right: Size::zero(), bottom_right: Size::zero(), bottom_left: Size::new(10, 20), } );
Consume the builder and produce a CornerRadii configuration.
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for CornerRadiiBuilderimpl Send for CornerRadiiBuilderimpl Sync for CornerRadiiBuilderimpl Unpin for CornerRadiiBuilderimpl UnwindSafe for CornerRadiiBuilderBlanket Implementations
Mutably borrows from an owned value. Read more
Casts the value.
Performs the conversion.
Performs the conversion.
Casts the value.
type Output = T
type Output = TShould always be Self
Casts the value.
The inverse inclusion map: attempts to construct self from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> boolChecks if self is actually part of its subset T (and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SSUse with care! Same as self.to_subset but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SPThe inclusion map: converts self to the equivalent element of its superset.
Casts the value.
pub fn vzip(self) -> VCasts the value.