diff --git a/xous-rs/src/definitions.rs b/xous-rs/src/definitions.rs index a6022162d..ca66a55f1 100644 --- a/xous-rs/src/definitions.rs +++ b/xous-rs/src/definitions.rs @@ -408,6 +408,34 @@ impl Message { }) } + pub fn new_lend( + id: usize, + buf: MemoryRange, + offset: Option, + valid: Option, + ) -> crate::Message { + Message::Borrow(crate::MemoryMessage { + id, + buf, + offset, + valid, + }) + } + + pub fn new_lend_mut( + id: usize, + buf: MemoryRange, + offset: Option, + valid: Option, + ) -> crate::Message { + Message::MutableBorrow(crate::MemoryMessage { + id, + buf, + offset, + valid, + }) + } + /// Determine whether the specified Message will block pub fn is_blocking(&self) -> bool { match *self {