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]

[src]

Returns the bits that represent this message

[src]

Returns the bits of this message, but with the order of the 8 label bits reversed.

[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]

[src]

Formats the value using the given formatter.

impl Copy for Message
[src]

impl Clone for Message
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Message
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for Message
[src]

impl PartialOrd for Message
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[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]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl Hash for Message
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Default for Message
[src]

[src]

Returns the "default value" for a type. Read more

impl From<u32> for Message
[src]

[src]

Creates a message from bits as transmitted, with no modifications