pub unsafe fn from_ptr(py: Python<'_>, ptr: *const u8, len: usize) -> &PyBytes {
        py.from_owned_ptr(ffi::PyBytes_FromStringAndSize(
            ptr as *const _,
            len as isize,
        ))
    }
/// Creates a new Python byte string object from a raw pointer and length.
///
/// Panics if out of memory.
///
/// # Safety
///
/// This function dereferences the raw pointer `ptr` as the
/// leading pointer of a slice of length `len`. [As with
/// `std::slice::from_raw_parts`, this is
/// unsafe](https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html#safety).
Creates a new Python byte string object from a raw pointer and length.
Panics if out of memory.
Creates a new Python byte string object from a raw pointer and length . Panics if out of memory .
pub unsafe fn from_ptr(py: Python<'_>, ptr: *const u8, len: usize) -> &PyBytes {
        py.from_owned_ptr(ffi::PyBytes_FromStringAndSize(
            ptr as *const _,
            len as isize,
        ))
    }
pub unsafe fn from_ptr ( py : Python < ' _ > , ptr : * const u8 , len : usize ) -> & PyBytes { py . from_owned_ptr ( ffi :: PyBytes_FromStringAndSize ( ptr as * const _ , len as isize , ) ) }
Creates a new Python byte string object from a raw pointer and length.
Creates a new Python byte string object from a raw pointer and length .
py
Python<'_>
ptr
*const u8
len
usize
safety
This function dereferences the raw pointer `ptr` as the
leading pointer of a slice of length `len`. [As with
`std::slice::from_raw_parts`, this is
unsafe].
This function dereferences the raw pointer ` ptr ` as the leading pointer of a slice of length ` len ` . [ As with ` std :: slice :: from_raw_parts ` this is unsafe ] .