pub struct SegWrapper<C: RequestConnection>(/* private fields */);Expand description
A RAII-like wrapper around a Seg.
Instances of this struct represent a Seg that is freed in Drop.
Any errors during Drop are silently ignored. Most likely an error here means that your
X11 connection is broken and later requests will also fail.
Implementations§
Source§impl<C: RequestConnection> SegWrapper<C>
impl<C: RequestConnection> SegWrapper<C>
Source§impl<'c, C: X11Connection> SegWrapper<&'c C>
impl<'c, C: X11Connection> SegWrapper<&'c C>
Create a new Seg and return a Seg wrapper and a cookie.
This is a thin wrapper around attach that allocates an id for the Seg.
This function returns the resulting SegWrapper that owns the created Seg and frees
it in Drop. This also returns a VoidCookie that comes from the call to
attach.
Errors can come from the call to X11Connection::generate_id or attach.
Source§impl<C: X11Connection> SegWrapper<C>
impl<C: X11Connection> SegWrapper<C>
Sourcepub fn attach(
conn: C,
shmid: u32,
read_only: bool,
) -> Result<Self, ReplyOrIdError>
pub fn attach( conn: C, shmid: u32, read_only: bool, ) -> Result<Self, ReplyOrIdError>
Create a new Seg and return a Seg wrapper
This is a thin wrapper around attach that allocates an id for the Seg.
This function returns the resulting SegWrapper that owns the created Seg and frees
it in Drop.
Errors can come from the call to X11Connection::generate_id or attach.
Source§impl<'c, C: X11Connection> SegWrapper<&'c C>
impl<'c, C: X11Connection> SegWrapper<&'c C>
Create a new Seg and return a Seg wrapper and a cookie.
This is a thin wrapper around attach_fd that allocates an id for the Seg.
This function returns the resulting SegWrapper that owns the created Seg and frees
it in Drop. This also returns a VoidCookie that comes from the call to
attach_fd.
Errors can come from the call to X11Connection::generate_id or attach_fd.
Source§impl<C: X11Connection> SegWrapper<C>
impl<C: X11Connection> SegWrapper<C>
Sourcepub fn attach_fd<A>(
conn: C,
shm_fd: A,
read_only: bool,
) -> Result<Self, ReplyOrIdError>where
A: Into<RawFdContainer>,
pub fn attach_fd<A>(
conn: C,
shm_fd: A,
read_only: bool,
) -> Result<Self, ReplyOrIdError>where
A: Into<RawFdContainer>,
Create a new Seg and return a Seg wrapper
This is a thin wrapper around attach_fd that allocates an id for the Seg.
This function returns the resulting SegWrapper that owns the created Seg and frees
it in Drop.
Errors can come from the call to X11Connection::generate_id or attach_fd.