Make spawners Copy+Clone
This commit is contained in:
parent
dc8240229b
commit
d71c4b4551
@ -107,6 +107,7 @@ pub enum SpawnError {
|
|||||||
/// only be used in the executor thread (it is not Send itself).
|
/// only be used in the executor thread (it is not Send itself).
|
||||||
///
|
///
|
||||||
/// If you want to spawn tasks from another thread, use [SendSpawner].
|
/// If you want to spawn tasks from another thread, use [SendSpawner].
|
||||||
|
#[derive(Copy, Clone)]
|
||||||
pub struct Spawner {
|
pub struct Spawner {
|
||||||
executor: &'static raw::Executor,
|
executor: &'static raw::Executor,
|
||||||
not_send: PhantomData<*mut ()>,
|
not_send: PhantomData<*mut ()>,
|
||||||
@ -143,6 +144,7 @@ impl Spawner {
|
|||||||
/// only be used in the executor thread (it is not Send itself).
|
/// only be used in the executor thread (it is not Send itself).
|
||||||
///
|
///
|
||||||
/// If you want to spawn tasks from another thread, use [SendSpawner].
|
/// If you want to spawn tasks from another thread, use [SendSpawner].
|
||||||
|
#[derive(Copy, Clone)]
|
||||||
pub struct SendSpawner {
|
pub struct SendSpawner {
|
||||||
executor: &'static raw::Executor,
|
executor: &'static raw::Executor,
|
||||||
not_send: PhantomData<*mut ()>,
|
not_send: PhantomData<*mut ()>,
|
||||||
|
Loading…
Reference in New Issue
Block a user