7 unstable releases (3 breaking)

0.6.0 Jun 12, 2024
0.4.1 Jan 24, 2024
0.3.3 Dec 18, 2023
0.3.1 Jun 5, 2023
0.2.0 Apr 24, 2023

#1515 in Procedural macros

Download history 91/week @ 2024-06-20 40/week @ 2024-06-27 21/week @ 2024-07-11 18/week @ 2024-07-18 39/week @ 2024-07-25 64/week @ 2024-08-01 15/week @ 2024-08-08 1/week @ 2024-08-22 10/week @ 2024-08-29 19/week @ 2024-09-05 36/week @ 2024-09-12 21/week @ 2024-09-19 17/week @ 2024-09-26 7/week @ 2024-10-03

90 downloads per month
Used in a653rs

MIT/Apache

68KB
1.5K SLoC

a653rs Latest Version a653rs a653rs_macros Zenodo

Required Services https://www.aviation-ia.com/support-files/arinc653h

Extended Services https://www.aviation-ia.com/support-files/arinc653p2h

Position of a653rs

a653rs is supposed to be used as a dependency by the Hypervisor-Wrapper-Library, partitions and processes.

A potential Hypervisor-Wrapper-Library would use introduced Apex traits for providing functionality expected of an ARINC653 compliant hypervisor.

Downstream partitions and processes written in Rust would use a653rs in combination with any Hypervisor-Wrapper-Library implementing a653rs for gaining safe abstracted Apex structures for using Apex functionalities.

For both cases preludes were defined offering all required structs, traits and type-aliases.

  • bindings: for the Hypervisor-Wrapper-Library
  • prelude: for downstream users (partitions and processes)

Design Decisions

This crate offers multiple traits, targeted towards specific functionalities defined in the ARINC653 standard.

  • ApexBlackboardP1
  • ApexBufferP1
  • ApexErrorP1/P4
  • ...

These traits require the implementer to implement static functions which are closely related to the functions defined in the ARINC653 standard (see header file in Required Services). Most likely the implementation of these functions is just a bindgen to underlying c-functions of the hypervisor

The separation of these static functions into specific traits was done because this way hypervisors with limited capabilities can at least offer a limited set instead of none.

While the required functions are closely related to the functions defined in the ARINC653 standard they are not identical. None of the functions in the standard return any value. Instead, references are passed into them, which are mutated during the function call. While our functions could have used the same structure we opted for a more Rust-like function style, in which we at least return a Result with an expected Ok-type in the ReturnCode NoError-case and a ErrorReturnCode as the Err-type in all other cases.

ErrorReturnCode is just the ARINC653 specific ReturnCode enum type without the NoError-variant.

Unsafe Functions

While it is expected that the implementing Hypervisor-Wrapper-Library will need to use a bunch of unsafe code blocks and functions, only one type of function in our traits is explicitly marked as unsafe: functions taking a mutable reference as an argument. Mutable references are only passed to read/receive functions, which take mutable references to ApexByte-slices. Since it is exceptionally unsafe should the user provide a mutable slice which is too small, this function is marked as unsafe.

Because of this we generally provide two functions within our abstractions. One safe-function which checks that the mutable slice provided by the user can at least hold the defined max-message-size and one unsafe-function which just hopes that the read/received message is not longer than what the user expected.

Decisions towards Downstream User (Partitions and Processes)

TODO

TODOS

  • Write Readme
  • Write RustDoc

Licensing Information

The ARINC 653 standard belongs to the Aeronautical Radio, Incorporated (ARINC).

For this library the copyright belongs to the German Aerospace Center / Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR):

Copyright © 2023 Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)

Dependencies

~1.5–2.1MB
~40K SLoC