Struct cosync::CosyncQueueHandle
source · [−]pub struct CosyncQueueHandle<T: ?Sized> { /* private fields */ }
Expand description
A handle to spawn tasks.
Examples
let mut cosync = Cosync::new();
let handler = cosync.create_queue_handle();
// make a thread and join it...
std::thread::spawn(move || {
handler.queue(|mut input| async move {
*input.get() = 20;
});
})
.join()
.unwrap();
let mut value = 1;
cosync.run_blocking(&mut value);
assert_eq!(value, 20);
Implementations
Trait Implementations
sourceimpl<T: ?Sized> Clone for CosyncQueueHandle<T>
impl<T: ?Sized> Clone for CosyncQueueHandle<T>
sourceimpl<T: Debug + ?Sized> Debug for CosyncQueueHandle<T>
impl<T: Debug + ?Sized> Debug for CosyncQueueHandle<T>
impl<T: ?Sized> Send for CosyncQueueHandle<T>
impl<T: ?Sized> Sync for CosyncQueueHandle<T>
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for CosyncQueueHandle<T> where
T: RefUnwindSafe,
impl<T: ?Sized> Unpin for CosyncQueueHandle<T>
impl<T: ?Sized> UnwindSafe for CosyncQueueHandle<T> where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more