| use crate::{RawArray, RawMap, RawMessage, StringView}; |
| // Transcribed from google3/third_party/upb/upb/message/value.h |
| pub union upb_MessageValue { |
| pub float_val: std::ffi::c_float, |
| pub double_val: std::ffi::c_double, |
| // TODO: Replace this `RawMessage` with the const type. |
| pub array_val: Option<RawArray>, |
| pub map_val: Option<RawMap>, |
| pub msg_val: Option<RawMessage>, |
| tagged_msg_val: *const std::ffi::c_void, |
| pub fn zeroed() -> Self { |
| // SAFETY: zero bytes is a valid representation for at least one value in the |
| // union (actually valid for all of them). |
| unsafe { std::mem::zeroed() } |
| pub union upb_MutableMessageValue { |
| pub array: Option<RawArray>, |
| pub msg: Option<RawMessage>, |