pyo3::types::bytes

Trait PyBytesMethods

Source
pub trait PyBytesMethods<'py>: Sealed {
    // Required method
    fn as_bytes(&self) -> &[u8] ;
}
Expand description

Implementation of functionality for PyBytes.

These methods are defined for the Bound<'py, PyBytes> smart pointer, so to use method call syntax these methods are separated into a trait, because stable Rust does not yet support arbitrary_self_types.

Required Methods§

Source

fn as_bytes(&self) -> &[u8]

Gets the Python string as a byte slice.

Implementors§

Source§

impl<'py> PyBytesMethods<'py> for Bound<'py, PyBytes>

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here