Function gcore::msg::reply_push_input

source ·
pub fn reply_push_input(offset: u32, len: u32) -> Result<()>
Expand description

Same as reply_push but uses the input buffer as a payload source.

The first and second arguments are the offset and length of the input buffer’s piece that is to be pushed back to the output.

§Examples

Send half of the incoming payload back to the sender as a reply.

use gcore::msg;

#[no_mangle]
extern "C" fn handle() {
    msg::reply_push_input(0, msg::size() as u32 / 2).expect("Unable to push");
    msg::reply_commit(0).expect("Unable to commit");
}

§See also

  • send_push_input function allows using the input buffer as a payload source for an outcoming message.