Skip to main content

PyBytesRef

Type Alias PyBytesRef 

Source
pub type PyBytesRef = PyRef<PyBytes>;

Aliased Type§

pub struct PyBytesRef { /* private fields */ }

Methods from Deref<Target = Py<T>>§

Source

pub fn downgrade( &self, callback: Option<PyObjectRef>, vm: &VirtualMachine, ) -> PyResult<PyWeakRef<T>>

Source

pub fn payload(&self) -> &T

Source

pub fn to_base(&self) -> &Py<T::Base>

Converts &Py<T> to &Py<T::Base>.

Source

pub fn upcast_ref<U: PyPayload + StaticType>(&self) -> &Py<U>
where T: StaticType,

Converts &Py<T> to &Py<U> where U is an ancestor type.

Trait Implementations§

Source§

impl AsRef<[u8]> for PyBytesRef

Source§

fn as_ref(&self) -> &[u8] ⓘ

Converts this type into a shared reference of the (usually inferred) input type.