pub struct BufferBinding {
pub memory: ManagedMemoryBinding,
pub service: ServiceId,
pub offset_start: Option<u64>,
pub offset_end: Option<u64>,
pub stream: StreamId,
pub size: u64,
}Expand description
A buffer binding represents a Handle that is bound to managed memory.
The memory used is known by the compute server.
A buffer binding is only valid after being initlized with [super::Server::initialize_bindings]
§Notes
A buffer binding is detached from a Handle, meaning that is won’t affect Handle::can_mut.
Fields§
§memory: ManagedMemoryBindingThe id of the handle the binding is bound to.
service: ServiceIdThe service whose memory this binding addresses; see Handle::service.
offset_start: Option<u64>Memory offset in bytes.
offset_end: Option<u64>Memory offset in bytes.
stream: StreamIdThe stream where the data was created.
size: u64Length of the underlying buffer ignoring offsets
Implementations§
Source§impl BufferBinding
impl BufferBinding
Sourcepub fn size_in_used(&self) -> u64
pub fn size_in_used(&self) -> u64
Get the size of the handle, in bytes, accounting for offsets
Sourcepub fn range(&self) -> Range<u64> ⓘ
pub fn range(&self) -> Range<u64> ⓘ
The byte range of the allocation this binding names: what the offsets leave of the buffer. This is the region the taint bookkeeping claims when work writing through this binding fails, and releases when work writing through it lands.
Sourcepub fn claim_key(&self) -> (ManagedMemoryId, u64, u64)
pub fn claim_key(&self) -> (ManagedMemoryId, u64, u64)
The identity a claim on this binding is stored under: the allocation
and the byte range of it, exactly as range computes
it.
Anything that deduplicates or compares claims — a capture’s write set, above all — must key by this and nothing coarser. Two tensors carved from one batched allocation share a memory id and nothing else; keyed by the id alone, one sibling’s claim swallows the others’.
Trait Implementations§
Source§impl Clone for BufferBinding
impl Clone for BufferBinding
Auto Trait Implementations§
impl Freeze for BufferBinding
impl RefUnwindSafe for BufferBinding
impl Send for BufferBinding
impl Sync for BufferBinding
impl Unpin for BufferBinding
impl UnsafeUnpin for BufferBinding
impl UnwindSafe for BufferBinding
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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