pub struct ExtDataControlStream { /* private fields */ }Expand description
The main object to send and receive events over ext-data-control Wayland protocol
Implementations§
Source§impl ExtDataControlStream
impl ExtDataControlStream
Sourcepub fn new() -> Result<Self, ExtDataControlConnectError>
pub fn new() -> Result<Self, ExtDataControlConnectError>
Sourcepub fn offer_text(
&mut self,
text: impl Into<String>,
) -> Result<(), WaylandError>
pub fn offer_text( &mut self, text: impl Into<String>, ) -> Result<(), WaylandError>
Push a text, so that other Wayland clients (i.e. apps) can “paste” it
§Errors
Returns an error if any internal component has errored.
Sourcepub fn drain(
&mut self,
) -> Result<Vec<ExtDataControlEvent>, ExtDataControlReadError>
pub fn drain( &mut self, ) -> Result<Vec<ExtDataControlEvent>, ExtDataControlReadError>
Drains all immediately available events from underlying resources and returns them, assuming that there’s something to read.
This method should be called if you know that the stream is readable
(i.e. by calling select/poll/epoll first on a file descriptor of ExtDataControlStream object)
§Errors
Returns an error if any of underlying components errored.
Trait Implementations§
Source§impl AsFd for ExtDataControlStream
impl AsFd for ExtDataControlStream
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Source§impl AsRawFd for ExtDataControlStream
impl AsRawFd for ExtDataControlStream
Source§impl Drop for ExtDataControlStream
impl Drop for ExtDataControlStream
Auto Trait Implementations§
impl !RefUnwindSafe for ExtDataControlStream
impl !Send for ExtDataControlStream
impl !Sync for ExtDataControlStream
impl !UnwindSafe for ExtDataControlStream
impl Freeze for ExtDataControlStream
impl Unpin for ExtDataControlStream
impl UnsafeUnpin for ExtDataControlStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.