pub struct Style {
pub background: Option<Color>,
pub foreground: Option<Color>,
pub font: Option<Font>,
pub padding: Option<Padding>,
pub border: Option<Border>,
pub width: Option<f32>,
pub height: Option<f32>,
pub horizontal_align: Option<Alignment>,
pub vertical_align: Option<Alignment>,
}Expand description
样式系统相关功能 样式结构体
Fields§
§background: Option<Color>背景颜色
foreground: Option<Color>前景颜色
font: Option<Font>字体
padding: Option<Padding>边距
border: Option<Border>边框
width: Option<f32>宽度
height: Option<f32>高度
horizontal_align: Option<Alignment>水平对齐
vertical_align: Option<Alignment>垂直对齐
Implementations§
Source§impl Style
impl Style
Sourcepub fn with_background(self, color: Color) -> Self
pub fn with_background(self, color: Color) -> Self
Sourcepub fn with_foreground(self, color: Color) -> Self
pub fn with_foreground(self, color: Color) -> Self
Sourcepub fn with_padding(self, padding: Padding) -> Self
pub fn with_padding(self, padding: Padding) -> Self
Sourcepub fn with_border(self, border: Border) -> Self
pub fn with_border(self, border: Border) -> Self
Sourcepub fn with_width(self, width: f32) -> Self
pub fn with_width(self, width: f32) -> Self
Sourcepub fn with_height(self, height: f32) -> Self
pub fn with_height(self, height: f32) -> Self
Sourcepub fn with_horizontal_align(self, align: Alignment) -> Self
pub fn with_horizontal_align(self, align: Alignment) -> Self
Sourcepub fn with_vertical_align(self, align: Alignment) -> Self
pub fn with_vertical_align(self, align: Alignment) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Style
impl<'de> Deserialize<'de> for Style
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 Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
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