pub struct DeviceState<C, B, P, Q, E> { /* private fields */ }Expand description
Complete typed object graph for one device instance.
Implementations§
Source§impl<C, B, P, Q, E> DeviceState<C, B, P, Q, E>
impl<C, B, P, Q, E> DeviceState<C, B, P, Q, E>
pub fn new( namespace: ObjectNamespace, limits: DeviceLimits, policy: ResourcePolicy, ) -> Result<Self, DeviceStateConfigError>
pub const fn limits(&self) -> DeviceLimits
pub const fn resource_policy(&self) -> ResourcePolicy
Sourcepub const fn retained_bytes(&self) -> RetainedBytes
pub const fn retained_bytes(&self) -> RetainedBytes
Bulk bytes still represented by live or releasing provider handles.
pub const fn namespace(&self) -> ObjectNamespace
pub const fn resource_counts(&self) -> ResourceCounts
pub const fn is_empty(&self) -> bool
pub const fn context_count(&self) -> u32
pub const fn buffer_count(&self) -> u32
pub const fn program_count(&self) -> u32
pub const fn queue_count(&self) -> u32
pub const fn event_count(&self) -> u32
pub fn context_record( &self, id: ObjectId, ) -> Result<&ContextRecord<C>, DeviceStateError>
pub fn buffer_record( &self, id: ObjectId, ) -> Result<&BufferRecord<B>, DeviceStateError>
pub fn buffer_record_mut( &mut self, id: ObjectId, ) -> Result<&mut BufferRecord<B>, DeviceStateError>
pub fn program_record( &self, id: ObjectId, ) -> Result<&ProgramRecord<P>, DeviceStateError>
pub fn queue_record( &self, id: ObjectId, ) -> Result<&QueueRecord<Q>, DeviceStateError>
pub fn event_record( &self, id: ObjectId, ) -> Result<&EventRecord<E>, DeviceStateError>
pub fn create_context_with<ProviderError>( &mut self, create: impl FnOnce() -> Result<C, ProviderError>, ) -> Result<ObjectId, CreateError<ProviderError>>
pub fn create_buffer_with<ProviderError>( &mut self, context_id: ObjectId, desc: BufferDesc, create: impl FnOnce(&C, BufferDesc) -> Result<(B, BufferInfo), ProviderError>, ) -> Result<BufferCreateOutcome, CreateError<ProviderError>>
pub fn create_program_with<ProviderError>( &mut self, context_id: ObjectId, artifact_bytes: u64, resident_bytes: u64, create: impl FnOnce(&C) -> Result<P, ProviderError>, ) -> Result<ObjectId, CreateError<ProviderError>>
pub fn create_queue_with<ProviderError>( &mut self, context_id: ObjectId, create: impl FnOnce(&C) -> Result<Q, ProviderError>, ) -> Result<ObjectId, CreateError<ProviderError>>
pub fn create_event_with<ProviderError>( &mut self, queue_id: ObjectId, program_id: ObjectId, buffer_ids: Vec<ObjectId>, create: impl FnOnce(SubmissionResources<'_, B, P, Q>) -> Result<E, ProviderError>, ) -> Result<ObjectId, CreateError<ProviderError>>
pub fn begin_context_release( &mut self, id: ObjectId, ) -> Result<C, DeviceStateError>
pub fn restore_context_release( &mut self, id: ObjectId, resource: C, ) -> Result<(), RestoreError<C>>
pub fn commit_context_release( &mut self, id: ObjectId, ) -> Result<(), DeviceStateError>
pub fn begin_buffer_release( &mut self, id: ObjectId, ) -> Result<B, DeviceStateError>
pub fn restore_buffer_release( &mut self, id: ObjectId, resource: B, ) -> Result<(), RestoreError<B>>
pub fn commit_buffer_release( &mut self, id: ObjectId, ) -> Result<(), DeviceStateError>
pub fn begin_program_release( &mut self, id: ObjectId, ) -> Result<P, DeviceStateError>
pub fn restore_program_release( &mut self, id: ObjectId, resource: P, ) -> Result<(), RestoreError<P>>
pub fn commit_program_release( &mut self, id: ObjectId, ) -> Result<(), DeviceStateError>
pub fn begin_queue_release( &mut self, id: ObjectId, ) -> Result<Q, DeviceStateError>
pub fn restore_queue_release( &mut self, id: ObjectId, resource: Q, ) -> Result<(), RestoreError<Q>>
pub fn commit_queue_release( &mut self, id: ObjectId, ) -> Result<(), DeviceStateError>
pub fn begin_event_release( &mut self, id: ObjectId, ) -> Result<E, DeviceStateError>
pub fn restore_event_release( &mut self, id: ObjectId, resource: E, ) -> Result<(), RestoreError<E>>
pub fn commit_event_release( &mut self, id: ObjectId, ) -> Result<(), DeviceStateError>
Auto Trait Implementations§
impl<C, B, P, Q, E> Freeze for DeviceState<C, B, P, Q, E>
impl<C, B, P, Q, E> RefUnwindSafe for DeviceState<C, B, P, Q, E>
impl<C, B, P, Q, E> Send for DeviceState<C, B, P, Q, E>
impl<C, B, P, Q, E> Sync for DeviceState<C, B, P, Q, E>
impl<C, B, P, Q, E> Unpin for DeviceState<C, B, P, Q, E>
impl<C, B, P, Q, E> UnsafeUnpin for DeviceState<C, B, P, Q, E>
impl<C, B, P, Q, E> UnwindSafe for DeviceState<C, B, P, Q, E>
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