pub struct PeerMemory { /* private fields */ }Expand description
Memory one device lets kernels on the other devices of its runtime bind.
It holds the address the owning device resolved for the allocation, and a binding that keeps the allocation in place there: a bound allocation is never freed, handed out again or relocated, so the address stays valid for as long as any clone lives.
Nothing orders the accesses. A kernel on another device reads whatever the memory holds when it runs, and its writes land whenever they land. Callers order them by synchronizing the devices, or by handing off inside the kernels through system-scope atomics.
Failures cross over through it. The owner marks it when work that should have written the memory failed, so a peer kernel reading it does not run on stale bytes, and a peer kernel that failed to write it marks it and taints the buffer on its owner, so a read there fails on the cause.
Implementations§
Source§impl PeerMemory
impl PeerMemory
Sourcepub fn owner(&self) -> &DeviceHandle<dyn Server>
pub fn owner(&self) -> &DeviceHandle<dyn Server>
The device that owns the memory.
Sourcepub fn failure(&self) -> Option<ServerError>
pub fn failure(&self) -> Option<ServerError>
The failure of the work that should have written the memory last, if it failed.
Sourcepub fn fail(&self, error: ServerError)
pub fn fail(&self, error: ServerError)
The work that should have written the memory failed with error.
Trait Implementations§
Source§impl Clone for PeerMemory
impl Clone for PeerMemory
Auto Trait Implementations§
impl !RefUnwindSafe for PeerMemory
impl !UnwindSafe for PeerMemory
impl Forget for PeerMemory
impl Freeze for PeerMemory
impl Send for PeerMemory
impl Sync for PeerMemory
impl Unpin for PeerMemory
impl UnsafeUnpin for PeerMemory
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