[−][src]Struct gvariant::aligned_bytes::AlignedOffset
Represents a usize that is some multiple of Alignment::ALIGNMENT
.
AlignedOffset<A2>
is essentially a usize that is multiple of 2. This is
useful because you can slice a AlignedSlice<A2>
and be statically
guaranteed that the slice will still be aligned.
Use .try_new()
, <usize>.try_into()
or align_offset()
to construct
values of this type.
Implementations
impl<A: Alignment> AlignedOffset<A>
[src]
pub fn to_usize(&self) -> usize
[src]
Convert to usize
pub fn try_new(value: usize) -> Result<Self, Misaligned>
[src]
Construct an AlignedOffset
from a usize.
Result will be Err(Misaligned)
if the passed value
is not a multiple
of the alignment of this type. This is provided in addition to the
TryInto
impl because there is less scope for type ambiguity with this
function.
Trait Implementations
impl<A: Alignment> BitOr<AlignedOffset<A>> for AlignedOffset<A>
[src]
type Output = AlignedOffset<A>
The resulting type after applying the |
operator.
fn bitor(self, rhs: Self) -> Self::Output
[src]
impl BitOr<AlignedOffset<A1>> for AlignedOffset<A2>
[src]
type Output = AlignedOffset<A1>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A1>) -> AlignedOffset<A1>
[src]
impl BitOr<AlignedOffset<A1>> for AlignedOffset<A4>
[src]
type Output = AlignedOffset<A1>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A1>) -> AlignedOffset<A1>
[src]
impl BitOr<AlignedOffset<A1>> for AlignedOffset<A8>
[src]
type Output = AlignedOffset<A1>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A1>) -> AlignedOffset<A1>
[src]
impl BitOr<AlignedOffset<A2>> for AlignedOffset<A1>
[src]
type Output = AlignedOffset<A1>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A2>) -> AlignedOffset<A1>
[src]
impl BitOr<AlignedOffset<A2>> for AlignedOffset<A4>
[src]
type Output = AlignedOffset<A2>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A2>) -> AlignedOffset<A2>
[src]
impl BitOr<AlignedOffset<A2>> for AlignedOffset<A8>
[src]
type Output = AlignedOffset<A2>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A2>) -> AlignedOffset<A2>
[src]
impl BitOr<AlignedOffset<A4>> for AlignedOffset<A1>
[src]
type Output = AlignedOffset<A1>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A4>) -> AlignedOffset<A1>
[src]
impl BitOr<AlignedOffset<A4>> for AlignedOffset<A2>
[src]
type Output = AlignedOffset<A2>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A4>) -> AlignedOffset<A2>
[src]
impl BitOr<AlignedOffset<A4>> for AlignedOffset<A8>
[src]
type Output = AlignedOffset<A4>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A4>) -> AlignedOffset<A4>
[src]
impl BitOr<AlignedOffset<A8>> for AlignedOffset<A1>
[src]
type Output = AlignedOffset<A1>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A8>) -> AlignedOffset<A1>
[src]
impl BitOr<AlignedOffset<A8>> for AlignedOffset<A2>
[src]
type Output = AlignedOffset<A2>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A8>) -> AlignedOffset<A2>
[src]
impl BitOr<AlignedOffset<A8>> for AlignedOffset<A4>
[src]
type Output = AlignedOffset<A4>
The resulting type after applying the |
operator.
fn bitor(self, rhs: AlignedOffset<A8>) -> AlignedOffset<A4>
[src]
impl<A: Alignment> Borrow<usize> for AlignedOffset<A>
[src]
impl<A: Clone + Alignment> Clone for AlignedOffset<A> where
Self: BitOr,
Self::Output: Into<Self>,
[src]
Self: BitOr,
Self::Output: Into<Self>,
fn clone(&self) -> AlignedOffset<A>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<A: Copy + Alignment> Copy for AlignedOffset<A> where
Self: BitOr,
Self::Output: Into<Self>,
[src]
Self: BitOr,
Self::Output: Into<Self>,
impl<A: Debug + Alignment> Debug for AlignedOffset<A> where
Self: BitOr,
Self::Output: Into<Self>,
[src]
Self: BitOr,
Self::Output: Into<Self>,
impl<A: Alignment> Display for AlignedOffset<A>
[src]
impl<A: Eq + Alignment> Eq for AlignedOffset<A> where
Self: BitOr,
Self::Output: Into<Self>,
[src]
Self: BitOr,
Self::Output: Into<Self>,
impl<A: Alignment> From<AlignedOffset<A>> for usize
[src]
fn from(value: AlignedOffset<A>) -> Self
[src]
impl From<AlignedOffset<A2>> for AlignedOffset<A1>
[src]
fn from(v: AlignedOffset<A2>) -> Self
[src]
impl From<AlignedOffset<A4>> for AlignedOffset<A1>
[src]
fn from(v: AlignedOffset<A4>) -> Self
[src]
impl From<AlignedOffset<A4>> for AlignedOffset<A2>
[src]
fn from(v: AlignedOffset<A4>) -> Self
[src]
impl From<AlignedOffset<A8>> for AlignedOffset<A1>
[src]
fn from(v: AlignedOffset<A8>) -> Self
[src]
impl From<AlignedOffset<A8>> for AlignedOffset<A2>
[src]
fn from(v: AlignedOffset<A8>) -> Self
[src]
impl From<AlignedOffset<A8>> for AlignedOffset<A4>
[src]
fn from(v: AlignedOffset<A8>) -> Self
[src]
impl<A: Ord + Alignment> Ord for AlignedOffset<A> where
Self: BitOr,
Self::Output: Into<Self>,
[src]
Self: BitOr,
Self::Output: Into<Self>,
fn cmp(&self, other: &AlignedOffset<A>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<A: PartialEq + Alignment> PartialEq<AlignedOffset<A>> for AlignedOffset<A> where
Self: BitOr,
Self::Output: Into<Self>,
[src]
Self: BitOr,
Self::Output: Into<Self>,
fn eq(&self, other: &AlignedOffset<A>) -> bool
[src]
fn ne(&self, other: &AlignedOffset<A>) -> bool
[src]
impl<A: Alignment> PartialEq<AlignedOffset<A>> for usize
[src]
fn eq(&self, other: &AlignedOffset<A>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<A: Alignment> PartialEq<usize> for AlignedOffset<A>
[src]
impl<A: PartialOrd + Alignment> PartialOrd<AlignedOffset<A>> for AlignedOffset<A> where
Self: BitOr,
Self::Output: Into<Self>,
[src]
Self: BitOr,
Self::Output: Into<Self>,
fn partial_cmp(&self, other: &AlignedOffset<A>) -> Option<Ordering>
[src]
fn lt(&self, other: &AlignedOffset<A>) -> bool
[src]
fn le(&self, other: &AlignedOffset<A>) -> bool
[src]
fn gt(&self, other: &AlignedOffset<A>) -> bool
[src]
fn ge(&self, other: &AlignedOffset<A>) -> bool
[src]
impl<A: Alignment> PartialOrd<AlignedOffset<A>> for usize
[src]
fn partial_cmp(&self, other: &AlignedOffset<A>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<A: Alignment> PartialOrd<usize> for AlignedOffset<A>
[src]
fn partial_cmp(&self, other: &usize) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<A: Alignment> StructuralEq for AlignedOffset<A> where
Self: BitOr,
Self::Output: Into<Self>,
[src]
Self: BitOr,
Self::Output: Into<Self>,
impl<A: Alignment> StructuralPartialEq for AlignedOffset<A> where
Self: BitOr,
Self::Output: Into<Self>,
[src]
Self: BitOr,
Self::Output: Into<Self>,
impl<A: Alignment> TryFrom<usize> for AlignedOffset<A>
[src]
Auto Trait Implementations
impl<A> RefUnwindSafe for AlignedOffset<A> where
A: RefUnwindSafe,
A: RefUnwindSafe,
impl<A> Send for AlignedOffset<A> where
A: Send,
A: Send,
impl<A> Sync for AlignedOffset<A> where
A: Sync,
A: Sync,
impl<A> Unpin for AlignedOffset<A> where
A: Unpin,
A: Unpin,
impl<A> UnwindSafe for AlignedOffset<A> where
A: UnwindSafe,
A: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,