Struct blaze_rs::buffer::rect::Rect2D

source ·
pub struct Rect2D<T> { /* private fields */ }
Expand description

A 2D rectangle stored in host memory in row-major order

Implementations§

source§

impl<T> Rect2D<T>

source

pub fn new(v: &[T], width: usize) -> Box<Self>where T: Copy,

source

pub fn new_uninit(width: usize, height: usize) -> RectBox2D<MaybeUninit<T>>

source

pub fn new_in<A: Allocator>(v: &[T], width: usize, alloc: A) -> Box<Self, A>where T: Copy,

Available on crate feature svm only.
source

pub fn new_uninit_in<A: Allocator>( width: usize, height: usize, alloc: A ) -> Box<Rect2D<MaybeUninit<T>>, A>

Available on crate feature svm only.
source

pub fn try_new(v: &[T], width: usize) -> Result<Box<Self>, AllocError>where T: Copy,

source

pub fn try_new_uninit( width: usize, height: usize ) -> Result<RectBox2D<MaybeUninit<T>>, AllocError>

source

pub fn try_new_in<A: Allocator>( v: &[T], width: usize, alloc: A ) -> Result<Box<Self, A>, AllocError>where T: Copy,

Available on crate feature svm only.
source

pub fn try_new_uninit_in<A: Allocator>( width: usize, height: usize, alloc: A ) -> Result<Box<Rect2D<MaybeUninit<T>>, A>, AllocError>

Available on crate feature svm only.
source§

impl<T> Rect2D<MaybeUninit<T>>

source

pub unsafe fn assume_init<A: Allocator>(self: Box<Self, A>) -> Box<Rect2D<T>, A>

source§

impl<T> Rect2D<T>

source

pub const fn width(&self) -> usize

source

pub const fn height(&self) -> usize

source

pub const fn len(&self) -> usize

source

pub const fn as_parts(&self) -> (&[T], usize)

source

pub fn get(&self, index: usize) -> Option<&[T]>

source

pub fn get_mut(&mut self, index: usize) -> Option<&mut [T]>

source

pub unsafe fn get_unchecked(&self, index: usize) -> &[T]

source

pub unsafe fn get_mut_unchecked(&mut self, index: usize) -> &mut [T]

source

pub const fn as_slice(&self) -> &[T]

source

pub fn as_mut_slice(&mut self) -> &mut [T]

source

pub const fn as_ptr(&self) -> *const T

source

pub fn as_mut_ptr(&mut self) -> *mut T

Trait Implementations§

source§

impl<T> Index<usize> for Rect2D<T>

§

type Output = [T]

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<T> IndexMut<usize> for Rect2D<T>

source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Rect2D<T>where T: RefUnwindSafe,

§

impl<T> Send for Rect2D<T>where T: Send,

§

impl<T> !Sized for Rect2D<T>

§

impl<T> Sync for Rect2D<T>where T: Sync,

§

impl<T> Unpin for Rect2D<T>where T: Unpin,

§

impl<T> UnwindSafe for Rect2D<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more