Skip to main content

register_rust_extractor_factory

Function register_rust_extractor_factory 

Source
pub fn register_rust_extractor_factory(
    type_name: &str,
    factory: Box<dyn Fn() -> PyExtractor + Send + Sync>,
) -> Result<(), Error>
Expand description

Registers a factory that produces a PyExtractor for the given type name. Crates (e.g. persistence) call this at load time for each Rust custom data type. When register_custom_data_class(cls) is called with that type’s class, the factory is invoked and the extractor is registered in the main PyExtractor registry.

§Errors

Returns an error if the type name is already registered.