Have new_with_stack impls return io::Result.

This commit is contained in:
Peter Huene
2021-03-03 13:27:56 -08:00
parent 4e83392070
commit 5ee2b8742a
3 changed files with 6 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ use std::cell::Cell;
use std::io;
use std::ptr;
use winapi::shared::minwindef::*;
use winapi::shared::winerror::ERROR_NOT_SUPPORTED;
use winapi::um::fibersapi::*;
use winapi::um::winbase::*;
@@ -66,12 +67,11 @@ impl Fiber {
}
}
pub fn new_with_stack<F, A, B, C>(_top_of_stack: *mut u8, _func: F) -> Self
pub fn new_with_stack<F, A, B, C>(_top_of_stack: *mut u8, _func: F) -> io::Result<Self>
where
F: FnOnce(A, &super::Suspend<A, B, C>) -> C,
{
// Windows fibers have no support for custom stacks
unimplemented!()
Err(io::Error::from_raw_os_error(ERROR_NOT_SUPPORTED as i32))
}
pub(crate) fn resume<A, B, C>(&self, result: &Cell<RunResult<A, B, C>>) {