pub struct StyleRules { /* private fields */ }Expand description
An ordered set of StyleRules. Where several match, their styles
combine in order, a later rule winning wherever both set something.
Implementations§
Source§impl StyleRules
impl StyleRules
Sourcepub fn resolve<'a, R>(
&'a self,
headers: &[&str],
rows: impl IntoIterator<Item = R>,
) -> ResolvedRules<'a>
pub fn resolve<'a, R>( &'a self, headers: &[&str], rows: impl IntoIterator<Item = R>, ) -> ResolvedRules<'a>
Resolve the rules against a table’s headers and rows: each rule’s
column, and the styles of column rules (which need every row, so the
rows are only read when a column rule exists).
Source§impl StyleRules
impl StyleRules
Sourcepub fn from_toml(text: &str) -> Result<Self, RuleError>
pub fn from_toml(text: &str) -> Result<Self, RuleError>
Read the [[rules]] tables of a TOML document. See the
module docs for the keys.
Sourcepub fn from_toml_value(value: &Value) -> Result<Self, RuleError>
pub fn from_toml_value(value: &Value) -> Result<Self, RuleError>
Read rule tables from an array of tables, wherever a configuration
keeps them (a profile’s rules key, say).
Trait Implementations§
Source§impl Clone for StyleRules
impl Clone for StyleRules
Source§impl Debug for StyleRules
impl Debug for StyleRules
Auto Trait Implementations§
impl !RefUnwindSafe for StyleRules
impl !UnwindSafe for StyleRules
impl Freeze for StyleRules
impl Send for StyleRules
impl Sync for StyleRules
impl Unpin for StyleRules
impl UnsafeUnpin for StyleRules
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