From 53eed1fedbef8c778ba1ea03d6660a7f097886ca Mon Sep 17 00:00:00 2001 From: Rubens Brandao Date: Mon, 27 May 2024 17:45:25 -0300 Subject: allow `load_with_option` to accept json options --- rust/src/string.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rust/src/string.rs') diff --git a/rust/src/string.rs b/rust/src/string.rs index f4098d66..936e3033 100644 --- a/rust/src/string.rs +++ b/rust/src/string.rs @@ -246,3 +246,15 @@ unsafe impl BnStrCompatible for &QualifiedName { self.string().into_bytes_with_nul() } } + +pub trait IntoJson { + type Output: BnStrCompatible; + fn get_json_string(self) -> Result; +} + +impl IntoJson for S { + type Output = S; + fn get_json_string(self) -> Result { + Ok(self) + } +} -- cgit v1.3.1