pub trait FacetControls {
// Provided methods
fn draws(&mut self, _index: usize, _control: FacetControl) -> bool { ... }
fn open(
&mut self,
_index: usize,
_control: FacetControl,
out: &mut String,
) -> &'static str { ... }
fn state(
&mut self,
_index: usize,
_control: FacetControl,
on: bool,
out: &mut String,
) { ... }
fn attrs(
&mut self,
_index: usize,
_control: FacetControl,
_out: &mut String,
) { ... }
}Expand description
What an app decides about each control facet_html_with draws.
index is the value’s position in Facet::values. Every method defaults
to what facet_html writes: a button, aria-pressed, nothing more.
Provided Methods§
Sourcefn draws(&mut self, _index: usize, _control: FacetControl) -> bool
fn draws(&mut self, _index: usize, _control: FacetControl) -> bool
Whether the control is drawn at all.
Sourcefn open(
&mut self,
_index: usize,
_control: FacetControl,
out: &mut String,
) -> &'static str
fn open( &mut self, _index: usize, _control: FacetControl, out: &mut String, ) -> &'static str
Open the control’s tag up to its class, and return the tag that closes it.
Sourcefn state(
&mut self,
_index: usize,
_control: FacetControl,
on: bool,
out: &mut String,
)
fn state( &mut self, _index: usize, _control: FacetControl, on: bool, out: &mut String, )
Say whether the control is in force, as an attribute.
Sourcefn attrs(&mut self, _index: usize, _control: FacetControl, _out: &mut String)
fn attrs(&mut self, _index: usize, _control: FacetControl, _out: &mut String)
Attributes written after the emitter’s own, before the tag closes.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".