Skip to main content

publish_data

Function publish_data 

Source
pub fn publish_data(sink_name: &CStr, vmo: Vmo) -> NullableHandle
Expand description

Runtimes that have binary data to publish (e.g. coverage) use this interface. The name describes the data sink that will receive this blob of data; the string is not used after this call returns. The caller creates a VMO and passes it in. Each particular data sink has its own conventions about both the format of the data in the VMO and the protocol for when data must be written there. For some sinks, the VMO’s data is used immediately. For other sinks, the caller is expected to have the VMO mapped in and be writing more data there throughout the life of the process, to be analyzed only after the process terminates. Yet others might use an asynchronous shared memory protocol between producer and consumer. The return value is either the null handle or a Zircon handle whose lifetime is used to signal the readiness of the data in the VMO. This handle can be dropped to indicate the data is ready to be consumed. Or the handle can safely be leaked; the data will be ready when the process exits. Note there is no indication of success or failure returned here (though it may be logged). A null handle return value merely indicates there is no way to communicate data readiness before process exit.