Struct Guard

Source
pub struct Guard<S> { /* private fields */ }
Expand description

The guard is used to recover the owning data from Chunks.

Implementations§

Source§

impl<S> Guard<S>
where S: Send,

Source

pub fn try_unwrap(self) -> Result<S, Self>

Tries to recover the owning data.

The method succeeds if the referencing chunk iterator and all chunks are dropped. Otherwise, it returns the guard intact.

Source

pub fn unwrap(self) -> S
where S: Debug,

Source

pub fn ref_count(&self) -> usize

Gets the reference count on the owning data.

Trait Implementations§

Source§

impl<S: Debug> Debug for Guard<S>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> Freeze for Guard<S>

§

impl<S> RefUnwindSafe for Guard<S>
where S: RefUnwindSafe,

§

impl<S> Send for Guard<S>
where S: Sync + Send,

§

impl<S> Sync for Guard<S>
where S: Sync + Send,

§

impl<S> Unpin for Guard<S>

§

impl<S> UnwindSafe for Guard<S>
where S: 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<S, T> ConcurrentSlice<T> for S

Source§

fn concurrent_split_at(self, index: usize) -> (Chunk<Self, T>, Chunk<Self, T>)
where Self: 'static + AsMut<[T]> + Sized + Send, T: 'static + Send,

Splits the slice-like data into two sub-slices, divided at specified index. Read more
Source§

fn concurrent_chunks(self, chunk_size: usize) -> Chunks<Self, T>
where Self: 'static + AsMut<[T]> + Sized + Send, T: 'static + Send,

Returns an iterator of roughly fixed-sized chunks of the slice. Read more
Source§

fn concurrent_chunks_by_division( self, division: impl Into<Option<usize>>, ) -> Chunks<Self, T>
where Self: 'static + AsMut<[T]> + Sized + Send, T: 'static + Send,

Returns an iterator with roughly division length of roughly fixed-sized chunks of the slice. Read more
Source§

fn owning_iter(self) -> Iter<Self, T>
where Self: 'static + Send + Deref + CloneStableAddress, Self::Target: AsRef<[T]>,

Returns an iterator of owned references to each element of the slice.
Source§

fn owning_windows(self, size: usize) -> Windows<Self, T>
where Self: 'static + Send + Deref + CloneStableAddress, Self::Target: AsRef<[T]>,

Returns an iterator of owned windows of length size. The windows are contiguous and overlap. If the slice is shorter than size, the iterator returns no values.
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.
Source§

impl<T> Erased for T