Struct narrow::offset::OffsetSlot

source ·
pub struct OffsetSlot<'a, OffsetItem: OffsetElement, Buffer: BufferType> { /* private fields */ }
Expand description

A reference to a slot in an offset

Implementations§

source§

impl<'a, OffsetItem: OffsetElement, Buffer: BufferType> OffsetSlot<'a, OffsetItem, Buffer>

source

pub fn position(&self) -> usize

Returns the position of this slot in the buffer i.e. the index.

source

pub fn start(&self) -> OffsetItem

Returns the start index of this offset slot.

source

pub fn start_usize(&self) -> usize

Returns the start index of this offset slot as usize.

§Panics

This function panics if the conversion of OffsetElement to usize fails.

source

pub fn range(&self) -> Range<OffsetItem>

Returns this offset as Range.

source

pub fn range_usize(&self) -> Range<usize>

Returns this offset as Range of usize.

source

pub fn end(&self) -> OffsetItem

Returns the end index of this offset slot.

source

pub fn end_usize(&self) -> usize

Returns the end index of this offset slot as usize.

§Panics

This function panics if the conversion of OffsetElement to usize fails.

source

pub fn len(&self) -> OffsetItem

Returns the length of this offset slot.

source

pub fn len_usize(&self) -> usize

Returns the length of this offset slot as usize.

§Panics

This function panics if the conversion of OffsetElement to usize fails.

source

pub fn tuple(&self) -> (OffsetItem, OffsetItem)

Returns the start and end index of this slot as tuple.

source

pub fn tuple_usize(&self) -> (usize, usize)

Returns the start and end index of this slot as usize tuple.

Auto Trait Implementations§

§

impl<'a, OffsetItem, Buffer> Freeze for OffsetSlot<'a, OffsetItem, Buffer>

§

impl<'a, OffsetItem, Buffer> RefUnwindSafe for OffsetSlot<'a, OffsetItem, Buffer>
where <Buffer as BufferType>::Buffer<OffsetItem>: RefUnwindSafe,

§

impl<'a, OffsetItem, Buffer> Send for OffsetSlot<'a, OffsetItem, Buffer>
where <Buffer as BufferType>::Buffer<OffsetItem>: Sync,

§

impl<'a, OffsetItem, Buffer> Sync for OffsetSlot<'a, OffsetItem, Buffer>
where <Buffer as BufferType>::Buffer<OffsetItem>: Sync,

§

impl<'a, OffsetItem, Buffer> Unpin for OffsetSlot<'a, OffsetItem, Buffer>

§

impl<'a, OffsetItem, Buffer> UnwindSafe for OffsetSlot<'a, OffsetItem, Buffer>
where <Buffer as BufferType>::Buffer<OffsetItem>: 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>,

§

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>,

§

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.
source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,