Struct Slice

Source
pub struct Slice<T, Mutability> { /* private fields */ }

Implementations§

Source§

impl<'a, T, Mutability> Slice<T, Mutability>

Source

pub fn x(&self) -> usize

Source

pub fn y(&self) -> usize

Source

pub fn width(&self) -> usize

Source

pub fn height(&self) -> usize

Source

pub fn get(&self, x: usize, y: usize) -> Option<&T>

Source

pub fn slice( &self, x: usize, y: usize, width: usize, height: usize, ) -> Option<ImmutableSlice<'a, T>>

Source

pub fn hsplit_at( &self, y: usize, ) -> Option<(ImmutableSlice<'a, T>, ImmutableSlice<'a, T>)>

Source

pub fn vsplit_at( &self, x: usize, ) -> Option<(ImmutableSlice<'a, T>, ImmutableSlice<'a, T>)>

Source§

impl<'a, T: 'a> Slice<T, Mutable<'a, T>>

Source

pub fn get_mut(&mut self, x: usize, y: usize) -> Option<&mut T>

Source

pub fn slice_mut( &mut self, x: usize, y: usize, width: usize, height: usize, ) -> Option<MutableSlice<'a, T>>

Source

pub fn hsplit_at_mut( &mut self, y: usize, ) -> Option<(MutableSlice<'a, T>, MutableSlice<'a, T>)>

Source

pub fn vsplit_at_mut( &mut self, x: usize, ) -> Option<(MutableSlice<'a, T>, MutableSlice<'a, T>)>

Trait Implementations§

Source§

impl<T: Debug, Mutability> Debug for Slice<T, Mutability>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T: PartialEq, Mutability> PartialEq<&'a [&'a [T]]> for Slice<T, Mutability>

Source§

fn eq(&self, rhs: &&[&[T]]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialEq, M1, M2> PartialEq<Slice<T, M2>> for Slice<T, M1>

Source§

fn eq(&self, rhs: &Slice<T, M2>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<T, Mutability> Freeze for Slice<T, Mutability>
where Mutability: Freeze,

§

impl<T, Mutability> RefUnwindSafe for Slice<T, Mutability>
where Mutability: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, Mutability> !Send for Slice<T, Mutability>

§

impl<T, Mutability> !Sync for Slice<T, Mutability>

§

impl<T, Mutability> Unpin for Slice<T, Mutability>
where Mutability: Unpin,

§

impl<T, Mutability> UnwindSafe for Slice<T, Mutability>
where Mutability: UnwindSafe, T: RefUnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.