MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / leak_immutable

Method leak_immutable

src/sharedref.rs:186–188  ·  view source on GitHub ↗

Creates an immutable reference which is not bound to lifetime. # Panics Panics if the value is currently mutably borrowed.

(&self)

Source from the content-addressed store, hash-verified

184 ///
185 /// Panics if the value is currently mutably borrowed.
186 pub fn leak_immutable(&self) -> UnsafePyLeaked<&'static T> {
187 self.try_leak_immutable().expect("already mutably borrowed")
188 }
189
190 /// Creates an immutable reference which is not bound to lifetime,
191 /// returning an error if the value is currently mutably borrowed.

Calls 1

try_leak_immutableMethod · 0.80