pub struct ArrayType<'input> { /* private fields */ }
Expand description
A type for an array of elements.
Implementations§
Source§impl<'input> ArrayType<'input>
impl<'input> ArrayType<'input>
Sourcepub fn element_type<'a>(
&self,
hash: &'a FileHash<'input>,
) -> Option<Cow<'a, Type<'input>>>
pub fn element_type<'a>( &self, hash: &'a FileHash<'input>, ) -> Option<Cow<'a, Type<'input>>>
The type of the elements in the array.
Sourcepub fn element_byte_size<'a>(&self, hash: &'a FileHash<'input>) -> Option<u64>
pub fn element_byte_size<'a>(&self, hash: &'a FileHash<'input>) -> Option<u64>
The size in bytes of an element in the array.
Sourcepub fn byte_size(&self, hash: &FileHash<'_>) -> Option<u64>
pub fn byte_size(&self, hash: &FileHash<'_>) -> Option<u64>
The size in bytes of an instance of this type.
Sourcepub fn counts(&self) -> impl Iterator<Item = Option<u64>> + '_
pub fn counts(&self) -> impl Iterator<Item = Option<u64>> + '_
The number of elements in each dimension of the array.
None
is used for unknown dimensions.
Sourcepub fn cmp_id(
hash_a: &FileHash<'_>,
a: &ArrayType<'_>,
hash_b: &FileHash<'_>,
b: &ArrayType<'_>,
) -> Ordering
pub fn cmp_id( hash_a: &FileHash<'_>, a: &ArrayType<'_>, hash_b: &FileHash<'_>, b: &ArrayType<'_>, ) -> Ordering
Compare the identifying information of two types.
Array types are considered equal if the element identifiers and counts are equal.
This can be used to sort, and to determine if two types refer to the same definition (even if there are differences in the definitions).
Trait Implementations§
Auto Trait Implementations§
impl<'input> Freeze for ArrayType<'input>
impl<'input> RefUnwindSafe for ArrayType<'input>
impl<'input> Send for ArrayType<'input>
impl<'input> Sync for ArrayType<'input>
impl<'input> Unpin for ArrayType<'input>
impl<'input> UnwindSafe for ArrayType<'input>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more