pub struct ErasedPayload { /* private fields */ }Expand description
Type-erased payload wrapper so runtimes can carry GPU-capable data without monomorphizing.
Implementations§
Source§impl ErasedPayload
impl ErasedPayload
pub fn from_cpu<T>(val: T) -> Self
pub fn from_gpu<T>(val: T::GpuRepr) -> Self
pub fn is_gpu(&self) -> bool
pub fn upload(&self, ctx: &GpuContextHandle) -> Result<ErasedPayload, GpuError>
pub fn download( &self, ctx: &GpuContextHandle, ) -> Result<ErasedPayload, GpuError>
pub fn as_cpu<T>(&self) -> Option<&T>where
T: GpuSendable + 'static,
pub fn as_gpu<T>(&self) -> Option<&T::GpuRepr>where
T: GpuSendable + 'static,
T::GpuRepr: 'static,
pub fn try_downcast_cpu_any<T>(&self) -> Option<T>
pub fn clone_cpu<T>(&self) -> Option<T>where
T: GpuSendable + Clone + 'static,
pub fn take_cpu<T>(self) -> Result<T, Self>
pub fn take_cpu_any<T>(self) -> Result<T, Self>
pub fn clone_gpu<T>(&self) -> Option<T::GpuRepr>
Trait Implementations§
Source§impl Clone for ErasedPayload
impl Clone for ErasedPayload
Source§fn clone(&self) -> ErasedPayload
fn clone(&self) -> ErasedPayload
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ErasedPayload
impl !RefUnwindSafe for ErasedPayload
impl Send for ErasedPayload
impl Sync for ErasedPayload
impl Unpin for ErasedPayload
impl !UnwindSafe for ErasedPayload
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,
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>
Converts
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>
Converts
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