WIP - Allow RpcClient to register handlers for incoming messages
This commit is contained in:
+9
-1
@@ -1340,10 +1340,18 @@ impl MutableAppContext {
|
||||
Fut: 'static + Future<Output = T>,
|
||||
T: 'static,
|
||||
{
|
||||
let cx = AsyncAppContext(self.weak_self.as_ref().unwrap().upgrade().unwrap());
|
||||
let cx = self.to_async();
|
||||
self.foreground.spawn(f(cx))
|
||||
}
|
||||
|
||||
pub fn to_async(&self) -> AsyncAppContext {
|
||||
AsyncAppContext(self.weak_self.as_ref().unwrap().upgrade().unwrap())
|
||||
}
|
||||
|
||||
pub fn to_background(&self) -> BackgroundAppContext {
|
||||
//
|
||||
}
|
||||
|
||||
pub fn write_to_clipboard(&self, item: ClipboardItem) {
|
||||
self.platform.write_to_clipboard(item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user