TrackedArrayBase

Struct TrackedArrayBase 

Source
pub struct TrackedArrayBase<'scope, 'data, T, const N: isize> { /* private fields */ }
Expand description

A tracked array that provides immutable access

Implementations§

Source§

impl<'scope, 'data, T, const N: isize> TrackedArrayBase<'scope, 'data, T, N>

Source

pub fn bits_data<'borrow>( &'borrow self, ) -> BitsAccessor<'borrow, 'scope, 'data, T, T, N>

Create an accessor for isbits data.

Thanks to the restrictions on T the data is guaranteed to be stored inline as an array of Ts.

Source

pub fn bits_data_with_layout<'borrow, L>( &'borrow self, ) -> BitsAccessor<'borrow, 'scope, 'data, T, L, N>
where T: ConstructType + HasLayout<'static, 'static, Layout = L>, L: IsBits + ValidField,

Create an accessor for isbits data with layout L.

Thanks to the restrictions on T and L the elements are guaranteed to be stored inline as an array of Ls.

Source

pub fn try_bits_data<'borrow, L>( &'borrow self, ) -> JlrsResult<BitsAccessor<'borrow, 'scope, 'data, T, L, N>>
where L: IsBits + ValidField,

Try to create an accessor for isbits data with layout L.

If the array doesn’t have an isbits layout ArrayLayoutError::NotBits is returned. If L is not a valid field layout for the element type TypeError::InvalidLayout is returned.

Source

pub unsafe fn bits_data_unchecked<'borrow, L>( &'borrow self, ) -> BitsAccessor<'borrow, 'scope, 'data, T, L, N>
where L: IsBits + ValidField,

Create an accessor for isbits data with layout L without checking any invariants.

Safety:

The element type must be an isbits type, and L must be a valid field layout of the element type.

Source

pub fn inline_data<'borrow>( &'borrow self, ) -> InlineAccessor<'borrow, 'scope, 'data, T, T, N>

Create an accessor for inline data.

Thanks to the restrictions on T the data is guaranteed to be stored inline as an array of Ts.

Source

pub fn inline_data_with_layout<'borrow, L>( &'borrow self, ) -> InlineAccessor<'borrow, 'scope, 'data, T, L, N>
where T: ConstructType + HasLayout<'scope, 'data, Layout = L>, L: ValidField,

Create an accessor for inline data with layout L.

Thanks to the restrictions on T and L the elements are guaranteed to be stored inline as an array of Ls.

Source

pub fn try_inline_data<'borrow, L>( &'borrow self, ) -> JlrsResult<InlineAccessor<'borrow, 'scope, 'data, T, L, N>>
where L: ValidField,

Try to create an accessor for inline data with layout L.

If the array doesn’t have an inline layout ArrayLayoutError::NotInline is returned. If L is not a valid field layout for the element type TypeError::InvalidLayout is returned.

Source

pub unsafe fn inline_data_unchecked<'borrow, L>( &'borrow self, ) -> InlineAccessor<'borrow, 'scope, 'data, T, L, N>
where L: ValidField,

Create an accessor for inline data with layout L without checking any invariants.

Safety:

The elements must be stored inline, and L must be a valid field layout of the element type.

Source

pub fn union_data<'borrow>( &'borrow self, ) -> BitsUnionAccessor<'borrow, 'scope, 'data, T, N>
where T: BitsUnionCtor,

Create an accessor for unions of isbits types.

This function panics if the array doesn’t have a union layout.

Source

pub fn try_union_data<'borrow>( &'borrow self, ) -> JlrsResult<BitsUnionAccessor<'borrow, 'scope, 'data, T, N>>

Try to create an accessor for unions of isbits types.

If the element type is not a union of isbits types ArrayLayoutError::NotUnion is returned.

Source

pub unsafe fn union_data_unchecked<'borrow>( &'borrow self, ) -> BitsUnionAccessor<'borrow, 'scope, 'data, T, N>

Create an accessor for unions of isbits types without checking any invariants.

Safety:

The element type must be a union of isbits types.

Source

pub fn managed_data<'borrow>( &'borrow self, ) -> ManagedAccessor<'borrow, 'scope, 'data, T, T, N>
where T: Managed<'scope, 'data> + ConstructType,

Create an accessor for managed data.

Thanks to the restrictions on T the data is guaranteed to be as an array of Option<Weak<T>>s.

Source

pub fn try_managed_data<'borrow, L>( &'borrow self, ) -> JlrsResult<ManagedAccessor<'borrow, 'scope, 'data, T, L, N>>
where L: Managed<'scope, 'data> + Typecheck,

