#[non_exhaustive]pub struct Style {
pub text_anchor: Option<TextAnchor>,
pub color: Option<Color>,
pub background_color: Option<Color>,
pub font_weight: String,
pub text_style: String,
pub text_decoration: String,
pub font_size: Option<FontSize>,
pub font_family: String,
/* private fields */
}Expand description
Annotation for common text style attributes. This adheres to CSS conventions as much as possible.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text_anchor: Option<TextAnchor>Text anchor indexing into the Document.text.
color: Option<Color>Text color.
background_color: Option<Color>Text background color.
font_weight: StringFont weight.
Possible values are normal, bold, bolder, and lighter.
text_style: StringText style.
Possible values are normal, italic, and oblique.
text_decoration: StringText decoration. Follows CSS standard. <text-decoration-line> <text-decoration-color> <text-decoration-style>
font_size: Option<FontSize>Font size.
font_family: StringFont family such as Arial, Times New Roman.
https://www.w3schools.com/cssref/pr_font_font-family.asp
Implementations§
Source§impl Style
impl Style
pub fn new() -> Self
Sourcepub fn set_text_anchor<T>(self, v: T) -> Selfwhere
T: Into<TextAnchor>,
pub fn set_text_anchor<T>(self, v: T) -> Selfwhere
T: Into<TextAnchor>,
Sets the value of text_anchor.
§Example
ⓘ
use google_cloud_documentai_v1::model::document::TextAnchor;
let x = Style::new().set_text_anchor(TextAnchor::default()/* use setters */);Sourcepub fn set_or_clear_text_anchor<T>(self, v: Option<T>) -> Selfwhere
T: Into<TextAnchor>,
pub fn set_or_clear_text_anchor<T>(self, v: Option<T>) -> Selfwhere
T: Into<TextAnchor>,
Sets or clears the value of text_anchor.
§Example
ⓘ
use google_cloud_documentai_v1::model::document::TextAnchor;
let x = Style::new().set_or_clear_text_anchor(Some(TextAnchor::default()/* use setters */));
let x = Style::new().set_or_clear_text_anchor(None::<TextAnchor>);Sourcepub fn set_or_clear_color<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_color<T>(self, v: Option<T>) -> Self
Sourcepub fn set_background_color<T>(self, v: T) -> Self
pub fn set_background_color<T>(self, v: T) -> Self
Sets the value of background_color.
§Example
ⓘ
use gtype::model::Color;
let x = Style::new().set_background_color(Color::default()/* use setters */);Sourcepub fn set_or_clear_background_color<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_background_color<T>(self, v: Option<T>) -> Self
Sets or clears the value of background_color.
§Example
ⓘ
use gtype::model::Color;
let x = Style::new().set_or_clear_background_color(Some(Color::default()/* use setters */));
let x = Style::new().set_or_clear_background_color(None::<Color>);Sourcepub fn set_font_weight<T: Into<String>>(self, v: T) -> Self
pub fn set_font_weight<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_text_style<T: Into<String>>(self, v: T) -> Self
pub fn set_text_style<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_text_decoration<T: Into<String>>(self, v: T) -> Self
pub fn set_text_decoration<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_font_size<T>(self, v: T) -> Self
pub fn set_font_size<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_font_size<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_font_size<T>(self, v: Option<T>) -> Self
Sourcepub fn set_font_family<T: Into<String>>(self, v: T) -> Self
pub fn set_font_family<T: Into<String>>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin 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