Struct x11rb::rust_connection::RustConnection[][src]

pub struct RustConnection<S: Stream = DefaultStream> { /* fields omitted */ }

A connection to an X11 server implemented in pure rust

This type is generic over S, which allows to use a generic stream to communicate with the server. This stream can written to and read from, but it can also be polled, meaning that one checks if new data can be read or written.

RustConnection always used an internal buffer for reading, so R does not need to be buffered.

Implementations

impl RustConnection<DefaultStream>[src]

pub fn connect(dpy_name: Option<&str>) -> Result<(Self, usize), ConnectError>[src]

Establish a new connection.

If no dpy_name is provided, the value from $DISPLAY is used.

impl<S: Stream> RustConnection<S>[src]

pub fn connect_to_stream(stream: S, screen: usize) -> Result<Self, ConnectError>[src]

Establish a new connection to the given streams.

read is used for reading data from the X11 server and write is used for writing. screen is the number of the screen that should be used. This function checks that a screen with that number exists.

pub fn connect_to_stream_with_auth_info(
    stream: S,
    screen: usize,
    auth_name: Vec<u8>,
    auth_data: Vec<u8>
) -> Result<Self, ConnectError>
[src]

Establish a new connection to the given streams.

read is used for reading data from the X11 server and write is used for writing. screen is the number of the screen that should be used. This function checks that a screen with that number exists.

The parameters auth_name and auth_data are used for the members authorization_protocol_name and authorization_protocol_data of the SetupRequest that is sent to the X11 server.

pub fn for_connected_stream(
    stream: S,
    setup: Setup
) -> Result<Self, ConnectError>
[src]

Establish a new connection for an already connected stream.

read is used for reading data from the X11 server and write is used for writing. It is assumed that setup was just received from the server. Thus, the first reply to a request that is sent will have sequence number one.

pub fn stream(&self) -> &S[src]

Returns a reference to the contained stream.

Trait Implementations

impl<S: Stream> Connection for RustConnection<S>[src]

impl<S: Debug + Stream> Debug for RustConnection<S>[src]

impl<S: Stream> RequestConnection for RustConnection<S>[src]

type Buf = Vec<u8>

Type used as buffer to store raw replies or events before they are parsed. Read more

Auto Trait Implementations

impl<S = DefaultStream> !RefUnwindSafe for RustConnection<S>

impl<S> Send for RustConnection<S> where
    S: Send

impl<S> Sync for RustConnection<S> where
    S: Sync

impl<S> Unpin for RustConnection<S> where
    S: Unpin

impl<S> UnwindSafe for RustConnection<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<C> ConnectionExt for C where
    C: ConnectionExt + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<C> ConnectionExt for C where
    C: RequestConnection + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.