Trait Fields
pub trait Fields {
type Enum
where Self: Sized;
// Required methods
fn has(&self, id: u8) -> bool;
fn field(&self, id: u8) -> Result<Value, FieldAccessError>;
fn field_with_styles(
&self,
id: u8,
styles: StyleChain<'_>,
) -> Result<Value, FieldAccessError>;
fn field_from_styles(
id: u8,
styles: StyleChain<'_>,
) -> Result<Value, FieldAccessError>
where Self: Sized;
fn materialize(&mut self, styles: StyleChain<'_>);
fn fields(&self) -> Dict;
}
Expand description
Defines how fields of an element are accessed.
Required Associated Types§
Required Methods§
fn field(&self, id: u8) -> Result<Value, FieldAccessError>
fn field(&self, id: u8) -> Result<Value, FieldAccessError>
Get the field with the given field ID.
fn field_with_styles(
&self,
id: u8,
styles: StyleChain<'_>,
) -> Result<Value, FieldAccessError>
fn field_with_styles( &self, id: u8, styles: StyleChain<'_>, ) -> Result<Value, FieldAccessError>
Get the field with the given ID in the presence of styles.
fn field_from_styles(
id: u8,
styles: StyleChain<'_>,
) -> Result<Value, FieldAccessError>where
Self: Sized,
fn field_from_styles(
id: u8,
styles: StyleChain<'_>,
) -> Result<Value, FieldAccessError>where
Self: Sized,
Get the field with the given ID from the styles.
fn materialize(&mut self, styles: StyleChain<'_>)
fn materialize(&mut self, styles: StyleChain<'_>)
Resolve all fields with the styles and save them in-place.