o
    $Th²  ã                   @  sd   d dl mZ d dlZd dlmZmZ d dlmZ G dd„ deje	e
f ƒZG dd„ deƒZdgZdS )	é    )ÚannotationsN)ÚABCÚabstractmethod)ÚTokenc                   @  s   e Zd Zd
dd„Zd	S )ÚContextÚkeyÚstrÚvalueÚobjectÚreturnÚNonec                 C  s   t ‚)N)Ú
ValueError)Úselfr   r	   © r   ú^/home/air/segue/gemini/back/venv/lib/python3.10/site-packages/opentelemetry/context/context.pyÚ__setitem__   s   zContext.__setitem__N)r   r   r	   r
   r   r   )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s    r   c                   @  s:   e Zd ZdZeddd„ƒZeddd	„ƒZeddd„ƒZdS )Ú_RuntimeContextzîThe RuntimeContext interface provides a wrapper for the different
    mechanisms that are used to propagate context in Python.
    Implementations can be made available via entry_points and
    selected through environment variables.
    Úcontextr   r   úToken[Context]c                 C  ó   dS )z°Sets the current `Context` object. Returns a
        token that can be used to reset to the previous `Context`.

        Args:
            context: The Context to set.
        Nr   )r   r   r   r   r   Úattach"   ó    z_RuntimeContext.attachc                 C  r   )z%Returns the current `Context` object.Nr   )r   r   r   r   Úget_current+   r   z_RuntimeContext.get_currentÚtokenr   c                 C  r   )zpResets Context to a previous value

        Args:
            token: A reference to a previous Context.
        Nr   )r   r   r   r   r   Údetach/   r   z_RuntimeContext.detachN)r   r   r   r   )r   r   )r   r   r   r   )r   r   r   Ú__doc__r   r   r   r   r   r   r   r   r      s    r   )Ú
__future__r   ÚtypingÚabcr   r   Úcontextvarsr   ÚDictr   r
   r   r   Ú__all__r   r   r   r   Ú<module>   s   
