
    ,h                    P   d dl mZ d dlmZ d dlmZ d dlmZmZm	Z	m
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ  e	d      Z e	dd      Z e	dd      Z G d dee   ee      Z G d dee   ee      Z G d dee   ee         Z G d dee         Z G d dee         Z G d dee   ee   ee         Z G d dee      Z G d d ee      Z G d! d"ee      Ze
ee   ef   Z e
ee   ef   Z!e
ee   ef   Z"e
ee   ef   Z#e
ee   ef   Z$e
ee   ef   Z% G d# d$ee   ee      Z&y%)&    )annotations)abstractmethod)Callable)AnyGenericTypeVarUnion   )EndOfStream)TypedAttributeProvider   )AsyncResource)	TaskGroupT_ItemT_coT)	covariantT_contra)contravariantc                  2    e Zd ZdZddZddZedd       Zy)UnreliableObjectReceiveStreama3  
    An interface for receiving objects.

    This interface makes no guarantees that the received messages arrive in the order in
    which they were sent, or that no messages are missed.

    Asynchronously iterating over objects of this type will yield objects matching the
    given type parameter.
    c                    | S N selfs    T/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/anyio/abc/_streams.py	__aiter__z'UnreliableObjectReceiveStream.__aiter__           c                f   K   	 | j                          d {   S 7 # t        $ r t        w xY wwr   receiver   StopAsyncIterationr   s    r   	__anext__z'UnreliableObjectReceiveStream.__anext__!   1     	%''' 	%$$	%    1  1 .1c                   K   yw)aa  
        Receive the next item.

        :raises ~anyio.ClosedResourceError: if the receive stream has been explicitly
            closed
        :raises ~anyio.EndOfStream: if this stream has been closed from the other end
        :raises ~anyio.BrokenResourceError: if this stream has been rendered unusable
            due to external causes
        Nr   r   s    r   r"   z%UnreliableObjectReceiveStream.receive'           N)returnz#UnreliableObjectReceiveStream[T_co])r*   r   __name__
__module____qualname____doc__r   r$   r   r"   r   r   r   r   r      s%    % 	 	r   r   c                  "    e Zd ZdZedd       Zy)UnreliableObjectSendStreamz
    An interface for sending objects.

    This interface makes no guarantees that the messages sent will reach the
    recipient(s) in the same order in which they were sent, or at all.
    c                   K   yw)a4  
        Send an item to the peer(s).

        :param item: the item to send
        :raises ~anyio.ClosedResourceError: if the send stream has been explicitly
            closed
        :raises ~anyio.BrokenResourceError: if this stream has been rendered unusable
            due to external causes
        Nr   r   items     r   sendzUnreliableObjectSendStream.send>   r(   r)   N)r4   r   r*   Noner,   r-   r.   r/   r   r5   r   r   r   r1   r1   4   s     	 	r   r1   c                      e Zd ZdZy)UnreliableObjectStreamzs
    A bidirectional message stream which does not guarantee the order or reliability of
    message delivery.
    Nr,   r-   r.   r/   r   r   r   r9   r9   K   s    r   r9   c                      e Zd ZdZy)ObjectReceiveStreamz
    A receive message stream which guarantees that messages are received in the same
    order in which they were sent, and that no messages are missed.
    Nr:   r   r   r   r<   r<   T       r   r<   c                      e Zd ZdZy)ObjectSendStreamz
    A send message stream which guarantees that messages are delivered in the same order
    in which they were sent, without missing any messages in the middle.
    Nr:   r   r   r   r?   r?   [   r=   r   r?   c                  "    e Zd ZdZedd       Zy)ObjectStreamzl
    A bidirectional message stream which guarantees the order and reliability of message
    delivery.
    c                   K   ywz
        Send an end-of-file indication to the peer.

        You should not try to send any further data to this stream after calling this
        method. This method is idempotent (does nothing on successive calls).
        Nr   r   s    r   send_eofzObjectStream.send_eofl   r(   r)   Nr*   r6   r,   r-   r.   r/   r   rD   r   r   r   rA   rA   b   s    

  r   rA   c                  4    e Zd ZdZddZddZedd	d       Zy)
ByteReceiveStreamz
    An interface for receiving bytes from a single peer.

    Iterating this byte stream will yield a byte string of arbitrary length, but no more
    than 65536 bytes.
    c                    | S r   r   r   s    r   r   zByteReceiveStream.__aiter__~   r   r   c                f   K   	 | j                          d {   S 7 # t        $ r t        w xY wwr   r!   r   s    r   r$   zByteReceiveStream.__anext__   r%   r&   c                   K   yw)a  
        Receive at most ``max_bytes`` bytes from the peer.

        .. note:: Implementers of this interface should not return an empty
            :class:`bytes` object, and users should ignore them.

        :param max_bytes: maximum number of bytes to receive
        :return: the received bytes
        :raises ~anyio.EndOfStream: if this stream has been closed from the other end
        Nr   )r   	max_bytess     r   r"   zByteReceiveStream.receive   r(   r)   N)r*   rH   )r*   bytes)i   )rL   intr*   rM   r+   r   r   r   rH   rH   v   s%    % 
 
r   rH   c                  "    e Zd ZdZedd       Zy)ByteSendStreamz0An interface for sending bytes to a single peer.c                   K   yw)z[
        Send the given bytes to the peer.

        :param item: the bytes to send
        Nr   r3   s     r   r5   zByteSendStream.send   r(   r)   N)r4   rM   r*   r6   r7   r   r   r   rP   rP      s    : r   rP   c                  "    e Zd ZdZedd       Zy)
ByteStreamzA bidirectional byte stream.c                   K   ywrC   r   r   s    r   rD   zByteStream.send_eof   r(   r)   NrE   rF   r   r   r   rS   rS      s    & r   rS   c                  0    e Zd ZdZe	 d	 	 	 	 	 dd       Zy)ListenerzBAn interface for objects that let you accept incoming connections.Nc                   K   yw)af  
        Accept incoming connections as they come in and start tasks to handle them.

        :param handler: a callable that will be used to handle each accepted connection
        :param task_group: the task group that will be used to start tasks for handling
            each accepted connection (if omitted, an ad-hoc task group will be created)
        Nr   )r   handler
task_groups      r   servezListener.serve   r(   r)   r   )rX   zCallable[[T_co], Any]rY   zTaskGroup | Noner*   r6   )r,   r-   r.   r/   r   rZ   r   r   r   rV   rV      s2    LMQ	,	:J			 	r   rV   N)'
__future__r   abcr   collections.abcr   typingr   r   r   r	   _core._exceptionsr   _core._typedattrr   
_resourcesr   _tasksr   r   r   r   r   r1   r9   r<   r?   rA   rH   rP   rS   rM   AnyUnreliableByteReceiveStreamAnyUnreliableByteSendStreamAnyUnreliableByteStreamAnyByteReceiveStreamAnyByteSendStreamAnyByteStreamrV   r   r   r   <module>ri      s   "  $ / / + 5 % 		v&:T2 DM="8 FH}&<.!&)+Ef+M7= 1(; V6"('= >	]$: 	
"N 
 "'!%(*;;"  $$>u$E~$UV  6u =z IJ 079JJK *51>AB l5):56wt}m-C r   