message: Add impl TryFrom<u32> for ErrorCode
  Also a link to TRD 104 in the description of ErrorCode.
diff: -/// An error code returned by the kernel.
  +use core::{convert::TryFrom, fmt, mem::transmute};
  +
  // TODO: Add a ufmt debug implementation for process binaries to use.
  +/// A [TRD 104 error code][error-codes] returned by the kernel.
  +///
  +/// [error-codes]: https://github.com/tock/tock/blob/master/doc/reference/trd104-syscalls.md#33-error-codes
  #[derive(Clone, Copy, Debug, PartialEq, Eq)]
  #[repr(u16)] // To facilitate use with transmute() in CommandReturn
  #[rustfmt::skip]
  @@ -226,3 +230,24 @@ pub enum ErrorCode {
  N01016 = 1016, N01017 = 1017, N01018 = 1018, N01019 = 1019, N01020 = 1020,
  N01021 = 1021, N01022 = 1022, N01023 = 1023,
  }
  +
  +/// The provided value is not a recognized TRD 104 error code.
  +pub struct NotAnErrorCode;
  +
  +impl fmt::Debug for NotAnErrorCode {
  + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  + f.write_str("not an error code")
  + }
  +}
  +
  +impl TryFrom<u32> for ErrorCode {
  + type Error = NotAnErrorCode;
  +
  + fn try_from(value: u32) -> Result<Self, Self::Error> {
  + if (1..=1023).contains(&value) {
  + Ok(unsafe { transmute(value as u16) })
  + } else {
  + Err(NotAnErrorCode)
  + }
  + }
  +}
  