Struct x11rb::cookie::CookieWithFds

source ·
pub struct CookieWithFds<'a, C, R>{
    raw_cookie: RawCookie<'a, C>,
    phantom: PhantomData<R>,
}
Expand description

A handle to a response containing RawFd 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.

This variant of Cookie represents a response that can contain RawFds.

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

Fields§

§raw_cookie: RawCookie<'a, C>§phantom: PhantomData<R>

Implementations§

source§

impl<C, R> CookieWithFds<'_, C, R>

source

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

Construct a new cookie.

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

source

pub fn sequence_number(&self) -> SequenceNumber

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

source

pub fn raw_reply(self) -> Result<BufWithFds<C::Buf>, ReplyError>

Get the raw reply that the server sent.

source

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

Get the reply that the server sent.

source

pub(crate) fn replace_connection<C2: RequestConnection + ?Sized>( self, connection: &C2, ) -> CookieWithFds<'_, C2, R>

Move this cookie to refer to another connection instance.

This function may only be used if both connections are “basically the same”. For example, a Cookie for a connection C can be moved to Rc<C> since that still refers to the same underlying connection.

Trait Implementations§

source§

impl<'a, C, R: Debug> Debug for CookieWithFds<'a, C, R>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

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

§

impl<'a, C, R> RefUnwindSafe for CookieWithFds<'a, C, R>

§

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

§

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

§

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

§

impl<'a, C, R> UnwindSafe for CookieWithFds<'a, C, R>
where R: UnwindSafe, 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>,

§

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>,

§

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.