Skip to main content

BindOptions

Struct BindOptions 

Source
pub struct BindOptions {
    pub scope: KeyScope,
    pub typing: Typing,
    pub through_modal: bool,
}
Expand description

How a binding listens: its scope, whether it fires while typing, and whether a modal lets it through.

Fields§

§scope: KeyScope§typing: Typing§through_modal: bool

A global binding that still fires while a modal is open (a modal otherwise blocks every global binding).

Implementations§

Source§

impl BindOptions

Source

pub fn global() -> BindOptions

Global, typing decided by the keys.

Source

pub fn surface(name: &str) -> BindOptions

Only while that surface has the focus.

Source

pub fn window(id: &str) -> BindOptions

Only in that application window (KeyScope::Window).

Source

pub fn panel(id: &str) -> BindOptions

Only while that panel is its window’s focused panel (KeyScope::Panel).

Source

pub fn system() -> BindOptions

Also while the application is not focused (KeyScope::System): a global shortcut of the desktop.

Source

pub fn typing(self, typing: Typing) -> BindOptions

Source

pub fn through_modal(self) -> BindOptions

Trait Implementations§

Source§

impl Clone for BindOptions

Source§

fn clone(&self) -> BindOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BindOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BindOptions

Source§

fn default() -> BindOptions

Returns the “default value” for a type. Read more
Source§

impl Hash for BindOptions

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for BindOptions

Source§

fn eq(&self, other: &BindOptions) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for BindOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for BindOptions

Source§

impl StructuralPartialEq for BindOptions

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.