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

Method borrow_mut

src/sharedref.rs:161–163  ·  view source on GitHub ↗

Mutably borrows the wrapped value. Any existing leaked references will be invalidated. # Panics Panics if the value is currently borrowed.

(&self)

Source from the content-addressed store, hash-verified

159 ///
160 /// Panics if the value is currently borrowed.
161 pub fn borrow_mut(&self) -> RefMut<'a, T> {
162 self.try_borrow_mut().expect("already borrowed")
163 }
164
165 /// Mutably borrows the wrapped value, returning an error if the value
166 /// is currently borrowed.

Calls 1

try_borrow_mutMethod · 0.80