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

Method is_c_contiguous

src/buffer.rs:289–297  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

287 /// Gets whether the buffer is contiguous in C-style order (last index varies fastest when visiting items in order of memory address).
288 #[inline]
289 pub fn is_c_contiguous(&self) -> bool {
290 unsafe {
291 // Python 2.7 is not const-correct, so we need the cast to *mut
292 ffi::PyBuffer_IsContiguous(
293 &*self.0 as *const ffi::Py_buffer as *mut ffi::Py_buffer,
294 b'C' as libc::c_char,
295 ) != 0
296 }
297 }
298
299 /// Gets whether the buffer is contiguous in Fortran-style order (first index varies fastest when visiting items in order of memory address).
300 #[inline]

Callers 2

as_sliceMethod · 0.80
as_mut_sliceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected