xous: definitions: Message: add has_memory()

This function can be used to determine if a function has any memory
attached to the message.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-09-22 21:24:48 +08:00
parent 6c941855be
commit 81a927e31f

View file

@ -297,6 +297,14 @@ impl Message {
Message::Move(_) | Message::Scalar(_) => false,
}
}
/// Determine whether the specified message has data attached
pub fn has_memory(&self) -> bool {
match *self {
Message::MutableBorrow(_) | Message::Borrow(_) | Message::Move(_) => true,
Message::BlockingScalar(_) | Message::Scalar(_) => false,
}
}
}
#[repr(C)]