pub struct BlockId {
pub ptr: u64,
pub generation: Generation,
pub alloc_stream: StreamId,
pub device_ordinal: u32,
}Expand description
Compact identity of a DeviceBlock suitable for snapshotting
into structures whose lifetime should not be tied to the source
slice’s borrow. The fields needed to validate (ptr, generation)
against the resource’s live map and to resolve alloc_stream for
cross-stream waits / dealloc ordering.
Created via BlockId::from_block. Pure data; no resource
handle, no Drop. Cheap to copy.
Fields§
§ptr: u64§generation: Generation§alloc_stream: StreamId§device_ordinal: u32Implementations§
Source§impl BlockId
impl BlockId
Sourcepub fn from_block(block: &DeviceBlock) -> Self
pub fn from_block(block: &DeviceBlock) -> Self
Snapshot a DeviceBlock’s identity. The returned id is
independent of the original block’s borrow lifetime; the
runtime’s generation guard catches stale ids whose backing
allocation has been recycled.
Trait Implementations§
impl Copy for BlockId
impl Eq for BlockId
impl StructuralPartialEq for BlockId
Auto Trait Implementations§
impl Freeze for BlockId
impl RefUnwindSafe for BlockId
impl Send for BlockId
impl Sync for BlockId
impl Unpin for BlockId
impl UnsafeUnpin for BlockId
impl UnwindSafe for BlockId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more