Try to create an accessor for managed data of type L.

If the element type is incompatible with L ArrayLayoutError::NotManaged is returned.

Source

pub unsafe fn managed_data_unchecked<'borrow, L>( &'borrow self, ) -> ManagedAccessor<'borrow, 'scope, 'data, T, L, N>
where L: Managed<'scope, 'data>,

Create an accessor for managed data of type L without checking any invariants.

Safety:

The element type must be compatible with L.

Source

pub fn value_data<'borrow>( &'borrow self, ) -> ValueAccessor<'borrow, 'scope, 'data, T, N>
where T: Managed<'scope, 'data> + ConstructType,

Create an accessor for value data.

Thanks to the restrictions on T the data is guaranteed to be as an array of Option<Weak<Value>>s.

Source

pub fn try_value_data<'borrow>( &'borrow self, ) -> JlrsResult<ValueAccessor<'borrow, 'scope, 'data, T, N>>

Try to create an accessor for value data.

If the elements are stored inline ArrayLayoutError::NotPointer is returned.

Source

pub unsafe fn value_data_unchecked<'borrow>( &'borrow self, ) -> ValueAccessor<'borrow, 'scope, 'data, T, N>

Create an accessor for managed data of type L without checking any invariants.

Safety:

The elements must not be stored inline.

Source

pub fn indeterminate_data<'borrow>( &'borrow self, ) -> IndeterminateAccessor<'borrow, 'scope, 'data, T, N>

Create an accessor for indeterminate data.

Methods from Deref<Target = ArrayBase<'scope, 'data, T, N>>§

Source

pub fn dimensions<'borrow>(&'borrow self) -> ArrayDimensions<'borrow, N>

Returns the dimensions of this array.

Source

pub fn zero_init(&self) -> bool

Returns true if the elements are zero-initialized.

Source

pub unsafe fn bits_data<'borrow>( &'borrow self, ) -> BitsAccessor<'borrow, 'scope, 'data, T, T, N>

Create an accessor for isbits data.

Thanks to the restrictions on T the data is guaranteed to be stored inline as an array of Ts.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn bits_data_with_layout<'borrow, L>( &'borrow self, ) -> BitsAccessor<'borrow, 'scope, 'data, T, L, N>
where T: ConstructType + HasLayout<'static, 'static, Layout = L>, L: IsBits + ValidField,

Create an accessor for isbits data with layout L.

Thanks to the restrictions on T and L the elements are guaranteed to be stored inline as an array of Ls.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn try_bits_data<'borrow, L>( &'borrow self, ) -> JlrsResult<BitsAccessor<'borrow, 'scope, 'data, T, L, N>>
where L: IsBits + ValidField,

Try to create an accessor for isbits data with layout L.

If the array doesn’t have an isbits layout ArrayLayoutError::NotBits is returned. If L is not a valid field layout for the element type TypeError::InvalidLayout is returned.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn bits_data_unchecked<'borrow, L>( &'borrow self, ) -> BitsAccessor<'borrow, 'scope, 'data, T, L, N>
where L: IsBits + ValidField,

Create an accessor for isbits data with layout L without checking any invariants.

Safety:

No mutable accessors to this data must exist. The element type must be an isbits type, and L must be a valid field layout of the element type.

Source

pub unsafe fn inline_data<'borrow>( &'borrow self, ) -> InlineAccessor<'borrow, 'scope, 'data, T, T, N>

Create an accessor for inline data.

Thanks to the restrictions on T the data is guaranteed to be stored inline as an array of Ts.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn inline_data_with_layout<'borrow, L>( &'borrow self, ) -> InlineAccessor<'borrow, 'scope, 'data, T, L, N>
where T: ConstructType + HasLayout<'scope, 'data, Layout = L>, L: ValidField,

Create an accessor for inline data with layout L.

Thanks to the restrictions on T and L the elements are guaranteed to be stored inline as an array of Ls.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn try_inline_data<'borrow, L>( &'borrow self, ) -> JlrsResult<InlineAccessor<'borrow, 'scope, 'data, T, L, N>>
where L: ValidField,

Try to create an accessor for inline data with layout L.

If the array doesn’t have an inline layout ArrayLayoutError::NotInline is returned. If L is not a valid field layout for the element type TypeError::InvalidLayout is returned.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn inline_data_unchecked<'borrow, L>( &'borrow self, ) -> InlineAccessor<'borrow, 'scope, 'data, T, L, N>
where L: ValidField,

