[go: up one dir, main page]

Struct Handshake

Source
pub struct Handshake(/* private fields */);

Implementations§

Source§

impl Handshake

Source

pub fn version(&self) -> u32

Source

pub fn is_alive(&self) -> bool

Source§

impl Handshake

Source

pub fn handshake_version(&self, version: u32)

Notifies the EIS implementation that this client supports the given version of the ei_handshake interface. The version number must be less than or equal to the version in the handshake_version event sent by the EIS implementation when the connection was established.

Immediately after sending this request, the client must assume the negotiated version number for the ei_handshake interface and the EIS implementation may send events and process requests matching that version.

This request must be sent exactly once and it must be the first request the client sends.

Source

pub fn finish(&self)

Notify the EIS implementation that configuration is complete.

In the future (and possibly after requiring user interaction), the EIS implementation responds by sending the ei_handshake.connection event.

Source

pub fn context_type(&self, context_type: ContextType)

Notify the EIS implementation of the type of this context. The context types defines whether the client will send events to or receive events from the EIS implementation.

Depending on the context type, certain requests must not be used and some events must not be sent by the EIS implementation.

This request is optional, the default client type is context_type.receiver. This request must not be sent more than once and must be sent before ei_handshake.finish.

Source

pub fn name(&self, name: &str)

Notify the EIS implementation of the client name. The name is a human-presentable UTF-8 string and should represent the client name as accurately as possible. This name may be presented to the user for identification of this client (e.g. to confirm the client has permissions to connect).

There is no requirement for the EIS implementation to use this name. For example, where the client is managed through an XDG Desktop Portal an EIS implementation would typically use client identification information sent by the portal instead.

This request is optional, the default client name is implementation-defined. This request must not be sent more than once and must be sent before ei_handshake.finish.

Source

pub fn interface_version(&self, name: &str, version: u32)

Notify the EIS implementation that the client supports the given named interface with the given maximum version number.

Future objects created by the EIS implementation will use the respective interface version (or any lesser version) as announced by the ei_connection.interface_version event.

This request must be sent for the “ei_connection” interface, failing to do so will result in the EIS implementation disconnecting the client on ei_handshake.finish.

This request must not be sent for the “ei_handshake” interface, use the ei_handshake.handshake_version request instead.

Note that an EIS implementation may consider some interfaces to be required and immediately ei_connection.disconnect a client not supporting those interfaces.

This request must not be sent more than once per interface and must be sent before ei_handshake.finish.

Trait Implementations§

Source§

impl Clone for Handshake

Source§

fn clone(&self) -> Handshake

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 Handshake

Source§

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

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

impl Hash for Handshake

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 PartialEq for Handshake

Source§

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

Source§

impl StructuralPartialEq for Handshake

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