[−][src]Struct thyme::AnimState
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]
state1: AnimStateKey,
state2: AnimStateKey,
state3: AnimStateKey
) -> AnimState
Creates an AnimState with the three specified state keys.
pub const fn with_four(
state1: AnimStateKey,
state2: AnimStateKey,
state3: AnimStateKey,
state4: AnimStateKey
) -> AnimState[src]
state1: AnimStateKey,
state2: AnimStateKey,
state3: AnimStateKey,
state4: AnimStateKey
) -> AnimState
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]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> Result<AnimState, D::Error>[src]
deserializer: D
) -> Result<AnimState, D::Error>
impl Eq for AnimState[src]
impl Hash for AnimState[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl PartialEq<AnimState> for AnimState[src]
impl Serialize for AnimState[src]
impl StructuralEq for AnimState[src]
impl StructuralPartialEq for AnimState[src]
Auto Trait Implementations
impl RefUnwindSafe for AnimState
impl Send for AnimState
impl Sync for AnimState
impl Unpin for AnimState
impl UnwindSafe for AnimState
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Content for T where
T: Copy,
T: Copy,
type Owned = T
A type that holds a sized version of the content.
fn read<F, E>(size: usize, f: F) -> Result<T, E> where
F: FnOnce(&mut T) -> Result<(), E>,
F: FnOnce(&mut T) -> Result<(), E>,
fn get_elements_size() -> usize
fn to_void_ptr(&self) -> *const ()
fn ref_from_ptr(ptr: *mut (), size: usize) -> Option<*mut T>
fn is_size_suitable(size: usize) -> bool
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Serialize for T where
T: Serialize + ?Sized, [src]
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,