Skip to main content

Request

#[non_exhaustive]
pub enum Request { Destroy, Remove, AddToplevel { id: New<XdgToplevelSessionV1>, toplevel: XdgToplevel, name: String, }, RestoreToplevel { id: New<XdgToplevelSessionV1>, toplevel: XdgToplevel, name: String, }, RemoveToplevel { name: String, }, }

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Destroy

Destroy the session

Destroy a session object, preserving the current state but not continuing to make further updates if state changes occur. This makes the associated xdg_toplevel_session_v1 objects inert.

This is a destructor, once received this object cannot be used any longer.

§

Remove

Remove the session

Remove the session, making it no longer available for restoration. A compositor should in response to this request remove the data related to this session from its storage.

This is a destructor, once received this object cannot be used any longer.

§

AddToplevel

add a new surface to the session

Attempt to add a given surface to the session. The passed name is used to identify what window is being restored, and may be used to store window specific state within the session.

The name given to the toplevel must not correspond to any previously existing toplevel names in the session. If the name matches an already known toplevel name in the session, a ‘name_in_use’ protocol error will be raised.

The toplevel object must not be added more than once to any session created by the client, otherwise the ‘already_added’ protocol error will be raised.

This request will return a xdg_toplevel_session_v1 for later manipulation. As this resource is created from an empty initial state, compositors must not emit a xdg_toplevel_session_v1.restored event for resources created through this request.

The name string must be UTF-8 encoded. It is also limited by the maximum length of wayland messages (around 4KB). The ‘invalid_name’ protocol error will be raised if an invalid string is provided.

Fields

§toplevel: XdgToplevel
§name: String

name identifying the toplevel

§

RestoreToplevel

restore a surface state

Inform the compositor that the toplevel associated with the passed name should have its window management state restored.

If the toplevel name was previously granted to another xdg_toplevel, the ‘name_in_use’ protocol error will be raised.

The toplevel object must not be added more than once to any session created by the client, otherwise the ‘already_added’ protocol error will be raised.

This request must be called prior to the first commit on the associated wl_surface after creating the toplevel, otherwise an ‘already_mapped’ error is raised.

As part of the initial configure sequence, if the toplevel was successfully restored, a xdg_toplevel_session_v1.restored event is emitted. If the toplevel name was not known in the session, this request will be equivalent to the xdg_toplevel_session_v1.add_toplevel request, and no such event will be emitted. See the xdg_toplevel_session_v1.restored event for further details.

The name string must be UTF-8 encoded. It is also limited by the maximum length of wayland messages (around 4KB). The ‘invalid_name’ protocol error will be raised if an invalid string is provided.

Fields

§toplevel: XdgToplevel
§name: String

name identifying the toplevel

§

RemoveToplevel

remove a surface from the session

Remove a specified surface from the session and render any related xdg_toplevel_session_v1 object inert. The compositor should remove any data related to the toplevel in the corresponding session from its internal storage.

The window is specified by its name in the session. The name string must be encoded in UTF-8, and it is limited in size by the maximum length of wayland messages (around 4KB).

Fields

§name: String

name identifying the toplevel

Implementations§

Source§

impl Request

Source

pub fn opcode(&self) -> u16

Get the opcode number of this message

Trait Implementations§

Source§

impl Debug for Request

Source§

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

Formats the value using the given formatter. Read more

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