From 361574240fff979a76adaccaf9809f21a1f6ab12 Mon Sep 17 00:00:00 2001 From: Rubens Brandao Date: Fri, 24 May 2024 09:50:59 -0300 Subject: Finish the `DataBuffer` implementation --- rust/src/string.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rust/src/string.rs') diff --git a/rust/src/string.rs b/rust/src/string.rs index 936e3033..bfb998d5 100644 --- a/rust/src/string.rs +++ b/rust/src/string.rs @@ -79,6 +79,10 @@ impl BnString { res } + pub(crate) fn as_raw(&self) -> &raw::c_char { + unsafe { &*self.raw } + } + pub fn as_str(&self) -> &str { unsafe { CStr::from_ptr(self.raw).to_str().unwrap() } } -- cgit v1.3.1