[][src]Struct thyme::AnimState

pub struct AnimState { /* fields omitted */ }

An AnimState consists of one or more (currently up to four) state keys, with each key representing a different state.

For example, a state could be Active + Pressed or Hover. AnimStates are parsed from the theme file as strings in this format, i.e. Active + Pressed, Normal, Hover, are all valid. The + character is used to concatenate multiple states, and whitespace is ignored. The Normal key is special and can only be present by itself. AnimStates are used in Animated images in order to pick a particular image from a set.

Implementations

impl AnimState[src]

pub const fn with_two(state1: AnimStateKey, state2: AnimStateKey) -> AnimState[src]

Creates an AnimState with the two specified state keys.

pub const fn with_three(
    state1: AnimStateKey,
    state2: AnimStateKey,
    state3: AnimStateKey
) -> AnimState
[src]

Creates an AnimState with the three specified state keys.

pub const fn with_four(
    state1: AnimStateKey,
    state2: AnimStateKey,
    state3: AnimStateKey,
    state4: AnimStateKey
) -> AnimState
[src]

Creates an AnimState with the four specified state keys.

pub const fn new(state: AnimStateKey) -> AnimState[src]

Creates an AnimState consisting of the single specified state.

pub const fn normal() -> AnimState[src]

Creates an AnimState corresponding to the Normal state with no changes

pub const fn pressed() -> AnimState[src]

Creates an AnimState consisting of only the Pressed state.

pub fn hover() -> AnimState[src]

Creates an AnimState consisting of the Hover state.

pub const fn disabled() -> AnimState[src]

Creates an AnimState consisting of only the Distabled state.

pub fn contains(&self, key: AnimStateKey) -> bool[src]

Returns whether or not this AnimState contains the specified key.

pub fn add(&mut self, to_add: AnimStateKey)[src]

Adds the given state key to this AnimState. Note that adding Normal will have no effect.

Trait Implementations

impl Clone for AnimState[src]

impl Copy for AnimState[src]

impl<'de> Deserialize<'de> for AnimState[src]

impl Eq for AnimState[src]

impl Hash for AnimState[src]

impl PartialEq<AnimState> for AnimState[src]

impl Serialize for AnimState[src]

impl StructuralEq for AnimState[src]

impl StructuralPartialEq for AnimState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Content for T where
    T: Copy

type Owned = T

A type that holds a sized version of the content.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.