Skip to main content

Emit

Struct Emit 

Source
#[non_exhaustive]
pub struct Emit { pub border_width: &'static str, pub focus_width: &'static str, pub target_min: &'static str, pub class_prefix: &'static str, pub required_marker: &'static str, pub exclude_label: &'static str, pub write_label: &'static str, pub preview_label: &'static str, pub lower_label: &'static str, pub upper_label: &'static str, }
Expand description

How the emitted CSS and markup are shaped, and the copy they carry.

Built with Emit::new and its setters. #[non_exhaustive], so a new knob is not a breaking change for anyone who configures one.

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.
§border_width: &'static str

Bevel thickness, as a CSS length.

A value, so it arrives from the caller: this crate names no sizes of its own.

§focus_width: &'static str

Focus ring thickness, as a CSS length.

Separate from border_width, and never derived from it: a bevel and a focus indicator answer different questions, and only one of them has to be noticed from across a desk.

The default, 2px, is what every consumer had chosen for its own ring.

§target_min: &'static str

The smallest a pointer target may be drawn, as a CSS length.

A value for border_width’s reason: a floor is a size, and this crate names no sizes of its own.

The default is WCAG 2.2’s target minimum. It is an absolute rather than a step off the geometry base, and that is deliberate on two counts: a floor that scales with the reader’s root size is not a floor, and the touch density opens the gaps between targets rather than licensing a smaller one for a pointer.

§class_prefix: &'static str

Prefix for emitted class names, without the leading dot.

§required_marker: &'static str

What marks a compulsory field, appended to its label.

makeover-tui’s PieceStyle::required_marker and makeover-immediate’s FieldStyle::required_marker, said here for the third renderer, with their default. A knob for their reason: it is the one piece of copy this crate emits, and copy is not a renderer’s call.

§Why it is hidden from the accessibility tree here and nowhere else

The control already carries required, which a screen reader announces. A marker read out beside it is the same fact twice, so the span is aria-hidden. The other two renderers have no such attribute to lean on, which is why the marker is part of the label string there and an element here.

§exclude_label: &'static str

The accessible name’s lead on a facet value’s exclude button, before the value’s own label: “Exclude Drums”. Copy, for required_marker’s reason.

§write_label: &'static str

The markdown editor’s two modes, as the segments say them.

§preview_label: &'static str§lower_label: &'static str

The accessible names of an interval’s two boxes.

§upper_label: &'static str

Implementations§

Source§

impl Emit

Source

pub const fn new() -> Self

The defaults: the measured widths above, no prefix, and English copy.

Source§

impl Emit

Source

pub const fn border_width(self, value: &'static str) -> Self

Source

pub const fn focus_width(self, value: &'static str) -> Self

Source

pub const fn target_min(self, value: &'static str) -> Self

Source

pub const fn class_prefix(self, value: &'static str) -> Self

Source

pub const fn required_marker(self, value: &'static str) -> Self

Source

pub const fn exclude_label(self, value: &'static str) -> Self

Source

pub const fn write_label(self, value: &'static str) -> Self

Source

pub const fn preview_label(self, value: &'static str) -> Self

Source

pub const fn lower_label(self, value: &'static str) -> Self

Source

pub const fn upper_label(self, value: &'static str) -> Self

Trait Implementations§

Source§

impl Clone for Emit

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Emit

Source§

impl Debug for Emit

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Emit

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Emit

Source§

impl PartialEq for Emit

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Emit

Auto Trait Implementations§

§

impl Freeze for Emit

§

impl RefUnwindSafe for Emit

§

impl Send for Emit

§

impl Sync for Emit

§

impl Unpin for Emit

§

impl UnsafeUnpin for Emit

§

impl UnwindSafe for Emit

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.