pub struct RustConnection<S = DefaultStream> { /* private fields */ }Expand description
A pure-Rust async connection to an X11 server.
Implementations§
Source§impl RustConnection
impl RustConnection
Sourcepub async fn connect(
display_name: Option<&str>,
) -> Result<(Self, usize, impl Future<Output = Result<Infallible, ConnectionError>> + Send), ConnectError>
pub async fn connect( display_name: Option<&str>, ) -> Result<(Self, usize, impl Future<Output = Result<Infallible, ConnectionError>> + Send), ConnectError>
Connect to the X11 server.
This function returns a future that drives the packet reader for the connection. It should be spawned on a task executor to be polled while the connection is in use.
Source§impl<S: Stream + Send + Sync> RustConnection<S>
impl<S: Stream + Send + Sync> RustConnection<S>
Sourcepub async fn connect_to_stream(
stream: S,
screen: usize,
) -> Result<(Self, impl Future<Output = Result<Infallible, ConnectionError>> + Send), ConnectError>
pub async fn connect_to_stream( stream: S, screen: usize, ) -> Result<(Self, impl Future<Output = Result<Infallible, ConnectionError>> + Send), ConnectError>
Connect to the X11 server using the given stream.
This function returns a future that drives the packet reader for the connection. It should be spawned on a task executor to be polled while the connection is in use.
Sourcepub async fn connect_to_stream_with_auth_info(
stream: S,
screen: usize,
auth_name: Vec<u8>,
auth_data: Vec<u8>,
) -> Result<(Self, impl Future<Output = Result<Infallible, ConnectionError>> + Send), ConnectError>
pub async fn connect_to_stream_with_auth_info( stream: S, screen: usize, auth_name: Vec<u8>, auth_data: Vec<u8>, ) -> Result<(Self, impl Future<Output = Result<Infallible, ConnectionError>> + Send), ConnectError>
Connect to the server using the given stream and authentication information.
This function returns a future that drives the packet reader for the connection. It should be spawned on a task executor to be polled while the connection is in use.
Sourcepub fn for_connected_stream(
stream: S,
setup: Setup,
) -> Result<(Self, impl Future<Output = Result<Infallible, ConnectionError>> + Send), ConnectError>
pub fn for_connected_stream( stream: S, setup: Setup, ) -> Result<(Self, impl Future<Output = Result<Infallible, ConnectionError>> + Send), ConnectError>
Establish a connection on an already connected stream.
This function returns a future that drives the packet reader for the connection. It should be spawned on a task executor to be polled while the connection is in use.