Struct smithay_client_toolkit::registry::RegistryState
source · pub struct RegistryState { /* private fields */ }
Expand description
State object associated with the registry handling for smithay’s client toolkit.
This object provides utilities to cache bound globals that are needed by multiple modules.
Implementations§
source§impl RegistryState
impl RegistryState
sourcepub fn new(global_list: &GlobalList) -> Self
pub fn new(global_list: &GlobalList) -> Self
Creates a new registry handle.
This type may be used to bind globals as they are advertised.
pub fn registry(&self) -> &WlRegistry
sourcepub fn globals(&self) -> impl Iterator<Item = &Global> + '_
pub fn globals(&self) -> impl Iterator<Item = &Global> + '_
Returns an iterator over all globals.
This list may change if the compositor adds or removes globals after initial enumeration.
No guarantees are provided about the ordering of the globals in this iterator.
sourcepub fn globals_by_interface<'a>(
&'a self,
interface: &'a str,
) -> impl Iterator<Item = &Global> + 'a
pub fn globals_by_interface<'a>( &'a self, interface: &'a str, ) -> impl Iterator<Item = &Global> + 'a
Returns an iterator over all globals implementing the given interface.
This may be more efficient than searching Self::globals.
sourcepub fn bind_one<I, D, U>(
&self,
qh: &QueueHandle<D>,
version: RangeInclusive<u32>,
udata: U,
) -> Result<I, BindError>
pub fn bind_one<I, D, U>( &self, qh: &QueueHandle<D>, version: RangeInclusive<u32>, udata: U, ) -> Result<I, BindError>
Binds a global, returning a new object associated with the global.
This should not be used to bind globals that have multiple instances such as wl_output
;
use Self::bind_all instead.
sourcepub fn bind_specific<I, D, U>(
&self,
qh: &QueueHandle<D>,
name: u32,
version: RangeInclusive<u32>,
udata: U,
) -> Result<I, BindError>
pub fn bind_specific<I, D, U>( &self, qh: &QueueHandle<D>, name: u32, version: RangeInclusive<u32>, udata: U, ) -> Result<I, BindError>
Binds a global, returning a new object associated with the global.
This binds a specific object by its name as provided by the RegistryHandler::new_global callback.
Trait Implementations§
source§impl Debug for RegistryState
impl Debug for RegistryState
source§impl<D> Dispatch<WlRegistry, GlobalListContents, D> for RegistryState
impl<D> Dispatch<WlRegistry, GlobalListContents, D> for RegistryState
source§fn event(
state: &mut D,
_: &WlRegistry,
event: Event,
_: &GlobalListContents,
conn: &Connection,
qh: &QueueHandle<D>,
)
fn event( state: &mut D, _: &WlRegistry, event: Event, _: &GlobalListContents, conn: &Connection, qh: &QueueHandle<D>, )
source§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
Auto Trait Implementations§
impl Freeze for RegistryState
impl !RefUnwindSafe for RegistryState
impl Send for RegistryState
impl Sync for RegistryState
impl Unpin for RegistryState
impl !UnwindSafe for RegistryState
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
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>
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>
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)
&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)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.