pub struct SchedQueue { /* private fields */ }
Implementations§
Source§impl SchedQueue
impl SchedQueue
Sourcepub fn new() -> (Self, Receiver<MessageType>)
pub fn new() -> (Self, Receiver<MessageType>)
Create new scheduler. Use tokio runtime of the context that this function is called.
Sourcepub async fn add(&self, task: Task) -> Option<usize>
pub async fn add(&self, task: Task) -> Option<usize>
Schedule task. After calling this function, scheduler will automatically start executing its tasks.
pub async fn cancel(&self, task_id: usize) -> bool
Trait Implementations§
Source§impl Clone for SchedQueue
impl Clone for SchedQueue
Source§fn clone(&self) -> SchedQueue
fn clone(&self) -> SchedQueue
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for SchedQueue
impl !RefUnwindSafe for SchedQueue
impl Send for SchedQueue
impl Sync for SchedQueue
impl Unpin for SchedQueue
impl !UnwindSafe for SchedQueue
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