Function gcore::msg::read

source ·
pub fn read(buffer: &mut [u8]) -> Result<()>
Expand description

Get a payload of the message that is currently being processed.

This function loads the message’s payload into buffer with at least message size (that can be obtained using the size function). Note that part of a buffer can be left untouched by this function, if message payload does not have enough data.

§Examples

use gcore::msg;

#[no_mangle]
extern "C" fn handle() {
    let mut payload = vec![0u8; msg::size()];
    msg::read(&mut payload).expect("Unable to read");
}