#[non_exhaustive]pub struct AppearanceRule {
pub id: String,
pub target: AppearanceTarget,
pub names: Vec<String>,
pub context: AppearanceContext,
pub criteria: Option<String>,
pub priority: i32,
pub font: Option<Tint>,
pub back: Option<Tint>,
pub bold: Option<bool>,
pub enabled: Option<bool>,
pub visible: Option<bool>,
/* private fields */
}Expand description
Changes how things look or behave, for records that meet a condition. It is about looks: it does not protect data, which is what permissions are for.
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.id: StringWhat it is known by.
target: AppearanceTargetThe kind of thing it changes.
names: Vec<String>The names of those things, where * stands for any text. A list that starts with a
lone * means all but the names after it.
context: AppearanceContextWhere it applies.
criteria: Option<String>The expression a record has to meet. With none, and no function, it always applies.
priority: i32Whichever is higher wins, for what both change.
font: Option<Tint>The color of the text.
back: Option<Tint>The color behind it.
bold: Option<bool>Heavier text.
enabled: Option<bool>Whether it can be used.
visible: Option<bool>Whether it shows.
Implementations§
Source§impl AppearanceRule
impl AppearanceRule
Sourcepub fn new(
id: impl Into<String>,
names: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn new( id: impl Into<String>, names: impl IntoIterator<Item = impl Into<String>>, ) -> Self
A rule about fields with these names, as * or open*.
Sourcepub fn target(self, target: AppearanceTarget) -> Self
pub fn target(self, target: AppearanceTarget) -> Self
About this kind of thing.
Sourcepub fn context(self, context: AppearanceContext) -> Self
pub fn context(self, context: AppearanceContext) -> Self
Only in these views.
Sourcepub fn criteria(self, expression: impl Into<String>) -> Self
pub fn criteria(self, expression: impl Into<String>) -> Self
For records that meet this expression.
Trait Implementations§
Source§impl Clone for AppearanceRule
impl Clone for AppearanceRule
Source§fn clone(&self) -> AppearanceRule
fn clone(&self) -> AppearanceRule
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 AppearanceRule
impl Debug for AppearanceRule
Auto Trait Implementations§
impl !RefUnwindSafe for AppearanceRule
impl !Send for AppearanceRule
impl !Sync for AppearanceRule
impl !UnwindSafe for AppearanceRule
impl Freeze for AppearanceRule
impl Unpin for AppearanceRule
impl UnsafeUnpin for AppearanceRule
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