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

Method borrow

src/sharedref.rs:141–143  ·  view source on GitHub ↗

Immutably borrows the wrapped value. # Panics Panics if the value is currently mutably borrowed.

(&self)

Source from the content-addressed store, hash-verified

139 ///
140 /// Panics if the value is currently mutably borrowed.
141 pub fn borrow(&self) -> Ref<'a, T> {
142 self.try_borrow().expect("already mutably borrowed")
143 }
144
145 /// Immutably borrows the wrapped value, returning an error if the value
146 /// is currently mutably borrowed.

Callers 4

try_borrow_mutMethod · 0.80

Calls 1

try_borrowMethod · 0.80

Tested by 3