Skip to main content

FacetControls

Trait FacetControls 

Source
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§

Source

fn draws(&mut self, _index: usize, _control: FacetControl) -> bool

Whether the control is drawn at all.

Source

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.

Source

fn state( &mut self, _index: usize, _control: FacetControl, on: bool, out: &mut String, )

Say whether the control is in force, as an attribute.

Source

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".

Implementors§