Struct arinc_429::Message
[−]
[src]
pub struct Message(_);
An ARINC 429 message
The bits of a message are represented exactly as transmitted on the wires, with the least significant bit transmitted first.
The label field is in the 8 least significant bits. Because the most significant digit of the label is transmitted first, the label field is in the reverse of the usual bit order.
The parity bit is the most significant bit.
Conversions
The u32::from(Message)
and Message::from(u32)
From
implementations copy bits with no
changes.
Some ARINC 429 adapters use a different representation, where the bits of the label field are
reversed from their on-wire representation. The methods Message::from_bits_label_swapped()
and
Message::bits_label_swapped()
implement this conversion.
Conversions never panic.
Examples
Create a message
use arinc_429::Message; let message = Message::from(0x10000056); assert_eq!(0x10000056, u32::from(message));
Label bit swapping
use arinc_429::Message; let message = Message::from_bits_label_swapped(0x10000056); assert_eq!(0x1000006a, u32::from(message));
Methods
impl Message
[src]
fn bits(&self) -> u32
[src]
Returns the bits that represent this message
fn bits_label_swapped(&self) -> u32
[src]
Returns the bits of this message, but with the order of the 8 label bits reversed.
fn from_bits_label_swapped(bits: u32) -> Self
[src]
Creates a message from a message representation with the 8 label bits reversed. The returned Msg429 will be represented as transmitted on the wires.
Trait Implementations
impl Debug for Message
[src]
impl Copy for Message
[src]
impl Clone for Message
[src]
fn clone(&self) -> Message
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Message
[src]
fn eq(&self, __arg_0: &Message) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Message) -> bool
[src]
This method tests for !=
.
impl Eq for Message
[src]
impl PartialOrd for Message
[src]
fn partial_cmp(&self, __arg_0: &Message) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Message) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Message) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Message) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Message) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Message
[src]
fn cmp(&self, __arg_0: &Message) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for Message
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more