U
    g                     @  sR   d dl mZ d dlmZmZ d dlmZ d dlmZ edZ	G dd dedZ
d	S )
    )annotations)ABCMetaabstractmethod)TracebackType)TypeVarTc                   @  sJ   e Zd ZdZdZdddddZddd	d
dddZed
dddZdS )AsyncResourcez
    Abstract base class for all closeable asynchronous resources.

    Works as an asynchronous context manager which returns the instance itself on enter,
    and calls :meth:`aclose` on exit.
     r   )selfreturnc                   s   | S Nr	   r
   r	   r	   8/tmp/pip-unpacked-wheel-3u0cc9gf/anyio/abc/_resources.py
__aenter__   s    zAsyncResource.__aenter__ztype[BaseException] | NonezBaseException | NonezTracebackType | NoneNone)exc_typeexc_valexc_tbr   c                   s   |   I d H  d S r   )aclose)r
   r   r   r   r	   r	   r   	__aexit__   s    zAsyncResource.__aexit__)r   c                   s   dS )zClose the resource.Nr	   r   r	   r	   r   r      s    zAsyncResource.acloseN)	__name__
__module____qualname____doc__	__slots__r   r   r   r   r	   r	   r	   r   r   
   s   r   )	metaclassN)
__future__r   abcr   r   typesr   typingr   r   r   r	   r	   r	   r   <module>   s
   