Skip to main content

event_with_owned_payload

Function event_with_owned_payload 

pub fn event_with_owned_payload(event_type: &str, payload: Vec<u8>) -> Event
Expand description

Builds an event whose payload is owned rather than 'static.

event_with_payload takes &'static [u8] because every payload the suite had until the value edges landed was a literal. A rule that has to build 65,536 bytes cannot be: the buffer is computed, so it lives on the heap and there is no literal to borrow from. Bytes is not named in the signature — Vec<u8> converts into it — which keeps bytes out of this crate’s manifest for the sake of one parameter.

§Panics

Panics if event_type is invalid. Test-only helper.