Struct hyper_ast::types::MySlice

source ·
#[repr(transparent)]
pub struct MySlice<T>(pub [T]);

Tuple Fields§

§0: [T]

Trait Implementations§

source§

impl<T> Children<u16, T> for MySlice<T>

source§

fn child_count(&self) -> u16

source§

fn get(&self, i: u16) -> Option<&T>

source§

fn rev(&self, idx: u16) -> Option<&T>

source§

fn after(&self, i: u16) -> &Self

source§

fn before(&self, i: u16) -> &Self

source§

fn between(&self, start: u16, end: u16) -> &Self

source§

fn inclusive(&self, start: u16, end: u16) -> &Self

source§

impl<T> Children<u8, T> for MySlice<T>

source§

fn child_count(&self) -> u8

source§

fn get(&self, i: u8) -> Option<&T>

source§

fn rev(&self, idx: u8) -> Option<&T>

source§

fn after(&self, i: u8) -> &Self

source§

fn before(&self, i: u8) -> &Self

source§

fn between(&self, start: u8, end: u8) -> &Self

source§

fn inclusive(&self, start: u8, end: u8) -> &Self

source§

impl<T: Debug> Debug for MySlice<T>

source§

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

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

impl<T: Debug> Default for &MySlice<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, T> From<&'a [T]> for &'a MySlice<T>

source§

fn from(value: &'a [T]) -> Self

Converts to this type from the input type.
source§

impl<T: Clone> From<&MySlice<T>> for Vec<T>

source§

fn from(value: &MySlice<T>) -> Self

Converts to this type from the input type.
source§

impl<T> Index<u16> for MySlice<T>

§

type Output = T

The returned type after indexing.
source§

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

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

impl<T> Index<u8> for MySlice<T>

§

type Output = T

The returned type after indexing.
source§

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

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

impl<T> Index<usize> for MySlice<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> IterableChildren<T> for MySlice<T>

§

type ChildrenIter<'a> = Iter<'a, T> where T: 'a

source§

fn iter_children(&self) -> Self::ChildrenIter<'_>

source§

fn is_empty(&self) -> bool

Auto Trait Implementations§

§

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

§

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

§

impl<T> !Sized for MySlice<T>

§

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

§

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

§

impl<T> UnwindSafe for MySlice<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
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R ) -> Rwhere Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.