pub struct Storage { /* private fields */ }Implementations§
Source§impl Storage
impl Storage
pub fn new(data: Vec<f32>) -> Self
pub fn new_wgpu(buffer: Buffer, size: usize, _device_id: usize) -> Self
pub fn wgpu_buffer(&self) -> Option<&Buffer>
pub fn from_slice(data: &[f32]) -> Self
pub fn zeros(size: usize) -> Self
pub fn data(&self) -> RwLockReadGuard<'_, Vec<f32>>
pub fn data_mut(&self) -> RwLockWriteGuard<'_, Vec<f32>>
pub fn as_slice(&self) -> RwLockReadGuard<'_, Vec<f32>>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn device(&self) -> Device
pub fn to_device(&self, device: Device) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Storage
impl !RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnsafeUnpin for Storage
impl !UnwindSafe for Storage
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