pub struct ElementStyle {
pub padding: Option<PaddingValue>,
pub background: Option<BackgroundValue>,
pub corner_radius: Option<f64>,
pub opacity: Option<f64>,
pub frame: Option<FrameConfig>,
pub border: Option<BorderConfig>,
pub shadow: Option<ShadowConfig>,
pub clip_shape: Option<ClipShape>,
pub flex: Option<f64>,
}Expand description
Shared visual style applied to any element (padding, background, frame, …).
Fields§
§padding: Option<PaddingValue>Inset padding (number or per-edge object).
background: Option<BackgroundValue>Solid, adaptive, or gradient background.
corner_radius: Option<f64>Corner radius in points.
opacity: Option<f64>Opacity from 0 (invisible) to 1 (opaque).
frame: Option<FrameConfig>Explicit width / height / max constraints.
border: Option<BorderConfig>Border color and width.
shadow: Option<ShadowConfig>Drop shadow.
clip_shape: Option<ClipShape>Clip content to a shape (e.g. circle avatar from square image).
flex: Option<f64>Layout weight for flexible sizing inside stacks (like Android layout_weight).
Trait Implementations§
Source§impl Clone for ElementStyle
impl Clone for ElementStyle
Source§fn clone(&self) -> ElementStyle
fn clone(&self) -> ElementStyle
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 moreSource§impl Debug for ElementStyle
impl Debug for ElementStyle
Source§impl Default for ElementStyle
impl Default for ElementStyle
Source§fn default() -> ElementStyle
fn default() -> ElementStyle
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ElementStyle
impl<'de> Deserialize<'de> for ElementStyle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 JsonSchema for ElementStyle
impl JsonSchema for ElementStyle
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for ElementStyle
impl RefUnwindSafe for ElementStyle
impl Send for ElementStyle
impl Sync for ElementStyle
impl Unpin for ElementStyle
impl UnsafeUnpin for ElementStyle
impl UnwindSafe for ElementStyle
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