summaryrefslogtreecommitdiff
path: root/rust/src/string.rs
diff options
context:
space:
mode:
authorRubens Brandao <git@rubens.io>2024-05-24 09:50:59 -0300
committerMason Reed <mason@vector35.com>2024-07-26 18:38:42 -0400
commit361574240fff979a76adaccaf9809f21a1f6ab12 (patch)
tree2b96055ad6ec2141189d53e219299157fa4e5e87 /rust/src/string.rs
parent031456e41d4b1bc5a185934fb7a0a506618d3a8d (diff)
Finish the `DataBuffer` implementation
Diffstat (limited to 'rust/src/string.rs')
-rw-r--r--rust/src/string.rs4
1 files changed, 4 insertions, 0 deletions
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() }
}