Struct x11rb::cookie::CookieWithFds
source · pub struct CookieWithFds<'a, C, R>where
C: RequestConnection + ?Sized,{
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 RawFd
s.
See crate::cookie for infos on the different ways to handle X11 errors in response to a request.
Fields§
§phantom: PhantomData<R>
Implementations§
source§impl<C, R> CookieWithFds<'_, C, R>
impl<C, R> CookieWithFds<'_, C, R>
sourcepub fn new(
connection: &C,
sequence_number: SequenceNumber,
) -> CookieWithFds<'_, C, R>
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
.
sourcepub fn sequence_number(&self) -> SequenceNumber
pub fn sequence_number(&self) -> SequenceNumber
Get the sequence number of the request that generated this cookie.
sourcepub fn raw_reply(self) -> Result<BufWithFds<C::Buf>, ReplyError>
pub fn raw_reply(self) -> Result<BufWithFds<C::Buf>, ReplyError>
Get the raw reply that the server sent.
sourcepub fn reply(self) -> Result<R, ReplyError>
pub fn reply(self) -> Result<R, ReplyError>
Get the reply that the server sent.
sourcepub(crate) fn replace_connection<C2: RequestConnection + ?Sized>(
self,
connection: &C2,
) -> CookieWithFds<'_, C2, R>
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.