pub struct Weak<I> { /* private fields */ }
Expand description
A weak handle to a Wayland object
This handle does not keep the underlying user data alive, and can be converted back to a full resource
using Weak::upgrade()
.
Implementations§
Source§impl<I: Resource> Weak<I>
impl<I: Resource> Weak<I>
Sourcepub fn upgrade(&self) -> Result<I, InvalidId>
pub fn upgrade(&self) -> Result<I, InvalidId>
Try to upgrade with weak handle back into a full resource.
This will fail if either:
- the object represented by this handle has already been destroyed at the protocol level
- the Wayland connection has already been closed
Trait Implementations§
Source§impl PartialEq<Weak<WlCallback>> for WlCallback
impl PartialEq<Weak<WlCallback>> for WlCallback
Source§impl PartialEq<Weak<WlCompositor>> for WlCompositor
impl PartialEq<Weak<WlCompositor>> for WlCompositor
Source§impl PartialEq<Weak<WlDataDevice>> for WlDataDevice
impl PartialEq<Weak<WlDataDevice>> for WlDataDevice
Source§impl PartialEq<Weak<WlDataOffer>> for WlDataOffer
impl PartialEq<Weak<WlDataOffer>> for WlDataOffer
Source§impl PartialEq<Weak<WlDataSource>> for WlDataSource
impl PartialEq<Weak<WlDataSource>> for WlDataSource
Source§impl PartialEq<Weak<WlKeyboard>> for WlKeyboard
impl PartialEq<Weak<WlKeyboard>> for WlKeyboard
Source§impl PartialEq<Weak<WlShellSurface>> for WlShellSurface
impl PartialEq<Weak<WlShellSurface>> for WlShellSurface
Source§impl PartialEq<Weak<WlSubcompositor>> for WlSubcompositor
impl PartialEq<Weak<WlSubcompositor>> for WlSubcompositor
Source§impl PartialEq<Weak<WlSubsurface>> for WlSubsurface
impl PartialEq<Weak<WlSubsurface>> for WlSubsurface
impl<I> Eq for Weak<I>
Auto Trait Implementations§
impl<I> Freeze for Weak<I>
impl<I> RefUnwindSafe for Weak<I>where
I: RefUnwindSafe,
impl<I> Send for Weak<I>where
I: Send,
impl<I> Sync for Weak<I>where
I: Sync,
impl<I> Unpin for Weak<I>where
I: Unpin,
impl<I> UnwindSafe for Weak<I>where
I: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.