Sizable

Trait Sizable 

Source
pub trait Sizable: Sized {
    // Required method
    fn with_size(self, size: impl Into<Size>) -> Self;

    // Provided methods
    fn xsmall(self) -> Self { ... }
    fn small(self) -> Self { ... }
    fn large(self) -> Self { ... }
}
Expand description

A trait for setting the size of an element. Size::Medium is use by default.

Required Methods§

Source

fn with_size(self, size: impl Into<Size>) -> Self

Set the ui::Size of this element.

Also can receive a ButtonSize to convert to IconSize, Or a Pixels to set a custom size: px(30.)

Provided Methods§

Source

fn xsmall(self) -> Self

Set to Size::XSmall

Source

fn small(self) -> Self

Set to Size::Small

Source

fn large(self) -> Self

Set to Size::Large

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§