PyAnySerde

Trait PyAnySerde 

Source
pub trait PyAnySerde: DynClone {
    // Required methods
    fn append<'py>(
        &mut self,
        buf: &mut [u8],
        offset: usize,
        obj: &Bound<'py, PyAny>,
    ) -> PyResult<usize>;
    fn append_vec<'py>(
        &mut self,
        v: &mut Vec<u8>,
        start_addr: Option<usize>,
        obj: &Bound<'py, PyAny>,
    ) -> PyResult<()>;
    fn retrieve<'py>(
        &mut self,
        py: Python<'py>,
        buf: &[u8],
        offset: usize,
    ) -> PyResult<(Bound<'py, PyAny>, usize)>;

    // Provided methods
    fn append_option<'py>(
        &mut self,
        buf: &mut [u8],
        offset: usize,
        obj_option: &Option<&Bound<'py, PyAny>>,
    ) -> PyResult<usize> { ... }
    fn append_option_vec<'py>(
        &mut self,
        v: &mut Vec<u8>,
        start_addr: Option<usize>,
        obj_option: &Option<&Bound<'py, PyAny>>,
    ) -> PyResult<()> { ... }
    fn retrieve_option<'py>(
        &mut self,
        py: Python<'py>,
        buf: &[u8],
        offset: usize,
    ) -> PyResult<(Option<Bound<'py, PyAny>>, usize)> { ... }
}

Required Methods§

Source

fn append<'py>( &mut self, buf: &mut [u8], offset: usize, obj: &Bound<'py, PyAny>, ) -> PyResult<usize>

Source

fn append_vec<'py>( &mut self, v: &mut Vec<u8>, start_addr: Option<usize>, obj: &Bound<'py, PyAny>, ) -> PyResult<()>

Source

fn retrieve<'py>( &mut self, py: Python<'py>, buf: &[u8], offset: usize, ) -> PyResult<(Bound<'py, PyAny>, usize)>

Provided Methods§

Source

fn append_option<'py>( &mut self, buf: &mut [u8], offset: usize, obj_option: &Option<&Bound<'py, PyAny>>, ) -> PyResult<usize>

Source

fn append_option_vec<'py>( &mut self, v: &mut Vec<u8>, start_addr: Option<usize>, obj_option: &Option<&Bound<'py, PyAny>>, ) -> PyResult<()>

Source

fn retrieve_option<'py>( &mut self, py: Python<'py>, buf: &[u8], offset: usize, ) -> PyResult<(Option<Bound<'py, PyAny>>, usize)>

Trait Implementations§

Source§

impl<'py> FromPyObject<'py> for Box<dyn PyAnySerde>

Source§

fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult<Self>

Extracts Self from the bound smart pointer obj. Read more
Source§

impl<'py, 'a> TryFrom<&'a Bound<'py, PyAnySerdeType>> for Box<dyn PyAnySerde>

Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Bound<'py, PyAnySerdeType>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Py<PyAnySerdeType>> for Box<dyn PyAnySerde>

Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Py<PyAnySerdeType>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a PyAnySerdeType> for Box<dyn PyAnySerde>

Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a PyAnySerdeType) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PyAnySerdeType> for Box<dyn PyAnySerde>

Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn try_from(value: PyAnySerdeType) -> Result<Self, Self::Error>

Performs the conversion.

Implementors§