adaptix.provider package#
Module contents#
- exception adaptix.provider.AggregateCannotProvide(
- message: str,
- exceptions: Sequence[CannotProvide],
- *,
- is_terminal: bool = False,
- is_demonstrative: bool = False,
Bases:
ExceptionGroup
[CannotProvide
],CannotProvide
- derive(
- excs: Sequence[CannotProvide],
- derive_upcasting(
- excs: Sequence[CannotProvide],
Same as method
derive
but allow passing an empty sequence
- classmethod make(
- message: str,
- exceptions: Sequence[CannotProvide],
- *,
- is_terminal: bool = False,
- is_demonstrative: bool = False,
- class adaptix.provider.Mediator#
-
Mediator is an object that gives provider access to other providers and that stores the state of the current search.
Mediator is a proxy to providers of retort.
- abstract provide(
- request: Request[T],
Get response of sent request.
- Parameters:
request – A request instance
- Returns:
Result of the request processing
- Raises:
CannotProvide – A provider able to process the request does not be found
- abstract provide_from_next() V #
Forward current request to providers that placed after current provider at the recipe.
- final delegating_provide(
- request: Request[T],
- error_describer: Callable[[CannotProvide], str] | None = None,
- class adaptix.provider.Provider#
Bases:
ABC
An object that can process Request instances
- abstract apply_provider( ) T #
Handle request instance and return a value of type required by request. Behavior must be the same during the provider object lifetime
- Raises:
CannotProvide – provider cannot process passed request
- class adaptix.provider.Request#
Bases:
Generic
[T
]An object that contains data to be processed by
Provider
.Generic argument indicates which object should be returned after request processing.
Request must always be a hashable object
- class adaptix.provider.Chain(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
Bases:
Enum
- FIRST = 'FIRST'#
- LAST = 'LAST'#