Function gcore::msg::send_push_input

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

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

The first argument is the message handle MessageHandle that specifies a particular message built in parts. The second and third 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.

use gcore::msg;

#[no_mangle]
extern "C" fn handle() {
    let msg_handle = msg::send_init().expect("Unable to init");
    msg::send_push_input(msg_handle, 0, msg::size() as u32 / 2).expect("Unable to push");
    msg::send_commit(msg_handle, msg::source(), 0).expect("Unable to commit");
}

/// # See also

  • reply_push_input function allows using the input buffer as a payload source for a reply message.