pub struct ElementStyle {
pub fill_color: Option<String>,
pub stroke_color: Option<String>,
pub stroke_width: Option<f64>,
pub text_color: Option<String>,
pub text_size: Option<f64>,
pub opacity: Option<f64>,
pub class_name: Option<String>,
pub attributes: HashMap<String, String>,
}Expand description
Style information for rendering elements
Fields§
§fill_color: Option<String>§stroke_color: Option<String>§stroke_width: Option<f64>§text_color: Option<String>§text_size: Option<f64>§opacity: Option<f64>§class_name: Option<String>§attributes: HashMap<String, String>Implementations§
Source§impl ElementStyle
impl ElementStyle
pub fn new() -> Self
pub fn with_fill(self, color: String) -> Self
pub fn with_stroke(self, color: String, width: f64) -> Self
pub fn with_text(self, color: String, size: f64) -> Self
pub fn with_opacity(self, opacity: f64) -> Self
pub fn with_class(self, class_name: String) -> Self
pub fn with_attribute(self, key: String, value: String) -> Self
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 · 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§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
Auto Trait Implementations§
impl Freeze for ElementStyle
impl RefUnwindSafe for ElementStyle
impl Send for ElementStyle
impl Sync for ElementStyle
impl Unpin 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