Skip to main content

fuchsia_decode_log_messages_to_struct

Function fuchsia_decode_log_messages_to_struct 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn fuchsia_decode_log_messages_to_struct<'a>( msg: *const u8, size: usize, expect_extended_attribution: bool, parser: *mut MessageParser, ) -> LogMessages<'a>
Expand description

§Safety

  • This function is NOT thread-safe. The caller must ensure that it is not called concurrently with the same parser pointer.

Same as for std::slice::from_raw_parts. Summarizing in terms of this API:

  • msg must be valid for reads for size, and it must be properly aligned.
  • msg must point to size consecutive u8 values.
  • The size of the slice must be no larger than isize::MAX, and adding that size to data must not “wrap around” the address space. See the safety documentation of pointer::offset. If identity is provided, it must contain a valid moniker and URL.

The returned LogMessages must be free’d with fuchsia_free_log_messages(log_messages). Free’ing the LogMessages struct frees the bump allocator itself (and everything allocated from it).