pub enum WindowTarget {
Single(FocusChange),
AllBut(FocusChange),
All,
}Expand description
This represents what windows are targeted by a window command.
Variants§
Single(FocusChange)
Close the window targeted by FocusChange.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, WindowAction};
let fc = WindowTarget::Single(FocusChange::Current);
let flags = CloseFlags::NONE;
let act: Action = WindowAction::Close(fc, flags).into();
assert_eq!(act, action!("window close -t (single current) -F none"));AllBut(FocusChange)
Close all windows except for the one targeted by FocusChange.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, WindowAction};
let fc = WindowTarget::AllBut(FocusChange::Current);
let flags = CloseFlags::NONE;
let act: Action = WindowAction::Close(fc, flags).into();
assert_eq!(act, action!("window close -t (all-but current) -F none"));All
Close all windows.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, WindowAction};
let fc = WindowTarget::All;
let flags = CloseFlags::NONE;
let act: Action = WindowAction::Close(fc, flags).into();
assert_eq!(act, action!("window close -t all -F none"));Trait Implementations§
Source§impl Clone for WindowTarget
impl Clone for WindowTarget
Source§fn clone(&self) -> WindowTarget
fn clone(&self) -> WindowTarget
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 Debug for WindowTarget
impl Debug for WindowTarget
Source§impl PartialEq for WindowTarget
impl PartialEq for WindowTarget
impl Eq for WindowTarget
impl StructuralPartialEq for WindowTarget
Auto Trait Implementations§
impl Freeze for WindowTarget
impl RefUnwindSafe for WindowTarget
impl Send for WindowTarget
impl Sync for WindowTarget
impl Unpin for WindowTarget
impl UnwindSafe for WindowTarget
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