Skip to main content

State

Struct State 

Source
#[non_exhaustive]
pub struct State(pub u32);
Expand description

types of state on the surface

The different state values used on the surface. This is designed for state values like maximized, fullscreen. It is paired with the configure event to ensure that both the client and the compositor setting the state can be synchronized.

States set in this way are double-buffered, see wl_surface.commit.

Tuple 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.
§0: u32

Implementations§

Source§

impl State

Source

pub const Maximized: Self

the surface is maximized

The surface is maximized. The window geometry specified in the configure event must be obeyed by the client, or the xdg_wm_base.invalid_surface_state error is raised.

The client should draw without shadow or other decoration outside of the window geometry.

Source

pub const Fullscreen: Self

the surface is fullscreen

The surface is fullscreen. The window geometry specified in the configure event is a maximum; the client cannot resize beyond it. For a surface to cover the whole fullscreened area, the geometry dimensions must be obeyed by the client. For more details, see xdg_toplevel.set_fullscreen.

Source

pub const Resizing: Self

the surface is being resized

The surface is being resized. The window geometry specified in the configure event is a maximum; the client cannot resize beyond it. Clients that have aspect ratio or cell sizing configuration can use a smaller size, however.

Source

pub const Activated: Self

the surface is now activated

Client window decorations should be painted as if the window is active. Do not assume this means that the window actually has keyboard or pointer focus.

Source

pub const TiledLeft: Self

the surface’s left edge is tiled

The window is currently in a tiled layout and the left edge is considered to be adjacent to another part of the tiling grid.

The client should draw without shadow or other decoration outside of the window geometry on the left edge.

Source

pub const TiledRight: Self

the surface’s right edge is tiled

The window is currently in a tiled layout and the right edge is considered to be adjacent to another part of the tiling grid.

The client should draw without shadow or other decoration outside of the window geometry on the right edge.

Source

pub const TiledTop: Self

the surface’s top edge is tiled

The window is currently in a tiled layout and the top edge is considered to be adjacent to another part of the tiling grid.

The client should draw without shadow or other decoration outside of the window geometry on the top edge.

Source

pub const TiledBottom: Self

the surface’s bottom edge is tiled

The window is currently in a tiled layout and the bottom edge is considered to be adjacent to another part of the tiling grid.

The client should draw without shadow or other decoration outside of the window geometry on the bottom edge.

Source

pub const Suspended: Self

surface repaint is suspended

The surface is currently not ordinarily being repainted; for example because its content is occluded by another window, or its outputs are switched off due to screen locking.

Source

pub const ConstrainedLeft: Self

the surface’s left edge is constrained

The left edge of the window is currently constrained, meaning it shouldn’t attempt to resize from that edge. It can for example mean it’s tiled next to a monitor edge on the constrained side of the window.

Source

pub const ConstrainedRight: Self

the surface’s right edge is constrained

The right edge of the window is currently constrained, meaning it shouldn’t attempt to resize from that edge. It can for example mean it’s tiled next to a monitor edge on the constrained side of the window.

Source

pub const ConstrainedTop: Self

the surface’s top edge is constrained

The top edge of the window is currently constrained, meaning it shouldn’t attempt to resize from that edge. It can for example mean it’s tiled next to a monitor edge on the constrained side of the window.

Source

pub const ConstrainedBottom: Self

the surface’s bottom edge is constrained

The bottom edge of the window is currently constrained, meaning it shouldn’t attempt to resize from that edge. It can for example mean it’s tiled next to a monitor edge on the constrained side of the window.

Trait Implementations§

Source§

impl Clone for State

Source§

fn clone(&self) -> State

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 State

Source§

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

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

impl From<State> for u32

Source§

fn from(val: State) -> u32

Converts to this type from the input type.
Source§

impl Hash for State

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 Ord for State

Source§

fn cmp(&self, other: &State) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for State

Source§

fn eq(&self, other: &State) -> 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 PartialOrd for State

Source§

fn partial_cmp(&self, other: &State) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TryFrom<u32> for State

Source§

type Error = ()

The type returned in the event of a conversion error.
Source§

fn try_from(val: u32) -> Result<State, ()>

Performs the conversion.
Source§

impl Copy for State

Source§

impl Eq for State

Source§

impl StructuralPartialEq for State

Auto Trait Implementations§

§

impl Freeze for State

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnsafeUnpin for State

§

impl UnwindSafe for State

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.