o
    Vh                     @  sr   d Z ddlmZ ddlmZ ddlmZmZmZ er ddl	m	Z	 G dd dZ
G dd	 d	e
ZG d
d de
ZdS )zb
The cache object API for implementing caches. The default is a thread
safe in-memory dictionary.
    )annotations)Lock)IOTYPE_CHECKINGMutableMapping)datetimec                   @  s8   e Zd ZdddZ	ddddZdddZdddZdS )	BaseCachekeystrreturnbytes | Nonec                 C     t  NNotImplementedErrorselfr	    r   f/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/cachecontrol/cache.pyget      zBaseCache.getNvaluebytesexpiresint | datetime | NoneNonec                 C  r   r   r   r   r	   r   r   r   r   r   set   s   zBaseCache.setc                 C  r   r   r   r   r   r   r   delete   r   zBaseCache.deletec                 C  s   d S r   r   )r   r   r   r   close   s   zBaseCache.closer	   r
   r   r   r   r	   r
   r   r   r   r   r   r   r	   r
   r   r   )r   r   )__name__
__module____qualname__r   r   r   r   r   r   r   r   r      s    

r   c                   @  s:   e Zd ZddddZdddZ	ddddZdddZdS )	DictCacheN	init_dict!MutableMapping[str, bytes] | Noner   r   c                 C  s   t  | _|pi | _d S r   )r   lockdata)r   r'   r   r   r   __init__$   s   zDictCache.__init__r	   r
   r   c                 C  s   | j |d S r   )r*   r   r   r   r   r   r   (   s   zDictCache.getr   r   r   r   c                 C  s<   | j  | j||i W d    d S 1 sw   Y  d S r   )r)   r*   updater   r   r   r   r   +   s   "zDictCache.setc                 C  sR   | j  || jv r| j| W d    d S W d    d S 1 s"w   Y  d S r   )r)   r*   popr   r   r   r   r   1   s   
"zDictCache.deleter   )r'   r(   r   r   r    r!   r"   )r#   r$   r%   r+   r   r   r   r   r   r   r   r&   #   s    
r&   c                   @  s$   e Zd ZdZddd	ZdddZdS )SeparateBodyBaseCacheag  
    In this variant, the body is not stored mixed in with the metadata, but is
    passed in (as a bytes-like object) in a separate call to ``set_body()``.

    That is, the expected interaction pattern is::

        cache.set(key, serialized_metadata)
        cache.set_body(key)

    Similarly, the body should be loaded separately via ``get_body()``.
    r	   r
   bodyr   r   r   c                 C  r   r   r   )r   r	   r/   r   r   r   set_bodyD   r   zSeparateBodyBaseCache.set_bodyIO[bytes] | Nonec                 C  r   )z6
        Return the body as file-like object.
        r   r   r   r   r   get_bodyG   s   zSeparateBodyBaseCache.get_bodyN)r	   r
   r/   r   r   r   )r	   r
   r   r1   )r#   r$   r%   __doc__r0   r2   r   r   r   r   r.   7   s    
r.   N)r3   
__future__r   	threadingr   typingr   r   r   r   r   r&   r.   r   r   r   r   <module>   s   