Trait wayland_backend::rs::server_impl::handle::ErasedState

source ·
pub(crate) trait ErasedState: Downcast {
Show 14 methods // Required methods fn object_info(&self, id: InnerObjectId) -> Result<ObjectInfo, InvalidId>; fn insert_client( &mut self, stream: UnixStream, data: Arc<dyn ClientData>, ) -> Result<InnerClientId>; fn get_client(&self, id: InnerObjectId) -> Result<ClientId, InvalidId>; fn get_client_data( &self, id: InnerClientId, ) -> Result<Arc<dyn ClientData>, InvalidId>; fn get_client_credentials( &self, id: InnerClientId, ) -> Result<Credentials, InvalidId>; fn with_all_clients(&self, f: &mut dyn FnMut(ClientId)); fn with_all_objects_for( &self, client_id: InnerClientId, f: &mut dyn FnMut(ObjectId), ) -> Result<(), InvalidId>; fn object_for_protocol_id( &self, client_id: InnerClientId, interface: &'static Interface, protocol_id: u32, ) -> Result<ObjectId, InvalidId>; fn get_object_data_any( &self, id: InnerObjectId, ) -> Result<Arc<dyn Any + Send + Sync>, InvalidId>; fn send_event( &mut self, msg: Message<ObjectId, RawFd>, ) -> Result<(), InvalidId>; fn post_error( &mut self, object_id: InnerObjectId, error_code: u32, message: CString, ); fn kill_client( &mut self, client_id: InnerClientId, reason: DisconnectReason, ); fn global_info(&self, id: InnerGlobalId) -> Result<GlobalInfo, InvalidId>; fn flush(&mut self, client: Option<ClientId>) -> Result<()>;
}

Required Methods§

source

fn object_info(&self, id: InnerObjectId) -> Result<ObjectInfo, InvalidId>

source

fn insert_client( &mut self, stream: UnixStream, data: Arc<dyn ClientData>, ) -> Result<InnerClientId>

source

fn get_client(&self, id: InnerObjectId) -> Result<ClientId, InvalidId>

source

fn get_client_data( &self, id: InnerClientId, ) -> Result<Arc<dyn ClientData>, InvalidId>

source

fn get_client_credentials( &self, id: InnerClientId, ) -> Result<Credentials, InvalidId>

source

fn with_all_clients(&self, f: &mut dyn FnMut(ClientId))

source

fn with_all_objects_for( &self, client_id: InnerClientId, f: &mut dyn FnMut(ObjectId), ) -> Result<(), InvalidId>

source

fn object_for_protocol_id( &self, client_id: InnerClientId, interface: &'static Interface, protocol_id: u32, ) -> Result<ObjectId, InvalidId>

source

fn get_object_data_any( &self, id: InnerObjectId, ) -> Result<Arc<dyn Any + Send + Sync>, InvalidId>

source

fn send_event(&mut self, msg: Message<ObjectId, RawFd>) -> Result<(), InvalidId>

source

fn post_error( &mut self, object_id: InnerObjectId, error_code: u32, message: CString, )

source

fn kill_client(&mut self, client_id: InnerClientId, reason: DisconnectReason)

source

fn global_info(&self, id: InnerGlobalId) -> Result<GlobalInfo, InvalidId>

source

fn flush(&mut self, client: Option<ClientId>) -> Result<()>

Implementations§

source§

impl dyn ErasedState

source

pub fn is<__T: ErasedState>(&self) -> bool

Returns true if the trait object wraps an object of type __T.

source

pub fn downcast<__T: ErasedState>( self: Box<Self>, ) -> Result<Box<__T>, Box<Self>>

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

source

pub fn downcast_rc<__T: ErasedState>( self: Rc<Self>, ) -> Result<Rc<__T>, Rc<Self>>

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

source

pub fn downcast_ref<__T: ErasedState>(&self) -> Option<&__T>

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

source

pub fn downcast_mut<__T: ErasedState>(&mut self) -> Option<&mut __T>

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Implementors§

source§

impl<D> ErasedState for State<D>