Skip to main content

Reset

Struct Reset 

Source
pub struct Reset(/* private fields */);
Expand description

A set of Chrome a primitive opts into giving back.

Implementations§

Source§

impl Reset

Source

pub const NOTHING: Self

Withdraw nothing. The starting point for Reset::and, and what a primitive that is happy with its element gets by saying nothing.

Source

pub const BULLETS: Self

The triple a <ul> or <ol> brings: the bullet, the gutter that made room for it, and the indent. A described list of SSH keys is not a bulleted list, and it rendered as one because nothing said otherwise.

Source

pub const FLAT_BUTTON: Self

A <button>’s raised look and nothing else: fill, stroke, shadow. What stays is the hit area and the type, so the control is still worth aiming at and still reads as a control.

This is the set that matters where an app hands makeover the cascade with revert-layer: with an empty layer the handoff rolls past makeover to a bare button rule, which supplies all three, and a described flat control renders raised.

Source

pub const TEXT_BUTTON: Self

A <button> that has to stop looking like one, because the description said link and only the method said button. Everything a control brings, plus the pointing hand a link has and a button does not.

Reset::FLAT_BUTTON plus the type and metrics, which is the split worth reading off the two: a facet keeps its hit area because it is still a control, and a link gives it back because it is a word in a sentence.

The shadow has to be here rather than left to an app’s own handoff. With nothing in the layer to hand back, revert-layer rolls past to the UA default, and an app that looks correct is compensating for the gap by luck.

Source

pub const fn and(self, chrome: Chrome) -> Self

Add one thing to the set. Const, so a named set above is a constant and not a function call at every emit.

Source

pub const fn carries(self, chrome: Chrome) -> bool

Whether the set carries this one.

Source

pub const fn is_empty(self) -> bool

Whether the set withdraws nothing, in which case a caller emits no rule at all rather than an empty one. Same contract as depth_declarations and depth_rule.

Source

pub fn declarations(self) -> String

The declarations, indented and terminated, ready for a rule body.

Source

pub fn rule(self, selector: &str) -> String

One rule, or nothing when the set withdraws nothing.

The selector is written in full and taken verbatim, which is where this parts company with depth_rule: a reset exists because of the element underneath, so its selector is routinely element-qualified: button.link and not .link.

Trait Implementations§

Source§

impl Clone for Reset

Source§

fn clone(&self) -> Reset

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 Reset

Source§

impl Debug for Reset

Source§

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

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

impl Default for Reset

Source§

fn default() -> Reset

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

impl Eq for Reset

Source§

impl PartialEq for Reset

Source§

fn eq(&self, other: &Reset) -> 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 Reset

Auto Trait Implementations§

§

impl Freeze for Reset

§

impl RefUnwindSafe for Reset

§

impl Send for Reset

§

impl Sync for Reset

§

impl Unpin for Reset

§

impl UnsafeUnpin for Reset

§

impl UnwindSafe for Reset

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, <T as TryFrom<U>>::Error>

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.