DefinitionsMapper

class dsviper.DefinitionsMapper(source_definitions, target_definitions)

Bases: object

Rewrites a Type, a Value or an Attachment of source_definitions into the matching declaration of target_definitions, matched by name.

A type the target does not declare has no image, so the caller has to guarantee the two registries agree - which is why this is not part of the supported surface.

attachment(attachment: Attachment) → Attachment

Return the mapped attachment.

source() → DefinitionsConst

Return the source.

target() → DefinitionsConst

Return the target.

type(type: Type) → Type

Return the mapped type.

value(value: Value) → Value

Return the mapped value.