all: use trait upcasting
This commit is contained in:
parent
f0caafc862
commit
09e5f89174
44 changed files with 90 additions and 269 deletions
|
|
@ -45,15 +45,13 @@ pub trait CpuWork: Send {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait AsyncCpuWork {
|
||||
pub trait AsyncCpuWork: Any {
|
||||
fn run(
|
||||
self: Box<Self>,
|
||||
eng: &Rc<AsyncEngine>,
|
||||
ring: &Rc<IoUring>,
|
||||
completion: WorkCompletion,
|
||||
) -> SpawnedFuture<CompletedWork>;
|
||||
|
||||
fn into_any(self: Box<Self>) -> Box<dyn Any>;
|
||||
}
|
||||
|
||||
pub struct WorkCompletion {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue