Trait numcodecs_python::PyCodecClassMethods

source ·
pub trait PyCodecClassMethods<'py>: Sealed {
    // Required methods
    fn codec_id(&self) -> Result<String, PyErr>;
    fn codec_from_config(
        &self,
        config: Borrowed<'_, 'py, PyDict>,
    ) -> Result<Bound<'py, PyCodec>, PyErr>;
    fn as_type(&self) -> &Bound<'py, PyType>;
}
Expand description

Methods implemented for PyCodecClasses.

Required Methods§

source

fn codec_id(&self) -> Result<String, PyErr>

Gets the codec identifier.

§Errors

Errors if the codec does not provide an identifier.

source

fn codec_from_config( &self, config: Borrowed<'_, 'py, PyDict>, ) -> Result<Bound<'py, PyCodec>, PyErr>

Instantiate a codec from a configuration dictionary.

The config dict must not contain an id field.

§Errors

Errors if constructing the codec fails.

source

fn as_type(&self) -> &Bound<'py, PyType>

Gets the PyType that this PyCodecClass represents.

Implementations on Foreign Types§

source§

impl<'py> PyCodecClassMethods<'py> for Bound<'py, PyCodecClass>

source§

fn codec_id(&self) -> Result<String, PyErr>

source§

fn codec_from_config( &self, config: Borrowed<'_, 'py, PyDict>, ) -> Result<Bound<'py, PyCodec>, PyErr>

source§

fn as_type(&self) -> &Bound<'py, PyType>

Implementors§