pub struct TagHandle { /* private fields */ }
Expand description
A handle to a tag.
This handle allows you to do things like switch to tags and get their properties.
Implementations§
Source§impl TagHandle
impl TagHandle
Sourcepub fn switch_to(&self)
pub fn switch_to(&self)
Activates this tag and deactivates all other ones on the same output.
This emulates what a traditional workspace is.
§Examples
// Assume the focused output has the following inactive tags and windows:
// "1": Alacritty
// "2": Firefox, Discord
// "3": Steam
tag::get("2")?.switch_to(); // Displays Firefox and Discord
tag::get("3")?.switch_to(); // Displays Steam
Sourcepub fn set_active(&self, set: bool)
pub fn set_active(&self, set: bool)
Sets this tag to active or not.
While active, windows with this tag will be displayed.
While inactive, windows with this tag will not be displayed unless they have other active tags.
§Examples
// Assume the focused output has the following inactive tags and windows:
// "1": Alacritty
// "2": Firefox, Discord
// "3": Steam
tag::get("2")?.set_active(true); // Displays Firefox and Discord
tag::get("3")?.set_active(true); // Displays Firefox, Discord, and Steam
tag::get("2")?.set_active(false); // Displays Steam
Sourcepub fn toggle_active(&self)
pub fn toggle_active(&self)
Toggles this tag between active and inactive.
While active, windows with this tag will be displayed.
While inactive, windows with this tag will not be displayed unless they have other active tags.
§Examples
// Assume the focused output has the following inactive tags and windows:
// "1": Alacritty
// "2": Firefox, Discord
// "3": Steam
tag::get("2")?.toggle_active(); // Displays Firefox and Discord
tag::get("3")?.toggle_active(); // Displays Firefox, Discord, and Steam
tag::get("3")?.toggle_active(); // Displays Firefox, Discord
tag::get("2")?.toggle_active(); // Displays nothing
Sourcepub fn remove(&self)
pub fn remove(&self)
Removes this tag from its output.
§Examples
let tags =
tag::add(&output::get_by_name("DP-1")?, ["1", "2", "Buckle", "Shoe"]).collect::<Vec<_>>();
tags[1].remove();
tags[3].remove();
// "DP-1" now only has tags "1" and "Buckle"
Sourcepub async fn active_async(&self) -> bool
pub async fn active_async(&self) -> bool
Async impl for Self::active
.
Sourcepub async fn name_async(&self) -> String
pub async fn name_async(&self) -> String
Async impl for Self::name
.
Sourcepub fn output(&self) -> OutputHandle
pub fn output(&self) -> OutputHandle
Gets a handle to the output this tag is on.
Sourcepub async fn output_async(&self) -> OutputHandle
pub async fn output_async(&self) -> OutputHandle
Async impl for Self::output
.
Sourcepub fn windows(&self) -> impl Iterator<Item = WindowHandle>
pub fn windows(&self) -> impl Iterator<Item = WindowHandle>
Gets all windows with this tag.
Sourcepub async fn windows_async(&self) -> impl Iterator<Item = WindowHandle>
pub async fn windows_async(&self) -> impl Iterator<Item = WindowHandle>
Async impl for Self::windows
.
Trait Implementations§
impl Eq for TagHandle
impl StructuralPartialEq for TagHandle
Auto Trait Implementations§
impl Freeze for TagHandle
impl RefUnwindSafe for TagHandle
impl Send for TagHandle
impl Sync for TagHandle
impl Unpin for TagHandle
impl UnwindSafe for TagHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered
].