x11rb::cookie

Struct VoidCookie

Source
pub struct VoidCookie<'a, C>{ /* private fields */ }
Expand description

A handle to a possible error from the X11 server.

When sending a request for which no reply is expected, this library returns a VoidCookie. This VoidCookie can then later be used to check if the X11 server sent an error.

See crate::cookie for infos on the different ways to handle X11 errors in response to a request.

Implementations§

Source§

impl<'a, C> VoidCookie<'a, C>

Source

pub fn new(connection: &C, sequence_number: SequenceNumber) -> VoidCookie<'_, C>

Construct a new cookie.

This function should only be used by implementations of Connection::send_request_without_reply.

Source

pub fn sequence_number(&self) -> SequenceNumber

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

Source

pub fn check(self) -> Result<(), ReplyError>

Check if the original request caused an X11 error.

Source

pub fn ignore_error(self)

Ignore all errors to this request.

Without calling this method, an error becomes available on the connection as an event after this cookie was dropped. This function causes errors to be ignored instead.

Trait Implementations§

Source§

impl<'a, C> Debug for VoidCookie<'a, C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C> Drop for VoidCookie<'_, C>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, C> Freeze for VoidCookie<'a, C>
where C: ?Sized,

§

impl<'a, C> RefUnwindSafe for VoidCookie<'a, C>
where C: RefUnwindSafe + ?Sized,

§

impl<'a, C> Send for VoidCookie<'a, C>
where C: Sync + ?Sized,

§

impl<'a, C> Sync for VoidCookie<'a, C>
where C: Sync + ?Sized,

§

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

§

impl<'a, C> UnwindSafe for VoidCookie<'a, C>
where C: RefUnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.