pub struct TransferQueue { /* private fields */ }Expand description
A simple upload / download transfer queue for a GPU pool.
Implementations§
Source§impl TransferQueue
impl TransferQueue
Sourcepub fn copy_to_gpu(
&mut self,
handle: GpuBufferHandle,
offset: usize,
data: Vec<u8>,
)
pub fn copy_to_gpu( &mut self, handle: GpuBufferHandle, offset: usize, data: Vec<u8>, )
Enqueue an upload of data to handle at offset.
Sourcepub fn copy_from_gpu(
&mut self,
handle: GpuBufferHandle,
_offset: usize,
_len: usize,
)
pub fn copy_from_gpu( &mut self, handle: GpuBufferHandle, _offset: usize, _len: usize, )
Enqueue a download of len bytes from handle at offset.
Sourcepub fn execute_transfers(&mut self, pool: &mut GpuBufferPool) -> usize
pub fn execute_transfers(&mut self, pool: &mut GpuBufferPool) -> usize
Execute all pending transfers against the pool.
Returns the number of upload operations executed.
Sourcepub fn drain_downloads(&mut self) -> Vec<DownloadResult>
pub fn drain_downloads(&mut self) -> Vec<DownloadResult>
Drain completed download results.
Sourcepub fn pending_uploads(&self) -> usize
pub fn pending_uploads(&self) -> usize
Number of pending uploads.
Trait Implementations§
Source§impl Debug for TransferQueue
impl Debug for TransferQueue
Auto Trait Implementations§
impl Freeze for TransferQueue
impl RefUnwindSafe for TransferQueue
impl Send for TransferQueue
impl Sync for TransferQueue
impl Unpin for TransferQueue
impl UnsafeUnpin for TransferQueue
impl UnwindSafe for TransferQueue
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> 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