pub struct Handshake(/* private fields */);Implementations§
Source§impl Handshake
impl Handshake
Sourcepub fn handshake_version(&self, version: u32)
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.
Sourcepub fn finish(&self)
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.
Sourcepub fn context_type(&self, context_type: ContextType)
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.
Sourcepub fn name(&self, name: &str)
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.
Sourcepub fn interface_version(&self, name: &str, version: u32)
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.