fix(kasync): remove `*.try_spawn_in` methods. We cannot actually allocate tasks with an allocator other than the default global one, since we currently do not have the ability to free using a custom allocator.
···170170 {
171171 self.build_task().try_spawn(future)
172172 }
173173-174174- /// Attempt spawn this [`Future`] onto this executor using a custom [`Allocator`].
175175- ///
176176- /// This method returns a [`TaskRef`] which can be used to spawn it onto an [`crate::executor::Executor`]
177177- /// and a [`JoinHandle`] which can be used to await the futures output as well as control some aspects
178178- /// of its runtime behaviour (such as cancelling it).
179179- ///
180180- /// # Errors
181181- ///
182182- /// Returns [`AllocError`] when allocation of the task fails.
183183- pub fn try_spawn_in<F, A>(
184184- &'static self,
185185- future: F,
186186- alloc: A,
187187- ) -> Result<JoinHandle<F::Output>, SpawnError>
188188- where
189189- F: Future + Send + 'static,
190190- F::Output: Send + 'static,
191191- A: Allocator,
192192- {
193193- self.build_task().try_spawn_in(future, alloc)
194194- }
195173}
196174197175// === impl Worker ===
-30
libs/kasync/src/task/builder.rs
···108108109109 Ok(join)
110110 }
111111-112112- /// Attempt spawn this [`Future`] onto the executor using a custom [`Allocator`].
113113- ///
114114- /// This method returns a [`TaskRef`] which can be used to spawn it onto an [`crate::executor::Executor`]
115115- /// and a [`JoinHandle`] which can be used to await the futures output as well as control some aspects
116116- /// of its runtime behaviour (such as cancelling it).
117117- ///
118118- /// # Errors
119119- ///
120120- /// Returns [`AllocError`] when allocation of the task fails.
121121- #[inline]
122122- #[track_caller]
123123- pub fn try_spawn_in<F, A>(
124124- &self,
125125- future: F,
126126- alloc: A,
127127- ) -> Result<JoinHandle<F::Output>, SpawnError>
128128- where
129129- F: Future + Send,
130130- F::Output: Send,
131131- A: Allocator,
132132- {
133133- let task = self.build(future);
134134- let task = Box::try_new_in(task, alloc)?;
135135- let (task, join) = TaskRef::new_allocated(task);
136136-137137- (self.schedule)(task)?;
138138-139139- Ok(join)
140140- }
141111}