Struct open_coroutine_core::scheduler::SchedulerImpl
source · #[repr(C)]pub struct SchedulerImpl<'s> { /* private fields */ }
Implementations§
Trait Implementations§
source§impl<'s> Current<'s> for SchedulerImpl<'s>
impl<'s> Current<'s> for SchedulerImpl<'s>
source§impl<'s> Debug for SchedulerImpl<'s>
impl<'s> Debug for SchedulerImpl<'s>
source§impl Default for SchedulerImpl<'_>
impl Default for SchedulerImpl<'_>
source§impl Drop for SchedulerImpl<'_>
impl Drop for SchedulerImpl<'_>
source§impl<'j> JoinHandle<SchedulerImpl<'j>> for JoinHandleImpl<'j>
impl<'j> JoinHandle<SchedulerImpl<'j>> for JoinHandleImpl<'j>
source§impl Listener for SchedulerImpl<'_>
impl Listener for SchedulerImpl<'_>
source§fn on_create(&self, coroutine: &SchedulableCoroutine<'_>)
fn on_create(&self, coroutine: &SchedulableCoroutine<'_>)
callback when a coroutine is created.
This will be called by
Scheduler
when a coroutine is created.source§fn on_schedule(&self, timeout_time: u64)
fn on_schedule(&self, timeout_time: u64)
callback before scheduling coroutines.
This will be called by
Scheduler
before scheduling coroutines.source§fn on_resume(&self, timeout_time: u64, coroutine: &SchedulableCoroutine<'_>)
fn on_resume(&self, timeout_time: u64, coroutine: &SchedulableCoroutine<'_>)
callback before resuming the coroutine.
This will be called by
Scheduler
before resuming the coroutine.source§fn on_suspend(&self, timeout_time: u64, coroutine: &SchedulableCoroutine<'_>)
fn on_suspend(&self, timeout_time: u64, coroutine: &SchedulableCoroutine<'_>)
callback when a coroutine is suspended.
This will be called by
Scheduler
when a coroutine is suspended.source§fn on_syscall(
&self,
timeout_time: u64,
coroutine: &SchedulableCoroutine<'_>,
syscall: Syscall,
state: SyscallState
)
fn on_syscall( &self, timeout_time: u64, coroutine: &SchedulableCoroutine<'_>, syscall: Syscall, state: SyscallState )
callback when a coroutine enters syscall.
This will be called by
Scheduler
when a coroutine enters syscall.source§fn on_complete(
&self,
timeout_time: u64,
coroutine: &SchedulableCoroutine<'_>,
result: Option<usize>
)
fn on_complete( &self, timeout_time: u64, coroutine: &SchedulableCoroutine<'_>, result: Option<usize> )
callback when a coroutine is completed.
This will be called by
Scheduler
when a coroutine is completed.source§impl Named for SchedulerImpl<'_>
impl Named for SchedulerImpl<'_>
source§impl PartialEq for SchedulerImpl<'_>
impl PartialEq for SchedulerImpl<'_>
source§impl<'s> Scheduler<'s, JoinHandleImpl<'s>> for SchedulerImpl<'s>
impl<'s> Scheduler<'s, JoinHandleImpl<'s>> for SchedulerImpl<'s>
source§fn get_stack_size(&self) -> usize
fn get_stack_size(&self) -> usize
Get the default stack stack size for the coroutines in this scheduler.
If it has not been set, it will be
crate::constant::DEFAULT_STACK_SIZE
.source§fn set_stack_size(&self, stack_size: usize)
fn set_stack_size(&self, stack_size: usize)
Set the default stack stack size for the coroutines in this scheduler.
If it has not been set, it will be
crate::constant::DEFAULT_STACK_SIZE
.source§fn submit_raw_co(&self, coroutine: SchedulableCoroutine<'static>) -> Result<()>
fn submit_raw_co(&self, coroutine: SchedulableCoroutine<'static>) -> Result<()>
Submit a closure to create new coroutine, then the coroutine will be push into ready queue. Read more
source§fn try_resume(&self, co_name: &str) -> Result<()>
fn try_resume(&self, co_name: &str) -> Result<()>
Resume a coroutine from the system call table to the ready queue,
it’s generally only required for framework level crates. Read more
source§fn try_timeout_schedule(&self, timeout_time: u64) -> Result<u64>
fn try_timeout_schedule(&self, timeout_time: u64) -> Result<u64>
Attempt to schedule the coroutines before the
timeout_time
timestamp. Read moresource§fn try_get_co_result(
&self,
co_name: &str
) -> Option<Result<Option<usize>, &'s str>>
fn try_get_co_result( &self, co_name: &str ) -> Option<Result<Option<usize>, &'s str>>
Attempt to obtain coroutine result with the given
co_name
.source§fn add_listener(&mut self, listener: impl Listener + 's)
fn add_listener(&mut self, listener: impl Listener + 's)
Add a listener to this scheduler.
source§fn submit_co(
&self,
f: impl FnOnce(&dyn Suspender<'_, Resume = (), Yield = ()>, ()) -> Option<usize> + UnwindSafe + 'static,
stack_size: Option<usize>
) -> Result<Join>
fn submit_co( &self, f: impl FnOnce(&dyn Suspender<'_, Resume = (), Yield = ()>, ()) -> Option<usize> + UnwindSafe + 'static, stack_size: Option<usize> ) -> Result<Join>
Submit a closure to create new coroutine, then the coroutine will be push into ready queue. Read more
impl Eq for SchedulerImpl<'_>
Auto Trait Implementations§
impl<'s> !RefUnwindSafe for SchedulerImpl<'s>
impl<'s> !Send for SchedulerImpl<'s>
impl<'s> !Sync for SchedulerImpl<'s>
impl<'s> Unpin for SchedulerImpl<'s>
impl<'s> !UnwindSafe for SchedulerImpl<'s>
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more