Create an accessor for inline data with layout L without checking any invariants.

Safety:

No mutable accessors to this data must exist. The elements must be stored inline, and L must be a valid field layout of the element type.

Source

pub unsafe fn union_data<'borrow>( &'borrow self, ) -> BitsUnionAccessor<'borrow, 'scope, 'data, T, N>
where T: BitsUnionCtor,

Create an accessor for unions of isbits types.

This function panics if the array doesn’t have a union layout.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn try_union_data<'borrow>( &'borrow self, ) -> JlrsResult<BitsUnionAccessor<'borrow, 'scope, 'data, T, N>>

Try to create an accessor for unions of isbits types.

If the element type is not a union of isbits types ArrayLayoutError::NotUnion is returned.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn union_data_unchecked<'borrow>( &'borrow self, ) -> BitsUnionAccessor<'borrow, 'scope, 'data, T, N>

Create an accessor for unions of isbits types without checking any invariants.

Safety:

No mutable accessors to this data must exist. The element type must be a union of isbits types.

Source

pub unsafe fn managed_data<'borrow>( &'borrow self, ) -> ManagedAccessor<'borrow, 'scope, 'data, T, T, N>
where T: Managed<'scope, 'data> + ConstructType,

Create an accessor for managed data.

Thanks to the restrictions on T the data is guaranteed to be as an array of Option<Weak<T>>s.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn try_managed_data<'borrow, L>( &'borrow self, ) -> JlrsResult<ManagedAccessor<'borrow, 'scope, 'data, T, L, N>>
where L: Managed<'scope, 'data> + Typecheck,

Try to create an accessor for managed data of type L.

If the element type is incompatible with L ArrayLayoutError::NotManaged is returned.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn managed_data_unchecked<'borrow, L>( &'borrow self, ) -> ManagedAccessor<'borrow, 'scope, 'data, T, L, N>
where L: Managed<'scope, 'data>,

Create an accessor for managed data of type L without checking any invariants.

Safety:

No mutable accessors to this data must exist. The element type must be compatible with L.

Source

pub unsafe fn value_data<'borrow>( &'borrow self, ) -> ValueAccessor<'borrow, 'scope, 'data, T, N>
where T: Managed<'scope, 'data> + ConstructType,

Create an accessor for value data.

Thanks to the restrictions on T the data is guaranteed to be as an array of Option<Weak<Value>>s.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn try_value_data<'borrow>( &'borrow self, ) -> JlrsResult<ValueAccessor<'borrow, 'scope, 'data, T, N>>

Try to create an accessor for value data.

If the elements are stored inline ArrayLayoutError::NotPointer is returned.

Safety:

No mutable accessors to this data must exist.

Source

pub unsafe fn value_data_unchecked<'borrow>( &'borrow self, ) -> ValueAccessor<'borrow, 'scope, 'data, T, N>

Create an accessor for managed data of type L without checking any invariants.

Safety:

No mutable accessors to this data must exist. The elements must not be stored inline.

Source

pub unsafe fn indeterminate_data<'borrow>( &'borrow self, ) -> IndeterminateAccessor<'borrow, 'scope, 'data, T, N>

Create an accessor for indeterminate data.

Safety:

No mutable accessors to this data must exist.

Trait Implementations§

Source§

impl<'scope, 'data, T, const N: isize> Clone for TrackedArrayBase<'scope, 'data, T, N>

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<'scope, 'data, T, const N: isize> Deref for TrackedArrayBase<'scope, 'data, T, N>

Source§

type Target = ArrayBase<'scope, 'data, T, N>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T, const N: isize> Drop for TrackedArrayBase<'_, '_, T, N>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'scope, 'data, T, const N: isize> Freeze for TrackedArrayBase<'scope, 'data, T, N>

§

impl<'scope, 'data, T, const N: isize> RefUnwindSafe for TrackedArrayBase<'scope, 'data, T, N>
where T: RefUnwindSafe,

§

impl<'scope, 'data, T, const N: isize> !Send for TrackedArrayBase<'scope, 'data, T, N>

§

impl<'scope, 'data, T, const N: isize> !Sync for TrackedArrayBase<'scope, 'data, T, N>

§

impl<'scope, 'data, T, const N: isize> Unpin for TrackedArrayBase<'scope, 'data, T, N>
where T: Unpin,

§

impl<'scope, 'data, T, const N: isize> !UnwindSafe for TrackedArrayBase<'scope, 'data, T, N>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.