use super::upb::TextEncodeOptions;
use super::{message_def, upb_reflection, UpbGetMessagePtr, UpbWithReflection};
use crate::__internal::Private;
use crate::WithReflection;
pub trait KernelWithReflection: UpbWithReflection + UpbGetMessagePtr<Msg = Self> {}
impl<T: UpbWithReflection + UpbGetMessagePtr<Msg = T>> KernelWithReflection for T {}
pub fn print_to_text_format<T: WithReflection>(
msg: &T,
single_line: bool,
hide_unknown_fields: bool,
) -> String {
let ptr = msg.get_ptr(Private);
let def = message_def::<T>();
let options = TextEncodeOptions { single_line, skip_unknown: hide_unknown_fields };
unsafe { upb_reflection::text_encode(ptr, def, None, options) }
}