1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// This source code form is subject to the terms of the mozilla public
// license, v. 2.0. if a copy of the mpl was not distributed with this
// file, you can obtain one at https://mozilla.org/mpl/2.0/.
use crateEvent;
/// Represents either the [Default](DisplayServer::Default) display server, or the display server
/// [Of](DisplayServer::Of) the given name.
/// Initiates a [Connection] to the X server.
///
/// The given `display_server` can be either the [Default](DisplayServer::Default) display server,
/// as provided by the `DISPLAY` environment variable on POSIX-compliant systems, or a display
/// server [Of](DisplayServer::Of) the given `&str` name. It specifies which display server (a.k.a.
/// X server) the connection will be made to.
///
/// # Examples
/// ```rust
/// // Connect to the X server on the default display server.
/// let conn = xrs::connect(xrs::DisplayServer::Default);
/// ```
/// ```rust
/// // Connect to the display server named `:0`: specifically refers to a local display server.
/// let local_conn = xrs::connect(xrs::DisplayServer::Of(":0"));
/// ```