pub struct AppSender { /* private fields */ }
Expand description
Context struct passed to the application assistant creator
Implementations§
Source§impl AppSender
impl AppSender
Sourcepub fn queue_message(&self, target: MessageTarget, message: Message)
pub fn queue_message(&self, target: MessageTarget, message: Message)
Send a message to a view controller.
Sourcepub fn request_render(&self, target: ViewKey)
pub fn request_render(&self, target: ViewKey)
Request that a frame be rendered at the next appropriate time.
Sourcepub fn set_virtcon_mode(&self, virtcon_mode: VirtconMode)
pub fn set_virtcon_mode(&self, virtcon_mode: VirtconMode)
Mode for applications running directly on the display coordinator. Used by Virtcon and the screen saver but not generally useful.
Sourcepub fn create_additional_view(
&self,
options: Option<CreateViewOptions>,
) -> ViewKey
pub fn create_additional_view( &self, options: Option<CreateViewOptions>, ) -> ViewKey
Request the creation of an additional view.
Sourcepub fn close_additional_view(&self, view_key: ViewKey)
pub fn close_additional_view(&self, view_key: ViewKey)
Close an additional view. It is a fatal error to attempt to close a view that
was not created with create_additional_view()
.
Sourcepub fn create_cross_thread_sender<T: 'static + Send>(
&self,
target: MessageTarget,
) -> UnboundedSender<T>
pub fn create_cross_thread_sender<T: 'static + Send>( &self, target: MessageTarget, ) -> UnboundedSender<T>
Create an futures mpsc sender and a task to poll the receiver and
forward the message to the app sender. This setup works around the problem
that dyn Any references cannot be Send
at the cost of an extra trip through
the executor.
The ’static trait bounds here means that messages send across thread may not
contain any non-static references. The data in the messages must be owned, but
no not themselves need to be static.
Sourcepub fn new_for_testing_purposes_only() -> AppSender
pub fn new_for_testing_purposes_only() -> AppSender
Create an context for testing things that need an app context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppSender
impl !RefUnwindSafe for AppSender
impl !Send for AppSender
impl !Sync for AppSender
impl Unpin for AppSender
impl !UnwindSafe for AppSender
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)