[][src]Struct x11rb::cookie::Cookie

pub struct Cookie<'a, C: ?Sized, R> where
    C: RequestConnection
{ /* fields omitted */ }

A handle to a response from the X11 server.

When sending a request to the X11 server, this library returns a Cookie. This Cookie can then later be used to get the response that the server sent.

Implementations

impl<'_, C: ?Sized, R> Cookie<'_, C, R> where
    R: for<'a> TryFrom<&'a [u8], Error = ParseError>,
    C: RequestConnection
[src]

pub fn new(connection: &C, sequence_number: SequenceNumber) -> Cookie<C, R>[src]

Construct a new cookie.

This function should only be used by implementations of RequestConnection::send_request_with_reply.

pub fn sequence_number(&self) -> SequenceNumber[src]

Get the sequence number of the request that generated this cookie.

pub fn raw_reply(self) -> Result<C::Buf, ReplyError>[src]

Get the raw reply that the server sent.

pub fn raw_reply_unchecked(self) -> Result<Option<C::Buf>, ConnectionError>[src]

Get the raw reply that the server sent, but have errors handled as events.

pub fn reply(self) -> Result<R, ReplyError>[src]

Get the reply that the server sent.

pub fn reply_unchecked(self) -> Result<Option<R>, ConnectionError>[src]

Get the reply that the server sent, but have errors handled as events.

pub fn discard_reply_and_errors(self)[src]

Discard all responses to the request this cookie represents, even errors.

Without this function, errors are treated as events after the cookie is dropped.

Trait Implementations

impl<'a, C: Debug + ?Sized, R: Debug> Debug for Cookie<'a, C, R> where
    C: RequestConnection
[src]

Auto Trait Implementations

impl<'a, C: ?Sized, R> RefUnwindSafe for Cookie<'a, C, R> where
    C: RefUnwindSafe,
    R: RefUnwindSafe

impl<'a, C: ?Sized, R> Send for Cookie<'a, C, R> where
    C: Sync,
    R: Send

impl<'a, C: ?Sized, R> Sync for Cookie<'a, C, R> where
    C: Sync,
    R: Sync

impl<'a, C: ?Sized, R> Unpin for Cookie<'a, C, R> where
    R: Unpin

impl<'a, C: ?Sized, R> UnwindSafe for Cookie<'a, C, R> where
    C: RefUnwindSafe,
    R: 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<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.