fn with_scheduler<F, T>(scheduler_ptr: *mut Scheduler, f: F) -> T
where
  F: FnOnce(&Scheduler) -> T,
{
  let scheduler = unsafe { Box::from_raw(scheduler_ptr) };
  let t = f(&scheduler);
  mem::forget(scheduler);
  t
}
///
/// Scheduler and Session are intended to be shared between threads, and so their context
/// methods provide immutable references. The remaining types are not intended to be shared
/// between threads, so mutable access is provided.
///
Scheduler and Session are intended to be shared between threads, and so their context
methods provide immutable references. The remaining types are not intended to be shared
between threads, so mutable access is provided.
Scheduler and Session are intended to be shared between threads and so their context methods provide immutable references . The remaining types are not intended to be shared between threads so mutable access is provided .
fn with_scheduler<F, T>(scheduler_ptr: *mut Scheduler, f: F) -> T
where
  F: FnOnce(&Scheduler) -> T,
{
  let scheduler = unsafe { Box::from_raw(scheduler_ptr) };
  let t = f(&scheduler);
  mem::forget(scheduler);
  t
}
fn with_scheduler < F , T > ( scheduler_ptr : * mut Scheduler , f : F ) -> T where F : FnOnce ( & Scheduler ) -> T , { let scheduler = unsafe { Box :: from_raw ( scheduler_ptr ) } ; let t = f ( & scheduler ) ; mem :: forget ( scheduler ) ; t }
Scheduler and Session are intended to be shared between threads, and so their context
methods provide immutable references.
Scheduler and Session are intended to be shared between threads and so their context methods provide immutable references .
scheduler_ptr
*mut Scheduler
f
F
scheduler_ptr
*mut Scheduler
f
F