Struct ReadHandle

Source
pub struct ReadHandle<T> { /* private fields */ }
Available on non-crate feature allocator_api only.
Expand description

The reader for a Stele

Implementations§

Source§

impl<T> ReadHandle<T>

Source

pub fn read(&self, idx: usize) -> &T

Reads the value at the given index

§Panic

This function panics in debug if the given index is out of bounds. Since Index operates through this function, this same caveat also applies when indexing

Source

pub fn try_read(&self, idx: usize) -> Option<&T>

Attempts to read the value at the index and returns Some if the value exists, and None otherwise

Source

pub fn len(&self) -> usize

Returns the current length of the underlying Stele

Note: this is an optimistic operation and the length may be changing under you

Source

pub fn is_empty(&self) -> bool

Returns the current length of the underlying Stele

Note: This is an optimistic operation as a write may happen between the operation returning and making use of the information provided but if this returns false it cannot return true in the future

Source

pub fn iter(&self) -> RefIterator<'_, T>

Creates a RefIterator

This is primarily used to ensure the creation of a RefIterator when T is Copy

Source§

impl<T: Copy> ReadHandle<T>

Source

pub fn get(&self, idx: usize) -> T

Get provides a way to get an owned copy of a value inside a Stele provided the T implements Copy

§Panic

This function panics in debug if the given index is out of bounds

Trait Implementations§

Source§

impl<T> Clone for ReadHandle<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for ReadHandle<T>

Source§

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

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

impl<T> From<&Arc<Stele<T>>> for ReadHandle<T>

Source§

fn from(h: &Arc<Stele<T>>) -> Self

Converts to this type from the input type.
Source§

impl<T> Index<usize> for ReadHandle<T>

Source§

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<'a, T> IntoIterator for &'a ReadHandle<T>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = RefIterator<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T: Copy> IntoIterator for ReadHandle<T>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = CopyIterator<T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T> Send for ReadHandle<T>
where Stele<T>: Send + Sync,

Source§

impl<T> Sync for ReadHandle<T>
where Stele<T>: Send + Sync,

Auto Trait Implementations§

§

impl<T> Freeze for ReadHandle<T>

§

impl<T> RefUnwindSafe for ReadHandle<T>

§

impl<T> Unpin for ReadHandle<T>

§

impl<T> UnwindSafe for ReadHandle<T>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.