pub struct CosyncInput<T: ?Sized>(/* private fields */);Expand description
A guarded pointer to create a CosyncInputGuard by get and to queue more tasks by queue
Implementations§
Source§impl<T: 'static + ?Sized> CosyncInput<T>
impl<T: 'static + ?Sized> CosyncInput<T>
Sourcepub fn get(&mut self) -> CosyncInputGuard<'_, T>
pub fn get(&mut self) -> CosyncInputGuard<'_, T>
Gets the underlying CosyncInputGuard.
§Panics
This can panic if you move the CosyncInput out of a closure (with, eg an mspc channel). Do
not do that.
Sourcepub fn queue<Task, Out>(&self, task: Task) -> CosyncTaskId
pub fn queue<Task, Out>(&self, task: Task) -> CosyncTaskId
Queues a new task. This goes to the back of queue.
§Panics
It is possible for this function to panic if the CosyncInput was somehow moved
out of the closure it was created it. This should not be possible.
Sourcepub fn create_queue_handle(&self) -> CosyncQueueHandle<T>
pub fn create_queue_handle(&self) -> CosyncQueueHandle<T>
Creates a queue handle which can be used to spawn tasks.
Trait Implementations§
impl<T: ?Sized> Send for CosyncInput<T>
impl<T: ?Sized> Sync for CosyncInput<T>
Auto Trait Implementations§
impl<T> Freeze for CosyncInput<T>where
T: ?Sized,
impl<T> RefUnwindSafe for CosyncInput<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Unpin for CosyncInput<T>where
T: ?Sized,
impl<T> UnsafeUnpin for CosyncInput<T>where
T: ?Sized,
impl<T> UnwindSafe for CosyncInput<T>where
T: RefUnwindSafe + ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more