pub enum CursorState {
None,
Hover(usize, usize),
Selected(usize, usize),
}Expand description
State of cursor
The 2 numbers represent the x and y in Framework.selectables rather than State.0
Variants§
None
Nothing is selected
Hover(usize, usize)
Cursor is hovering on an item
Selected(usize, usize)
An item is selected
Implementations§
Source§impl CursorState
impl CursorState
Source§impl CursorState
impl CursorState
Sourcepub fn select(&mut self) -> Result<(), FrameworkError>
pub fn select(&mut self) -> Result<(), FrameworkError>
Try select an item, will not work if an item is already selected or the cursor is not hovering on anything
Sourcepub fn deselect(&mut self) -> Result<(), FrameworkError>
pub fn deselect(&mut self) -> Result<(), FrameworkError>
Try deselect an item, will not work if no items are selected
Source§impl CursorState
impl CursorState
Source§impl CursorState
impl CursorState
Sourcepub fn move(
&mut self,
direction: FrameworkDirection,
selectables: &[Vec<(usize, usize)>],
) -> Result<(), FrameworkError>
pub fn move( &mut self, direction: FrameworkDirection, selectables: &[Vec<(usize, usize)>], ) -> Result<(), FrameworkError>
Move in the corresponding direction
Trait Implementations§
Source§impl Clone for CursorState
impl Clone for CursorState
Source§fn clone(&self) -> CursorState
fn clone(&self) -> CursorState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for CursorState
impl Default for CursorState
Source§impl PartialEq for CursorState
impl PartialEq for CursorState
impl Copy for CursorState
impl Eq for CursorState
impl StructuralPartialEq for CursorState
Auto Trait Implementations§
impl Freeze for CursorState
impl RefUnwindSafe for CursorState
impl Send for CursorState
impl Sync for CursorState
impl Unpin for CursorState
impl UnwindSafe for CursorState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more