pub struct SemanticLength(pub u32);Expand description
Represents the length of an array or vector as seen from a user’s perspective.
For example in the array [(u8, u16, [u32; 4]); 8], the semantic length is 8.
Tuple Fields§
§0: u32Implementations§
Trait Implementations§
Source§impl Add for SemanticLength
impl Add for SemanticLength
Source§fn add(self, rhs: SemanticLength) -> Self::Output
fn add(self, rhs: SemanticLength) -> Self::Output
Computes the sum of two semantic lengths.
Source§type Output = SemanticLength
type Output = SemanticLength
The resulting type after applying the
+ operator.Source§impl AddAssign for SemanticLength
impl AddAssign for SemanticLength
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Adds another semantic length to this one.
Source§impl Clone for SemanticLength
impl Clone for SemanticLength
Source§fn clone(&self) -> SemanticLength
fn clone(&self) -> SemanticLength
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 Debug for SemanticLength
impl Debug for SemanticLength
Source§impl<'de> Deserialize<'de> for SemanticLength
impl<'de> Deserialize<'de> for SemanticLength
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SemanticLength
impl Display for SemanticLength
Source§impl Hash for SemanticLength
impl Hash for SemanticLength
Source§impl Mul<ElementTypesLength> for SemanticLength
impl Mul<ElementTypesLength> for SemanticLength
Source§fn mul(self, rhs: ElementTypesLength) -> Self::Output
fn mul(self, rhs: ElementTypesLength) -> Self::Output
Computes the semi-flattened length by multiplying the semantic length by the element types length.
Source§type Output = SemiFlattenedLength
type Output = SemiFlattenedLength
The resulting type after applying the
* operator.Source§impl Mul<ElementsFlattenedLength> for SemanticLength
impl Mul<ElementsFlattenedLength> for SemanticLength
Source§fn mul(self, rhs: ElementsFlattenedLength) -> Self::Output
fn mul(self, rhs: ElementsFlattenedLength) -> Self::Output
Computes the flattened length by multiplying the semantic length by the elements flattened length.
Source§type Output = FlattenedLength
type Output = FlattenedLength
The resulting type after applying the
* operator.Source§impl Mul<SemanticLength> for ElementTypesLength
impl Mul<SemanticLength> for ElementTypesLength
Source§fn mul(self, rhs: SemanticLength) -> Self::Output
fn mul(self, rhs: SemanticLength) -> Self::Output
Computes the semi-flattened length by multiplying the semantic length by the element types length.
Source§type Output = SemiFlattenedLength
type Output = SemiFlattenedLength
The resulting type after applying the
* operator.Source§impl Mul<SemanticLength> for ElementsFlattenedLength
impl Mul<SemanticLength> for ElementsFlattenedLength
Source§fn mul(self, rhs: SemanticLength) -> Self::Output
fn mul(self, rhs: SemanticLength) -> Self::Output
Computes the flattened length by multiplying the semantic length by the elements flattened length.
Source§type Output = FlattenedLength
type Output = FlattenedLength
The resulting type after applying the
* operator.Source§impl Ord for SemanticLength
impl Ord for SemanticLength
Source§fn cmp(&self, other: &SemanticLength) -> Ordering
fn cmp(&self, other: &SemanticLength) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SemanticLength
impl PartialEq for SemanticLength
Source§impl PartialOrd for SemanticLength
impl PartialOrd for SemanticLength
Source§impl Serialize for SemanticLength
impl Serialize for SemanticLength
impl Copy for SemanticLength
impl Eq for SemanticLength
impl StructuralPartialEq for SemanticLength
Auto Trait Implementations§
impl Freeze for SemanticLength
impl RefUnwindSafe for SemanticLength
impl Send for SemanticLength
impl Sync for SemanticLength
impl Unpin for SemanticLength
impl UnwindSafe for SemanticLength
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more