use pyo3::prelude::*;
pub struct PyUsizeView(pub usize);
impl PyUsizeView {
pub fn new(s: &usize) -> Self {
Self(*s)
}
}
impl<'t> FromPyObject<'t> for PyUsizeView {
fn extract(ob: &'t PyAny) -> PyResult<Self> {
Ok(Self(ob.extract()?))
}
}
impl IntoPy<PyObject> for PyUsizeView {
fn into_py(self, py: Python<'_>) -> PyObject {
self.0.into_py(py)
}
}
impl ToPyObject for PyUsizeView {
fn to_object(&self, py: Python<'_>) -> PyObject {
self.0.to_object(py)
}
}