pub struct SubrangeType<'input> { /* private fields */ }
Expand description
A subrange of another type.
Implementations§
Source§impl<'input> SubrangeType<'input>
impl<'input> SubrangeType<'input>
Sourcepub fn ty<'a>(
&self,
hash: &'a FileHash<'input>,
) -> Option<Cow<'a, Type<'input>>>
pub fn ty<'a>( &self, hash: &'a FileHash<'input>, ) -> Option<Cow<'a, Type<'input>>>
The underlying type of the subrange.
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 cmp_id(
hash_a: &FileHash<'_>,
a: &SubrangeType<'_>,
hash_b: &FileHash<'_>,
b: &SubrangeType<'_>,
) -> Ordering
pub fn cmp_id( hash_a: &FileHash<'_>, a: &SubrangeType<'_>, hash_b: &FileHash<'_>, b: &SubrangeType<'_>, ) -> Ordering
Compare the identifying information of two types.
Subrange types are considered equal if the underlying type and bounds 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§
Source§impl<'input> Clone for SubrangeType<'input>
impl<'input> Clone for SubrangeType<'input>
Source§fn clone(&self) -> SubrangeType<'input>
fn clone(&self) -> SubrangeType<'input>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'input> Debug for SubrangeType<'input>
impl<'input> Debug for SubrangeType<'input>
Source§impl<'input> Default for SubrangeType<'input>
impl<'input> Default for SubrangeType<'input>
Source§fn default() -> SubrangeType<'input>
fn default() -> SubrangeType<'input>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'input> Freeze for SubrangeType<'input>
impl<'input> RefUnwindSafe for SubrangeType<'input>
impl<'input> Send for SubrangeType<'input>
impl<'input> Sync for SubrangeType<'input>
impl<'input> Unpin for SubrangeType<'input>
impl<'input> UnwindSafe for SubrangeType<'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