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>
impl<'scope, 'data, T, const N: isize> TrackedArrayBase<'scope, 'data, T, N>
Sourcepub fn bits_data<'borrow>(
&'borrow self,
) -> BitsAccessor<'borrow, 'scope, 'data, T, T, N>
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.
Sourcepub fn bits_data_with_layout<'borrow, L>(
&'borrow self,
) -> BitsAccessor<'borrow, 'scope, 'data, T, L, N>
pub fn bits_data_with_layout<'borrow, L>( &'borrow self, ) -> BitsAccessor<'borrow, 'scope, 'data, T, L, N>
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.
Sourcepub fn try_bits_data<'borrow, L>(
&'borrow self,
) -> JlrsResult<BitsAccessor<'borrow, 'scope, 'data, T, L, N>>where
L: IsBits + ValidField,
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.
Sourcepub unsafe fn bits_data_unchecked<'borrow, L>(
&'borrow self,
) -> BitsAccessor<'borrow, 'scope, 'data, T, L, N>where
L: IsBits + ValidField,
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.
Sourcepub fn inline_data<'borrow>(
&'borrow self,
) -> InlineAccessor<'borrow, 'scope, 'data, T, T, N>where
T: ConstructType + ValidField,
pub fn inline_data<'borrow>(
&'borrow self,
) -> InlineAccessor<'borrow, 'scope, 'data, T, T, N>where
T: ConstructType + ValidField,
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.
Sourcepub fn inline_data_with_layout<'borrow, L>(
&'borrow self,
) -> InlineAccessor<'borrow, 'scope, 'data, T, L, N>
pub fn inline_data_with_layout<'borrow, L>( &'borrow self, ) -> InlineAccessor<'borrow, 'scope, 'data, T, L, N>
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.
Sourcepub fn try_inline_data<'borrow, L>(
&'borrow self,
) -> JlrsResult<InlineAccessor<'borrow, 'scope, 'data, T, L, N>>where
L: ValidField,
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.
Sourcepub unsafe fn inline_data_unchecked<'borrow, L>(
&'borrow self,
) -> InlineAccessor<'borrow, 'scope, 'data, T, L, N>where
L: ValidField,
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.
Sourcepub fn union_data<'borrow>(
&'borrow self,
) -> BitsUnionAccessor<'borrow, 'scope, 'data, T, N>where
T: BitsUnionCtor,
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.
Sourcepub fn try_union_data<'borrow>(
&'borrow self,
) -> JlrsResult<BitsUnionAccessor<'borrow, 'scope, 'data, T, N>>
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.
Sourcepub unsafe fn union_data_unchecked<'borrow>(
&'borrow self,
) -> BitsUnionAccessor<'borrow, 'scope, 'data, T, N>
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.
Sourcepub fn managed_data<'borrow>(
&'borrow self,
) -> ManagedAccessor<'borrow, 'scope, 'data, T, T, N>where
T: Managed<'scope, 'data> + ConstructType,
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.
Sourcepub fn try_managed_data<'borrow, L>(
&'borrow self,
) -> JlrsResult<ManagedAccessor<'borrow, 'scope, 'data, T, L, N>>
pub fn try_managed_data<'borrow, L>( &'borrow self, ) -> JlrsResult<ManagedAccessor<'borrow, 'scope, 'data, T, L, N>>
Try to create an accessor for managed data of type L.
If the element type is incompatible with L ArrayLayoutError::NotManaged is returned.
Sourcepub unsafe fn managed_data_unchecked<'borrow, L>(
&'borrow self,
) -> ManagedAccessor<'borrow, 'scope, 'data, T, L, N>where
L: Managed<'scope, 'data>,
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.
Sourcepub fn value_data<'borrow>(
&'borrow self,
) -> ValueAccessor<'borrow, 'scope, 'data, T, N>where
T: Managed<'scope, 'data> + ConstructType,
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.
Sourcepub fn try_value_data<'borrow>(
&'borrow self,
) -> JlrsResult<ValueAccessor<'borrow, 'scope, 'data, T, N>>
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.
Sourcepub unsafe fn value_data_unchecked<'borrow>(
&'borrow self,
) -> ValueAccessor<'borrow, 'scope, 'data, T, N>
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.
Sourcepub fn indeterminate_data<'borrow>(
&'borrow self,
) -> IndeterminateAccessor<'borrow, 'scope, 'data, T, N>
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>>§
Sourcepub fn dimensions<'borrow>(&'borrow self) -> ArrayDimensions<'borrow, N>
pub fn dimensions<'borrow>(&'borrow self) -> ArrayDimensions<'borrow, N>
Returns the dimensions of this array.
Sourcepub unsafe fn bits_data<'borrow>(
&'borrow self,
) -> BitsAccessor<'borrow, 'scope, 'data, T, T, N>
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.
Sourcepub unsafe fn bits_data_with_layout<'borrow, L>(
&'borrow self,
) -> BitsAccessor<'borrow, 'scope, 'data, T, L, N>
pub unsafe fn bits_data_with_layout<'borrow, L>( &'borrow self, ) -> BitsAccessor<'borrow, 'scope, 'data, T, L, N>
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.
Sourcepub unsafe fn try_bits_data<'borrow, L>(
&'borrow self,
) -> JlrsResult<BitsAccessor<'borrow, 'scope, 'data, T, L, N>>where
L: IsBits + ValidField,
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.
Sourcepub unsafe fn bits_data_unchecked<'borrow, L>(
&'borrow self,
) -> BitsAccessor<'borrow, 'scope, 'data, T, L, N>where
L: IsBits + ValidField,
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.
Sourcepub unsafe fn inline_data<'borrow>(
&'borrow self,
) -> InlineAccessor<'borrow, 'scope, 'data, T, T, N>where
T: ConstructType + ValidField,
pub unsafe fn inline_data<'borrow>(
&'borrow self,
) -> InlineAccessor<'borrow, 'scope, 'data, T, T, N>where
T: ConstructType + ValidField,
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.
Sourcepub unsafe fn inline_data_with_layout<'borrow, L>(
&'borrow self,
) -> InlineAccessor<'borrow, 'scope, 'data, T, L, N>
pub unsafe fn inline_data_with_layout<'borrow, L>( &'borrow self, ) -> InlineAccessor<'borrow, 'scope, 'data, T, L, N>
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.
Sourcepub unsafe fn try_inline_data<'borrow, L>(
&'borrow self,
) -> JlrsResult<InlineAccessor<'borrow, 'scope, 'data, T, L, N>>where
L: ValidField,
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.
Sourcepub unsafe fn inline_data_unchecked<'borrow, L>(
&'borrow self,
) -> InlineAccessor<'borrow, 'scope, 'data, T, L, N>where
L: ValidField,
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.
Sourcepub unsafe fn union_data<'borrow>(
&'borrow self,
) -> BitsUnionAccessor<'borrow, 'scope, 'data, T, N>where
T: BitsUnionCtor,
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.
Sourcepub unsafe fn try_union_data<'borrow>(
&'borrow self,
) -> JlrsResult<BitsUnionAccessor<'borrow, 'scope, 'data, T, N>>
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.
Sourcepub unsafe fn union_data_unchecked<'borrow>(
&'borrow self,
) -> BitsUnionAccessor<'borrow, 'scope, 'data, T, N>
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.
Sourcepub unsafe fn managed_data<'borrow>(
&'borrow self,
) -> ManagedAccessor<'borrow, 'scope, 'data, T, T, N>where
T: Managed<'scope, 'data> + ConstructType,
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.
Sourcepub unsafe fn try_managed_data<'borrow, L>(
&'borrow self,
) -> JlrsResult<ManagedAccessor<'borrow, 'scope, 'data, T, L, N>>
pub unsafe fn try_managed_data<'borrow, L>( &'borrow self, ) -> JlrsResult<ManagedAccessor<'borrow, 'scope, 'data, T, L, N>>
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.
Sourcepub unsafe fn managed_data_unchecked<'borrow, L>(
&'borrow self,
) -> ManagedAccessor<'borrow, 'scope, 'data, T, L, N>where
L: Managed<'scope, 'data>,
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.
Sourcepub unsafe fn value_data<'borrow>(
&'borrow self,
) -> ValueAccessor<'borrow, 'scope, 'data, T, N>where
T: Managed<'scope, 'data> + ConstructType,
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.
Sourcepub unsafe fn try_value_data<'borrow>(
&'borrow self,
) -> JlrsResult<ValueAccessor<'borrow, 'scope, 'data, T, N>>
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.
Sourcepub unsafe fn value_data_unchecked<'borrow>(
&'borrow self,
) -> ValueAccessor<'borrow, 'scope, 'data, T, N>
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.
Sourcepub unsafe fn indeterminate_data<'borrow>(
&'borrow self,
) -> IndeterminateAccessor<'borrow, 'scope, 'data, T, N>
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.