Module glean_ffi::upload::upload_result [−][src]
Result values of attempted ping uploads encoded for FFI use.
These are exposed as C define
s, e.g.:
#define UPLOAD_RESULT_RECOVERABLE 1
#define UPLOAD_RESULT_UNRECOVERABLE 2
#define UPLOAD_RESULT_HTTP_STATUS 0x8000
The language binding needs to replicate these constants exactly.
The HTTP_STATUS
result can carry additional data (the HTTP response code).
This is encoded in the lower bits.
The FFI layer can convert from a 32-bit integer (u32
) representing the upload result (and
associated HTTP response code) into the Glean-compatible UploadResult
type.
These are defined in glean-core/src/upload/result.rs
,
but for cbindgen to also export them in header files we need to define them here as constants.
Inline tests ensure they match across crates.
Constants
UPLOAD_RESULT_HTTP_STATUS | A HTTP response code. |
UPLOAD_RESULT_RECOVERABLE | A recoverable error. |
UPLOAD_RESULT_UNRECOVERABLE | An unrecoverable error. |