File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -77,3 +77,31 @@ impl SpawnError {
7777 true
7878 }
7979}
80+
81+ #[ cfg( feature = "alloc" ) ]
82+ mod if_alloc {
83+ use alloc:: boxed:: Box ;
84+ use super :: * ;
85+
86+ impl < Sp : ?Sized + Spawn > Spawn for Box < Sp > {
87+ fn spawn_obj ( & mut self , future : FutureObj < ' static , ( ) > )
88+ -> Result < ( ) , SpawnError > {
89+ ( * * self ) . spawn_obj ( future)
90+ }
91+
92+ fn status ( & self ) -> Result < ( ) , SpawnError > {
93+ ( * * self ) . status ( )
94+ }
95+ }
96+
97+ impl < Sp : ?Sized + LocalSpawn > LocalSpawn for Box < Sp > {
98+ fn spawn_local_obj ( & mut self , future : LocalFutureObj < ' static , ( ) > )
99+ -> Result < ( ) , SpawnError > {
100+ ( * * self ) . spawn_local_obj ( future)
101+ }
102+
103+ fn status_local ( & self ) -> Result < ( ) , SpawnError > {
104+ ( * * self ) . status_local ( )
105+ }
106+ }
107+ }
You can’t perform that action at this time.
0 commit comments