pub struct Scope<'scope, 'env: 'scope, C: 'env + Context = Global> { /* private fields */ }Expand description
A scope to enqueue events in.
See scope and local_scope
Implementations§
source§impl<'scope, 'env: 'scope, C: 'env + Context> Scope<'scope, 'env, C>
impl<'scope, 'env: 'scope, C: 'env + Context> Scope<'scope, 'env, C>
sourcepub unsafe fn new_async(ctx: &'env C) -> Self
Available on crate feature futures only.
pub unsafe fn new_async(ctx: &'env C) -> Self
futures only.Creates a new Event scope targeted to async use
sourcepub fn enqueue<E: FnOnce(&'env RawCommandQueue) -> Result<RawEvent>, F: 'scope + Consumer>(
&'scope self,
supplier: E,
consumer: F
) -> Result<Event<F>>
pub fn enqueue<E: FnOnce(&'env RawCommandQueue) -> Result<RawEvent>, F: 'scope + Consumer>( &'scope self, supplier: E, consumer: F ) -> Result<Event<F>>
Enqueues a new event within the scope.
sourcepub fn enqueue_noop<E: FnOnce(&'env RawCommandQueue) -> Result<RawEvent>>(
&'scope self,
supplier: E
) -> Result<NoopEvent>
pub fn enqueue_noop<E: FnOnce(&'env RawCommandQueue) -> Result<RawEvent>>( &'scope self, supplier: E ) -> Result<NoopEvent>
Enqueues a new NoopEvent within the scope.
sourcepub fn enqueue_phantom<T: 'scope, E: FnOnce(&'env RawCommandQueue) -> Result<RawEvent>>(
&'scope self,
supplier: E
) -> Result<PhantomEvent<T>>
pub fn enqueue_phantom<T: 'scope, E: FnOnce(&'env RawCommandQueue) -> Result<RawEvent>>( &'scope self, supplier: E ) -> Result<PhantomEvent<T>>
Enqueues a new NoopEvent within the scope.
Auto Trait Implementations§
impl<'scope, 'env, C = Global> !RefUnwindSafe for Scope<'scope, 'env, C>
impl<'scope, 'env, C> Send for Scope<'scope, 'env, C>where C: Sync,
impl<'scope, 'env, C> Sync for Scope<'scope, 'env, C>where C: Sync,
impl<'scope, 'env, C> Unpin for Scope<'scope, 'env, C>
impl<'scope, 'env, C = Global> !UnwindSafe for Scope<'scope, 'env, C>
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