Struct swayipc_async::Node

source ·
#[non_exhaustive]
pub struct Node {
Show 30 fields pub id: i64, pub name: Option<String>, pub node_type: NodeType, pub border: NodeBorder, pub current_border_width: i32, pub layout: NodeLayout, pub percent: Option<f64>, pub rect: Rect, pub window_rect: Rect, pub deco_rect: Rect, pub geometry: Rect, pub urgent: bool, pub focused: bool, pub focus: Vec<i64>, pub nodes: Vec<Node>, pub floating_nodes: Vec<Node>, pub sticky: bool, pub representation: Option<String>, pub fullscreen_mode: Option<u8>, pub app_id: Option<String>, pub pid: Option<i32>, pub window: Option<i64>, pub num: Option<i32>, pub window_properties: Option<WindowProperties>, pub marks: Vec<String>, pub inhibit_idle: Option<bool>, pub idle_inhibitors: Option<IdleInhibitors>, pub shell: Option<ShellType>, pub visible: Option<bool>, pub output: Option<String>,
}

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§id: i64

The internal unique ID for this node.

§name: Option<String>

The name of the node such as the output name or window title. For the scratchpad, this will be __i3_scratch for compatibility with i3.

§node_type: NodeType

The node type. It can be root, output, workspace, con, or floating_con.

§border: NodeBorder

The border style for the node. It can be normal, none, pixel, or csd.

§current_border_width: i32

Number of pixels used for the border width.

§layout: NodeLayout

The node’s layout. It can either be splith, splitv, stacked, tabbed, or output.

§percent: Option<f64>

The percentage of the node’s parent that it takes up or null for the root and other special nodes such as the scratchpad.

§rect: Rect

The absolute geometry of the node. The window decorations are excluded from this, but borders are included.

§window_rect: Rect

The geometry of the contents inside the node. The window decorations are excluded from this calculation, but borders are included.

§deco_rect: Rect

The geometry of the decorations for the node relative to the parent node.

§geometry: Rect

The natural geometry of the contents if it were to size itself.

§urgent: bool

Whether the node or any of its descendants has the urgent hint set. Note: This may not exist when compiled without xwayland support.

§focused: bool

Whether the node is currently focused by the default seat (seat0).

§focus: Vec<i64>

Array of child node IDs in the current focus order.

§nodes: Vec<Node>

The tiling children nodes for the node.

§floating_nodes: Vec<Node>

The floating children nodes for the node.

§sticky: bool

Whether the node is sticky (shows on all workspaces).

§representation: Option<String>

(Only workspaces) A string representation of the layout of the workspace that can be used as an aid in submitting reproduction steps for bug reports.

§fullscreen_mode: Option<u8>

(Only containers and views) The fullscreen mode of the node. 0 means none, 1 means full workspace, and 2 means global fullscreen.

§app_id: Option<String>

(Only views) For an xdg-shell view, the name of the application, if set. Otherwise, null.

§pid: Option<i32>

(Only views) The PID of the application that owns the view.

§window: Option<i64>

(Only xwayland views) The X11 window ID for the xwayland view.

§num: Option<i32>§window_properties: Option<WindowProperties>

(Only xwayland views) An object containing the title, class, instance, window_role, window_type, and transient_for for the view.

§marks: Vec<String>

List of marks assigned to the node.

§inhibit_idle: Option<bool>

(Only views) Whether the view is inhibiting the idle state.

§idle_inhibitors: Option<IdleInhibitors>

(Only views) An object containing the state of the application and user idle inhibitors. application can be enabled or none. user can be focus, fullscreen, open, visible or none.

§shell: Option<ShellType>

(Only views) The shell of the view, such as xdg_shell or xwayland.

§visible: Option<bool>

(Only views) Whether the node is visible.

§output: Option<String>

(Only workspaces) Name of the output the node is located on.

Implementations§

source§

impl Node

source

pub fn find_as_ref<F>(&self, predicate: F) -> Option<&Node>
where F: Copy + Fn(&Node) -> bool,

source

pub fn find<F>(self, predicate: F) -> Option<Node>
where F: Copy + Fn(&Node) -> bool,

source

pub fn find_focused_as_ref<F>(&self, predicate: F) -> Option<&Node>
where F: Copy + Fn(&Node) -> bool,

source

pub fn find_focused<F>(self, predicate: F) -> Option<Node>
where F: Copy + Fn(&Node) -> bool,

source

pub fn iter(&self) -> NodeIterator<'_>

Trait Implementations§

source§

impl Clone for Node

source§

fn clone(&self) -> Node

Returns a copy 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 Node

source§

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

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

impl<'de> Deserialize<'de> for Node

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<Node, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for Node

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Node

source§

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

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

impl StructuralPartialEq for Node

Auto Trait Implementations§

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnwindSafe for Node

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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,

§

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>,

§

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>,

§

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

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,