o
    Rh                     @  s   d Z ddlmZ ddlmZ ddlmZmZmZ zddl	m
Z
 W n ey/   ddlm
Z
 Y nw er<ddlmZmZmZ eZe
dedZG d	d
 d
ee ZG dd dee ZdS )z>
Type-annotation related support for the referencing library.
    )annotations)Mapping)TYPE_CHECKINGAnyProtocol)TypeVar)ResolvedResolverResourceD)defaultc                   @  s   e Zd ZdZd	ddZdS )
Retrievez
    A retrieval callable, usable within a `Registry` for resource retrieval.

    Does not make assumptions about where the resource might be coming from.
    uriURIreturnResource[D]c                 C     dS )z
        Retrieve the resource with the given URI.

        Raise `referencing.exceptions.NoSuchResource` if you wish to indicate
        the retriever cannot lookup the given URI.
        N )selfr   r   r   T/home/air/sanwanet/backup_V2/venv/lib/python3.10/site-packages/referencing/typing.py__call__    s   zRetrieve.__call__N)r   r   r   r   )__name__
__module____qualname____doc__r   r   r   r   r   r      s    r   c                   @  s(   e Zd ZdZedddZdd	d
ZdS )Anchorz
    An anchor within a `Resource`.

    Beyond "simple" anchors, some specifications like JSON Schema's 2020
    version have dynamic anchors.
    r   strc                 C  r   )z1
        Return the name of this anchor.
        Nr   )r   r   r   r   name2   s   zAnchor.nameresolverResolver[D]Resolved[D]c                 C  r   )z6
        Return the resource for this anchor.
        Nr   )r   r   r   r   r   resolve9   s   zAnchor.resolveN)r   r   )r   r   r   r    )r   r   r   r   propertyr   r!   r   r   r   r   r   *   s
    r   N)r   
__future__r   collections.abcr   typingr   r   r   typing_extensionsr   ImportErrorreferencing._corer   r	   r
   r   r   r   r   r   r   r   r   r   <module>   s    