pub struct Launches(/* private fields */);Expand description
The launches handed over to this one: shared with the thread that listens, taken at the next pass of the application.
Implementations§
Source§impl Launches
impl Launches
Sourcepub fn deliver(&self, launch: Launch)
pub fn deliver(&self, launch: Launch)
Hands a launch over, as a later launch does through the socket.
Sourcepub fn take(&self) -> Vec<Launch>
pub fn take(&self) -> Vec<Launch>
The launches handed over since the last call, oldest first, taken
out (each is taken once; Launches::history keeps them). What
InstancePlugin runs instance.second_launch for at each pass;
an application without App calls it each frame instead (see
Launches::set_waker).
Sourcepub fn set_waker(&self, ctx: Option<Context>)
pub fn set_waker(&self, ctx: Option<Context>)
The egui context to repaint when a launch is handed over (None:
none), so that a window waiting for input sees it at once.
InstancePlugin sets its application’s; an application without
App sets its own and takes the launches in
its frame:
use egui_pop_platform::instance::{self, Launch, Single};
// At the top of `main`: `instance::single("org.example.App")?`.
let single = Single::First(instance::Instance::detached(Launch::default()));
let Single::First(instance) = single else {
return; // Handed over to the running instance: exit.
};
let launches = instance.launches();
let ctx = egui::Context::default(); // eframe's, in `App::new`.
launches.set_waker(Some(ctx.clone()));
// A later launch, as the listening thread hands it over.
launches.deliver(Launch { args: vec!["photo.jpg".into()], ..Launch::default() });
// In the frame (`eframe::App::update`):
for launch in launches.take() {
egui_pop_platform::window::raise(&ctx);
assert_eq!(launch.args, ["photo.jpg"]); // Open what it names.
}
assert!(launches.take().is_empty());Trait Implementations§
Auto Trait Implementations§
impl Freeze for Launches
impl RefUnwindSafe for Launches
impl Send for Launches
impl Sync for Launches
impl Unpin for Launches
impl UnsafeUnpin for Launches
impl UnwindSafe for Launches
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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.