[−][src]Struct crndm::ptr::FatPtr
A persistent fat pointer with offset and capacity
Implementations
impl<T: PSafe, A: MemPool> FatPtr<T, A>
[src]
pub unsafe fn new(x: &[T]) -> Self
[src]
Creates a new fat pointer given a slice
pub fn empty() -> Self
[src]
Sets the capacity to zero
pub fn is_empty(&self) -> bool
[src]
Returns true if the capacity is zero
pub fn get(&self, i: usize) -> &T
[src]
Returns a reference to the object at index i
pub fn get_mut(&self, i: usize) -> &mut T
[src]
Returns a mutable reference to the object at index i
pub unsafe fn get_unchecked(&self, i: usize) -> &mut T
[src]
Returns a mutable reference to the object at index i
without checking
the boundaries
pub fn off(&self) -> u64
[src]
Returns the offset
pub fn capacity(&self) -> usize
[src]
Returns the capacity of the fat pointer
pub unsafe fn as_slice(&self) -> &[T]
[src]
Converts the fat pointer into a slice of type &[T]
pub unsafe fn split_at(&mut self, mid: usize) -> (&[T], &[T])
[src]
Divides one slice into two at an index.
The first will contain all indices from [0, mid)
(excluding
the index mid
itself) and the second will contain all
indices from [mid, len)
(excluding the index len
itself).
Panics
Panics if mid > len
.
pub unsafe fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])
[src]
Divides one mutable slice into two at an index.
The first will contain all indices from [0, mid)
(excluding
the index mid
itself) and the second will contain all
indices from [mid, len)
(excluding the index len
itself).
Panics
Panics if mid > len
.
pub unsafe fn dup(&self, len: usize) -> FatPtr<T, A>
[src]
Creates a new copy of data and returns a FatPtr
pointer
Safety
The compiler would not drop the copied data. Developer has the responsibility of deallocating inner value. Also, it does not clone the inner value. Instead, it just copies the memory.
Trait Implementations
impl<A: MemPool, T: PSafe> Clone for FatPtr<T, A>
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<A: MemPool + Copy, T: PSafe + Copy> Copy for FatPtr<T, A>
[src]
impl<A: MemPool, T: PSafe> Default for FatPtr<T, A>
[src]
impl<T: Eq + PSafe, A: Eq + MemPool> Eq for FatPtr<T, A>
[src]
impl<A: MemPool, T: PSafe, '_> From<&'_ [T]> for FatPtr<T, A>
[src]
impl<A: MemPool, T: PSafe, '_> From<&'_ mut [T]> for FatPtr<T, A>
[src]
impl<T: PSafe, A: MemPool> Index<usize> for FatPtr<T, A>
[src]
impl<T: PSafe, A: MemPool> PSafe for FatPtr<T, A>
[src]
impl<A: MemPool, T: PSafe> PartialEq<FatPtr<T, A>> for FatPtr<T, A>
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<A: MemPool, T: PSafe> PmemUsage for FatPtr<T, A>
[src]
impl<A: MemPool, T> !Send for FatPtr<T, A>
[src]
Ptr
pointers are not Send
because the data they reference may be aliased.
impl<T: PSafe, A: MemPool> StructuralEq for FatPtr<T, A>
[src]
impl<A: MemPool, T> !Sync for FatPtr<T, A>
[src]
Ptr
pointers are not Sync
because the data they reference may be aliased.
impl<A: MemPool, T> !TxOutSafe for FatPtr<T, A>
[src]
Auto Trait Implementations
impl<T, A> LooseTxInUnsafe for FatPtr<T, A> where
A: LooseTxInUnsafe,
T: LooseTxInUnsafe,
[src]
A: LooseTxInUnsafe,
T: LooseTxInUnsafe,
impl<T, A> RefUnwindSafe for FatPtr<T, A> where
A: RefUnwindSafe,
T: RefUnwindSafe,
[src]
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> TxInSafe for FatPtr<T, A> where
A: TxInSafe,
T: TxInSafe,
[src]
A: TxInSafe,
T: TxInSafe,
impl<T, A> Unpin for FatPtr<T, A> where
A: Unpin,
T: Unpin,
[src]
A: Unpin,
T: Unpin,
impl<T, A> UnwindSafe for FatPtr<T, A> where
A: UnwindSafe,
T: UnwindSafe,
[src]
A: UnwindSafe,
T: UnwindSafe,
impl<T, A> VSafe for FatPtr<T, A> where
A: VSafe,
T: VSafe,
[src]
A: VSafe,
T: VSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,