pub struct Scope<'scope, 'env, T>where
'env: 'scope,{ /* private fields */ }
Expand description
A TaskPool
scope for running one or more non-'static
futures.
For more information, see TaskPool::scope
.
Implementations
impl<'scope, 'env, T> Scope<'scope, 'env, T>where
T: 'scope + Send,
impl<'scope, 'env, T> Scope<'scope, 'env, T>where
T: 'scope + Send,
pub fn spawn<Fut>(&self, f: Fut)where
Fut: 'scope + Future<Output = T> + Send,
pub fn spawn<Fut>(&self, f: Fut)where
Fut: 'scope + Future<Output = T> + Send,
Spawns a scoped future onto the thread pool. The scope must outlive
the provided future. The results of the future will be returned as a part of
TaskPool::scope
’s return value.
For futures that should run on the thread scope
is called on Scope::spawn_on_scope
should be used
instead.
For more information, see TaskPool::scope
.
pub fn spawn_on_scope<Fut>(&self, f: Fut)where
Fut: 'scope + Future<Output = T> + Send,
pub fn spawn_on_scope<Fut>(&self, f: Fut)where
Fut: 'scope + Future<Output = T> + Send,
Spawns a scoped future onto the thread the scope is run on. The scope must outlive
the provided future. The results of the future will be returned as a part of
TaskPool::scope
’s return value. Users should generally prefer to use
Scope::spawn
instead, unless the provided future needs to run on the scope’s thread.
For more information, see TaskPool::scope
.
Trait Implementations
Auto Trait Implementations
impl<'scope, 'env, T> RefUnwindSafe for Scope<'scope, 'env, T>
impl<'scope, 'env, T> Send for Scope<'scope, 'env, T>where
T: Send,
impl<'scope, 'env, T> Sync for Scope<'scope, 'env, T>where
T: Send,
impl<'scope, 'env, T> Unpin for Scope<'scope, 'env, T>
impl<'scope, 'env, T> !UnwindSafe for Scope<'scope, 'env, T>
Blanket Implementations
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist. Read moresourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more