Trait stylecs::FallbackComponent[][src]

pub trait FallbackComponent: StyleComponent {
    type Fallback: FallbackComponent<Value = Self::Value>;
    type Value;
    fn value(&self) -> Option<&Self::Value>;

#[must_use]    fn has_fallback() -> bool { ... }

A style component that has a fallback. An example could be TextColor and ForegroundColor components. TextColor could specify ForegroundColor as a fallback. Used with Style::get_with_fallback.

Associated Types

type Fallback: FallbackComponent<Value = Self::Value>[src]

The style component to fall back to. If this is the root, use Self. The provided implementation of Self::has_fallback() will return false when Self::Fallback == Self.

type Value[src]

The contained value of this component.

Loading content...

Required methods

fn value(&self) -> Option<&Self::Value>[src]

The contained value of the component.

Loading content...

Provided methods

#[must_use]fn has_fallback() -> bool[src]

Returns true if there is a fallback.

Loading content...


Loading content...