MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / as_str

Method as_str

rust/stringzilla.rs:790–792  ·  view source on GitHub ↗

Returns the current content as a &str. Returns an empty string if the content isn’t valid UTF-8.

(&self)

Source from the content-addressed store, hash-verified

788 /// Returns the current content as a &str.
789 /// Returns an empty string if the content isn’t valid UTF-8.
790 pub fn as_str(&self) -> &str {
791 core::str::from_utf8(&self.buf[..self.len]).unwrap_or("")
792 }
793}
794
795impl<const N: usize> Default for FixedCString<N> {

Callers 3

build_stringzillaFunction · 0.80
large_batch_processingFunction · 0.80
searchFunction · 0.80

Calls

no outgoing calls

Tested by 2

large_batch_processingFunction · 0.64
searchFunction · 0.64