MCPcopy Index your code
hub / github.com/RustPython/RustPython / set_prev

Method set_prev

crates/common/src/linked_list.rs:385–392  ·  view source on GitHub ↗
(&mut self, value: Option<NonNull<T>>)

Source from the content-addressed store, hash-verified

383 }
384
385 pub const fn set_prev(&mut self, value: Option<NonNull<T>>) {
386 // SAFETY: prev is the first field in PointersInner, which is #[repr(C)].
387 unsafe {
388 let inner = self.inner.get();
389 let prev = inner as *mut Option<NonNull<T>>;
390 ptr::write(prev, value);
391 }
392 }
393 pub const fn set_next(&mut self, value: Option<NonNull<T>>) {
394 // SAFETY: next is the second field in PointersInner, which is #[repr(C)].
395 unsafe {

Callers 7

push_frontMethod · 0.80
pop_frontMethod · 0.80
removeMethod · 0.80
unlink_weakrefFunction · 0.80
addMethod · 0.80
clearMethod · 0.80

Calls 2

writeFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected