pub struct DeviceHandle<S>where
S: DeviceService,{ /* private fields */ }Expand description
TODO: Docs
Implementations§
Source§impl<S> DeviceHandle<S>where
S: DeviceService,
impl<S> DeviceHandle<S>where
S: DeviceService,
pub const fn is_blocking() -> bool
pub fn insert( device_id: DeviceId, service: S, ) -> Result<DeviceHandle<S>, ServiceCreationError>
pub fn new(device_id: DeviceId) -> DeviceHandle<S>
pub fn device_id(&self) -> DeviceId
pub fn utilities(&self) -> Arc<dyn Any + Sync + Send> ⓘ
pub fn submit_blocking<'a, R, T>(&self, task: T) -> Result<R, CallError>
pub fn submit<T>(&self, task: T)
pub fn flush_queue(&self)
pub fn exclusive<R, T>(&self, task: T) -> Result<R, CallError>
Sourcepub fn shutdown(device_id: DeviceId)
pub fn shutdown(device_id: DeviceId)
Stops the background runner threads for device_id, blocking until they
exit. Queued tasks run before the threads stop. Live handles keep their
runner alive, so all handles for the device should be dropped first.
Only meaningful for handle implementations with background threads; a no-op otherwise.
§Scope
This is device-wide, and S is ignored. It shuts down every
DeviceService registered on device_id, across both service stages, not
only S. The type parameter selects the handle implementation to dispatch
through, nothing more.
DeviceId is not unique across runtimes either: type_id is assigned per
runtime, so distinct backends can hand out the same id. Shutting down a
device from one runtime can therefore tear down another runtime’s services
on the colliding id, and block while that runtime’s handles are still live.
Trait Implementations§
Source§impl<S> Clone for DeviceHandle<S>where
S: DeviceService,
impl<S> Clone for DeviceHandle<S>where
S: DeviceService,
Source§fn clone(&self) -> DeviceHandle<S>
fn clone(&self) -> DeviceHandle<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<S> !RefUnwindSafe for DeviceHandle<S>
impl<S> !UnwindSafe for DeviceHandle<S>
impl<S> Freeze for DeviceHandle<S>
impl<S> Send for DeviceHandle<S>
impl<S> Sync for DeviceHandle<S>
impl<S> Unpin for DeviceHandle<S>
impl<S> UnsafeUnpin for DeviceHandle<S>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more