MCPcopy Create free account
hub / github.com/Ray-D-Song/lexe / as_bytes_mut

Method as_bytes_mut

modules/llrt_buffer/src/array_buffer_view.rs:151–155  ·  view source on GitHub ↗

Mutable buffer for the view. # Safety This is only safe if you have a lock on the runtime. Do not pass it directly to other threads.

(&self)

Source from the content-addressed store, hash-verified

149 /// This is only safe if you have a lock on the runtime.
150 /// Do not pass it directly to other threads.
151 pub fn as_bytes_mut(&self) -> Option<&mut [u8]> {
152 self.buffer
153 .as_ref()
154 .map(|b| unsafe { std::slice::from_raw_parts_mut(b.ptr.as_ptr(), b.len) })
155 }
156}

Callers 4

normalize_typeFunction · 0.80
readMethod · 0.80
replace_backslashFunction · 0.80

Calls 1

as_refMethod · 0.80

Tested by

no test coverage detected