#[non_exhaustive]pub enum Alignment {
BYTE,
U16,
U32,
U64,
}Expand description
The alignment of a D-Bus type, as a runtime value.
D-Bus values are padded to the alignment of their type, which for the static
writers in this crate is derived from a ty::Marker. Code which works with
types that are only known at runtime needs to pass it explicitly instead.
§Examples
use tokio_dbus::{ty, Alignment};
assert_eq!(Alignment::of::<u8>(), Alignment::BYTE);
assert_eq!(Alignment::of::<ty::Str>(), Alignment::U32);
assert_eq!(Alignment::of::<(u8, u8)>(), Alignment::U64);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BYTE
Alignment of one byte, used by y, g and v.
U16
Alignment of two bytes, used by n and q.
U32
Alignment of four bytes, used by b, i, u, h, s, o and by the
length prefix of an array.
U64
Alignment of eight bytes, used by x, t, d, structs and dict
entries.
Implementations§
Trait Implementations§
impl Copy for Alignment
impl Eq for Alignment
Source§impl Ord for Alignment
impl Ord for Alignment
1.21.0 (const: unstable) · 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 PartialOrd for Alignment
impl PartialOrd for Alignment
impl StructuralPartialEq for Alignment
Auto Trait Implementations§
impl Freeze for Alignment
impl RefUnwindSafe for Alignment
impl Send for Alignment
impl Sync for Alignment
impl Unpin for Alignment
impl UnsafeUnpin for Alignment
impl UnwindSafe for Alignment
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