trying to find a way for a central tokio::runtime
This commit is contained in:
parent
e9c78e4ea6
commit
ebce1449d6
1 changed files with 13 additions and 2 deletions
|
@ -47,10 +47,21 @@ mod db {
|
|||
|
||||
#[cxx_qt::bridge]
|
||||
mod utilities {
|
||||
use tokio::runtime::Runtime;
|
||||
|
||||
#[cxx_qt::qobject]
|
||||
#[derive(Default, Debug)]
|
||||
pub struct Utils {}
|
||||
#[derive(Debug)]
|
||||
pub struct Utils {
|
||||
runtime: Runtime,
|
||||
}
|
||||
|
||||
impl Default for Utils {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
runtime: tokio::runtime::Runtime::new().unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl qobject::Utils {
|
||||
#[qinvokable]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue