pub struct LocalAsyncRuntime<O: Default + 'static> { /* private fields */ }
Expand description
本地线程绑定的异步运行时
Implementations§
Source§impl<O: Default + 'static> LocalAsyncRuntime<O>
impl<O: Default + 'static> LocalAsyncRuntime<O>
Sourcepub fn new(
inner: *const (),
get_id_func: fn(*const ()) -> usize,
spawn_func: fn(*const (), BoxFuture<'static, O>) -> Result<()>,
spawn_timing_func: fn(*const (), BoxFuture<'static, O>, usize) -> Result<()>,
timeout_func: fn(*const (), usize) -> BoxFuture<'static, ()>,
) -> Self
pub fn new( inner: *const (), get_id_func: fn(*const ()) -> usize, spawn_func: fn(*const (), BoxFuture<'static, O>) -> Result<()>, spawn_timing_func: fn(*const (), BoxFuture<'static, O>, usize) -> Result<()>, timeout_func: fn(*const (), usize) -> BoxFuture<'static, ()>, ) -> Self
创建本地线程绑定的异步运行时
Sourcepub fn sapwn_timing_func<F>(&self, future: F, timeout: usize) -> Result<()>
pub fn sapwn_timing_func<F>(&self, future: F, timeout: usize) -> Result<()>
定时派发一个指定的异步任务到本地线程绑定的异步运行时
Trait Implementations§
impl<O: Default + 'static> Send for LocalAsyncRuntime<O>
impl<O: Default + 'static> Sync for LocalAsyncRuntime<O>
Auto Trait Implementations§
impl<O> Freeze for LocalAsyncRuntime<O>
impl<O> RefUnwindSafe for LocalAsyncRuntime<O>
impl<O> Unpin for LocalAsyncRuntime<O>
impl<O> UnwindSafe for LocalAsyncRuntime<O>
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