pub struct FactoryRegistry { /* private fields */ }Expand description
Registry for PyO3 factory and config extractors.
This allows each adapter to register its own extraction logic for converting
Py<PyAny>s to boxed trait objects without requiring the live crate to know
about specific implementations.
Implementations§
Source§impl FactoryRegistry
impl FactoryRegistry
Sourcepub fn register_factory_extractor(
&self,
name: String,
extractor: FactoryExtractor,
) -> Result<()>
pub fn register_factory_extractor( &self, name: String, extractor: FactoryExtractor, ) -> Result<()>
Registers a factory extractor for a specific factory name.
§Errors
Returns an error if a factory with the same name is already registered.
Sourcepub fn register_config_extractor(
&self,
type_name: String,
extractor: ConfigExtractor,
) -> Result<()>
pub fn register_config_extractor( &self, type_name: String, extractor: ConfigExtractor, ) -> Result<()>
Registers a config extractor for a specific config type name.
§Errors
Returns an error if a config with the same type name is already registered.
Sourcepub fn register_exec_factory_extractor(
&self,
name: String,
extractor: ExecutionFactoryExtractor,
) -> Result<()>
pub fn register_exec_factory_extractor( &self, name: String, extractor: ExecutionFactoryExtractor, ) -> Result<()>
Registers an execution factory extractor for a specific factory name.
§Errors
Returns an error if a factory with the same name is already registered.
Sourcepub fn register_sim_exec_factory_extractor(
&self,
name: String,
extractor: SimulatedExecutionFactoryExtractor,
) -> Result<()>
pub fn register_sim_exec_factory_extractor( &self, name: String, extractor: SimulatedExecutionFactoryExtractor, ) -> Result<()>
Registers a simulated execution factory extractor for a specific factory name.
§Errors
Returns an error if a factory with the same name is already registered.
Sourcepub fn extract_factory(
&self,
py: Python<'_>,
factory: Py<PyAny>,
) -> PyResult<Box<dyn DataClientFactory>>
pub fn extract_factory( &self, py: Python<'_>, factory: Py<PyAny>, ) -> PyResult<Box<dyn DataClientFactory>>
Extracts a Py<PyAny> factory to a boxed DataClientFactory trait object.
§Errors
Returns an error if no extractor is registered for the factory type or extraction fails.
Sourcepub fn extract_exec_factory(
&self,
py: Python<'_>,
factory: Py<PyAny>,
) -> PyResult<Box<dyn ExecutionClientFactory>>
pub fn extract_exec_factory( &self, py: Python<'_>, factory: Py<PyAny>, ) -> PyResult<Box<dyn ExecutionClientFactory>>
Extracts a Py<PyAny> factory to a boxed ExecutionClientFactory trait object.
§Errors
Returns an error if no extractor is registered for the factory type or extraction fails.
Sourcepub fn extract_sim_exec_factory(
&self,
py: Python<'_>,
factory: Py<PyAny>,
) -> PyResult<Box<dyn SimulatedExecutionClientFactory>>
pub fn extract_sim_exec_factory( &self, py: Python<'_>, factory: Py<PyAny>, ) -> PyResult<Box<dyn SimulatedExecutionClientFactory>>
Extracts a Py<PyAny> factory to a boxed SimulatedExecutionClientFactory trait object.
§Errors
Returns an error if no extractor is registered for the factory type or extraction fails.
Sourcepub fn extract_config(
&self,
py: Python<'_>,
config: Py<PyAny>,
) -> PyResult<Box<dyn ClientConfig>>
pub fn extract_config( &self, py: Python<'_>, config: Py<PyAny>, ) -> PyResult<Box<dyn ClientConfig>>
Extracts a Py<PyAny> config to a boxed ClientConfig trait object.
§Errors
Returns an error if no extractor is registered for the config type or extraction fails.
Trait Implementations§
Source§impl Debug for FactoryRegistry
impl Debug for FactoryRegistry
Auto Trait Implementations§
impl !Freeze for FactoryRegistry
impl !RefUnwindSafe for FactoryRegistry
impl Send for FactoryRegistry
impl Sync for FactoryRegistry
impl Unpin for FactoryRegistry
impl UnsafeUnpin for FactoryRegistry
impl UnwindSafe for FactoryRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more