Skip to main content

DynamicStyleSpec

Struct DynamicStyleSpec 

Source
pub struct DynamicStyleSpec { /* private fields */ }
Expand description

Serializable style overrides attached to a DynamicNodeSpec.

Implementations§

Source§

impl DynamicStyleSpec

Style accessor and Style conversion helpers for DynamicStyleSpec.

Source

pub fn width_px(&self) -> Option<f32>

Returns the optional explicit pixel width.

§Arguments
  • &Self - Style spec reference.
§Returns
  • Option<f32> - Width in logical pixels if set.
Source

pub fn height_px(&self) -> Option<f32>

Returns the optional explicit pixel height.

§Arguments
  • &Self - Style spec reference.
§Returns
  • Option<f32> - Height in logical pixels if set.
Source

pub fn padding_px(&self) -> Option<f32>

Returns the optional uniform padding in logical pixels.

§Arguments
  • &Self - Style spec reference.
§Returns
  • Option<f32> - Padding in logical pixels if set.
Source

pub fn gap_px(&self) -> Option<f32>

Returns the optional child gap in logical pixels.

§Arguments
  • &Self - Style spec reference.
§Returns
  • Option<f32> - Gap in logical pixels if set.
Source

pub fn radius_px(&self) -> Option<f32>

Returns the optional uniform corner radius in logical pixels.

§Arguments
  • &Self - Style spec reference.
§Returns
  • Option<f32> - Corner radius in logical pixels if set.
Source

pub fn font_size_px(&self) -> Option<f32>

Returns the optional font size in logical pixels.

§Arguments
  • &Self - Style spec reference.
§Returns
  • Option<f32> - Font size in logical pixels if set.
Source

pub fn background_hex_value(&self) -> Option<u32>

Returns the optional 24-bit RGB hex background fill color.

§Arguments
  • &Self - Style spec reference.
§Returns
  • Option<u32> - RGB hex color if set.
Source

pub fn color_hex_value(&self) -> Option<u32>

Returns the optional 24-bit RGB hex text foreground color.

§Arguments
  • &Self - Style spec reference.
§Returns
  • Option<u32> - RGB hex color if set.
Source

pub fn border_width_px(&self) -> Option<f32>

Returns the optional border stroke width in logical pixels.

§Arguments
  • &Self - Style spec reference.
§Returns
  • Option<f32> - Border width if set.
Source

pub fn border_hex_value(&self) -> Option<u32>

Returns the optional 24-bit RGB hex border stroke color.

§Arguments
  • &Self - Style spec reference.
§Returns
  • Option<u32> - RGB hex border color if set.
Source

pub fn apply_in_place(&self, style: &mut Style)

Applies all configured style overrides directly in place onto style without copying Style by value.

§Arguments
  • &Self - Style override specification.
  • &mut Style - Target mutable native style to update in place.
Source

pub fn apply_to(&self, base: Style) -> Style

Applies all configured style overrides onto base and returns the resolved native Style.

§Arguments
  • &Self - Style override specification.
  • Style - Base native style for the node kind.
§Returns
  • Style - Compiled native style.
Source§

impl DynamicStyleSpec

Source

pub fn get_mut_width(&mut self) -> &mut Option<f32>

Source

pub fn set_width(&mut self, val: Option<f32>) -> &mut Self

Source

pub fn get_mut_height(&mut self) -> &mut Option<f32>

Source

pub fn set_height(&mut self, val: Option<f32>) -> &mut Self

Source

pub fn get_full_width(&self) -> bool

Source

pub fn get_mut_full_width(&mut self) -> &mut bool

Source

pub fn set_full_width(&mut self, val: bool) -> &mut Self

Source

pub fn get_mut_padding(&mut self) -> &mut Option<f32>

Source

pub fn set_padding(&mut self, val: Option<f32>) -> &mut Self

Source

pub fn get_mut_gap(&mut self) -> &mut Option<f32>

Source

pub fn set_gap(&mut self, val: Option<f32>) -> &mut Self

Source

pub fn get_mut_radius(&mut self) -> &mut Option<f32>

Source

pub fn set_radius(&mut self, val: Option<f32>) -> &mut Self

Source

pub fn get_mut_font_size(&mut self) -> &mut Option<f32>

Source

pub fn set_font_size(&mut self, val: Option<f32>) -> &mut Self

Source

pub fn get_bold(&self) -> bool

Source

pub fn get_mut_bold(&mut self) -> &mut bool

Source

pub fn set_bold(&mut self, val: bool) -> &mut Self

Source

pub fn get_mut_background_hex(&mut self) -> &mut Option<u32>

Source

pub fn set_background_hex(&mut self, val: Option<u32>) -> &mut Self

Source

pub fn get_mut_color_hex(&mut self) -> &mut Option<u32>

Source

pub fn set_color_hex(&mut self, val: Option<u32>) -> &mut Self

Source

pub fn get_mut_border_width(&mut self) -> &mut Option<f32>

Source

pub fn set_border_width(&mut self, val: Option<f32>) -> &mut Self

Source

pub fn get_mut_border_hex(&mut self) -> &mut Option<u32>

Source

pub fn set_border_hex(&mut self, val: Option<u32>) -> &mut Self

Source

pub fn get_columns(&self) -> u16

Source

pub fn get_mut_columns(&mut self) -> &mut u16

Source

pub fn set_columns(&mut self, val: u16) -> &mut Self

Source

pub fn get_flex_grow(&self) -> f32

Source

pub fn get_mut_flex_grow(&mut self) -> &mut f32

Source

pub fn set_flex_grow(&mut self, val: f32) -> &mut Self

Trait Implementations§

Source§

impl Clone for DynamicStyleSpec

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for DynamicStyleSpec

Source§

impl Debug for DynamicStyleSpec

Source§

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

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

impl Default for DynamicStyleSpec

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DynamicStyleSpec

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 PartialEq for DynamicStyleSpec

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for DynamicStyleSpec

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 StructuralPartialEq for DynamicStyleSpec

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> 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, dest: *mut u8)

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

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.