xous: definitions: add Display to MemoryType

Useful in debugging and error messages.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2021-03-03 21:16:45 +08:00
parent 506bd381b2
commit 5a0533d6bc

View file

@ -491,6 +491,17 @@ impl From<usize> for MemoryType {
}
}
impl core::fmt::Display for MemoryType {
fn fmt(&self, fmt: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match *self {
MemoryType::Default => write!(fmt, "Default"),
MemoryType::Heap => write!(fmt, "Heap"),
MemoryType::Stack => write!(fmt, "Stack"),
MemoryType::Messages => write!(fmt, "Messages"),
}
}
}
#[repr(C)]
#[derive(Debug, PartialEq)]
pub enum Result {