MCPcopy Index your code
hub / github.com/PyO3/rust-numpy / readonly

Method readonly

src/array.rs:1010–1016  ·  view source on GitHub ↗

Get an immutable borrow of the NumPy array # Panics Panics if the allocation backing the array is currently mutably borrowed. For a non-panicking variant, use [`try_readonly`][Self::try_readonly].

(&self)

Source from the content-addressed store, hash-verified

1008 ///
1009 /// For a non-panicking variant, use [`try_readonly`][Self::try_readonly].
1010 fn readonly(&self) -> PyReadonlyArray<'py, T, D>
1011 where
1012 T: Element,
1013 D: Dimension,
1014 {
1015 self.try_readonly().unwrap()
1016 }
1017
1018 /// Consume `self` into an mutable borrow of the NumPy array
1019 fn try_into_readwrite(self) -> Result<PyReadwriteArray<'py, T, D>, BorrowError>

Callers 15

initial_shared_borrowFunction · 0.80
additional_shared_borrowFunction · 0.80
extractMethod · 0.80
extractMethod · 0.80
test_debug_formattingFunction · 0.80
borrow_multiple_arraysFunction · 0.80
borrow_multiple_viewsFunction · 0.80
as_arrayFunction · 0.80
as_sliceFunction · 0.80
to_pyarray_object_vecFunction · 0.80

Implementers 1

array.rssrc/array.rs

Calls 1

try_readonlyMethod · 0.80

Tested by 13

test_debug_formattingFunction · 0.64
borrow_multiple_arraysFunction · 0.64
borrow_multiple_viewsFunction · 0.64
as_arrayFunction · 0.64
as_sliceFunction · 0.64
to_pyarray_object_vecFunction · 0.64
to_pyarray_object_arrayFunction · 0.64
multiple_shared_borrowsFunction · 0.64