[−][src]Struct x11rb::cookie::Cookie
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]
R: for<'a> TryFrom<&'a [u8], Error = ParseError>,
C: RequestConnection,
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
Auto Trait Implementations
impl<'a, C: ?Sized, R> RefUnwindSafe for Cookie<'a, C, R> where
C: RefUnwindSafe,
R: RefUnwindSafe,
C: RefUnwindSafe,
R: RefUnwindSafe,
impl<'a, C: ?Sized, R> Send for Cookie<'a, C, R> where
C: Sync,
R: Send,
C: Sync,
R: Send,
impl<'a, C: ?Sized, R> Sync for Cookie<'a, C, R> where
C: Sync,
R: Sync,
C: Sync,
R: Sync,
impl<'a, C: ?Sized, R> Unpin for Cookie<'a, C, R> where
R: Unpin,
R: Unpin,
impl<'a, C: ?Sized, R> UnwindSafe for Cookie<'a, C, R> where
C: RefUnwindSafe,
R: UnwindSafe,
C: RefUnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,