Skip to main content

MMState

Struct MMState 

Source
pub struct MMState<'a, 'b: 'a, T: SSS, S: Selection> {
    pub ui: &'a mut UI,
    pub picker_ui: &'a mut PickerUI<'b, T, S>,
    pub footer_ui: &'a mut DisplayUI,
    pub preview_ui: &'a mut Option<PreviewUI>,
    /* private fields */
}

Fields§

§ui: &'a mut UI§picker_ui: &'a mut PickerUI<'b, T, S>§footer_ui: &'a mut DisplayUI§preview_ui: &'a mut Option<PreviewUI>

Implementations§

Source§

impl<'a, 'b: 'a, T: SSS, S: Selection> MMState<'a, 'b, T, S>

Source

pub fn previewer_area(&self) -> Option<&Rect>

Source

pub fn ui_area(&self) -> &Rect

Source

pub fn current_item(&self) -> Option<S>

Source

pub fn current_raw(&self) -> Option<&T>

Same as current_item, but without applying the identifier.

Source

pub fn map_selected_to_vec<U>(&self, f: impl FnMut(&S) -> U) -> Vec<U>

Runs f on selections if nonempty, otherwise, the current item

Source

pub fn injector(&self) -> WorkerInjector<T>

Source

pub fn widths(&self) -> &Vec<u16>

Source

pub fn status(&self) -> &Status

Source

pub fn selections(&self) -> &Selector<T, S>

Source

pub fn get_content_and_index(&self) -> (String, u32)

Source

pub fn make_env_vars(&self) -> EnvVars

Source

pub fn stash_preview_visibility(&mut self, show: Option<bool>)

Methods from Deref<Target = State>§

Source

pub fn contains(&self, event: Event) -> bool

Source

pub fn payload(&self) -> &String

Source

pub fn interrupt(&self) -> Interrupt

Source

pub fn set_interrupt(&mut self, interrupt: Interrupt, payload: String)

Source

pub fn clear_interrupt(&mut self)

Source

pub fn insert(&mut self, event: Event)

Source

pub fn overlay_index(&self) -> Option<usize>

Source

pub fn preview_set_payload(&self) -> Option<String>

Source

pub fn preview_payload(&self) -> &String

Source

pub fn stashed_preview_visibility(&self) -> Option<bool>

Trait Implementations§

Source§

impl<'a, 'b: 'a, T: SSS, S: Selection> Deref for MMState<'a, 'b, T, S>

Source§

type Target = State

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a, 'b: 'a, T: SSS, S: Selection> DerefMut for MMState<'a, 'b, T, S>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, 'b, T, S> Freeze for MMState<'a, 'b, T, S>

§

impl<'a, 'b, T, S> !RefUnwindSafe for MMState<'a, 'b, T, S>

§

impl<'a, 'b, T, S> Send for MMState<'a, 'b, T, S>
where S: Send,

§

impl<'a, 'b, T, S> Sync for MMState<'a, 'b, T, S>
where S: Send,

§

impl<'a, 'b, T, S> Unpin for MMState<'a, 'b, T, S>

§

impl<'a, 'b, T, S> UnsafeUnpin for MMState<'a, 'b, T, S>

§

impl<'a, 'b, T, S> !UnwindSafe for MMState<'a, 'b, T, S>

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> 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> MaybeExt for T

Source§

fn take_from(&mut self, maybe: Option<T>)

Merge from maybe by taking.
Source§

fn clone_from(&mut self, maybe: &Option<T>)
where T: Clone,

Merge from maybe by cloning.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> TransformExt for T

Source§

fn transform<Q>(self, transform: impl FnOnce(T) -> Q) -> Q

Source§

fn transform_if(self, condition: bool, transform: impl FnOnce(T) -> T) -> T

Example Read more
Source§

fn modify<Q>(self, modify: impl FnOnce(&mut T) -> Q) -> T

Source§

fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T

Example Read more
Source§

fn cmp_exch<'a, E>(&'a mut self, expected: E, new: T) -> bool
where &'a mut T: PartialEq<E>,

Example Read more
Source§

fn dbg(self) -> T
where T: Debug,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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.
Source§

impl<T> SSS for T
where T: Send + Sync + 'static,

Source§

impl<T> Selection for T