Skip to content

Commit

Permalink
Document trait sealing
Browse files Browse the repository at this point in the history
  • Loading branch information
kupiakos committed Feb 2, 2022
1 parent 3c87aa4 commit cb128cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions platform/src/command_return.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ mod sealed {
}

/// Output from a successful `command` syscall.
///
/// This trait is [sealed], meaning foreign implementations cannot be defined,
/// even though it can be referenced by foreign crates.
///
/// [sealed]: https://rust-lang.github.io/api-guidelines/future-proofing.html#sealed-traits-protect-against-downstream-implementations-c-sealed
pub trait SuccessData: sealed::Sealed {
/// The return variant for this success type, stored in `r0` after
/// performing a `command` syscall.
Expand Down Expand Up @@ -316,6 +321,11 @@ impl SuccessData for (u32, u32, u32) {
}

/// Output from a failed `command` syscall.
///
/// This trait is [sealed], meaning foreign implementations cannot be defined,
/// even though it can be referenced by foreign crates.
///
/// [sealed]: https://rust-lang.github.io/api-guidelines/future-proofing.html#sealed-traits-protect-against-downstream-implementations-c-sealed
pub unsafe trait FailureData: sealed::Sealed {
/// The return variant for this failure type, stored in `r0` after
/// performing a `command` syscall.
Expand Down

0 comments on commit cb128cb

Please sign in to comment.