File: //usr/lib/python3/dist-packages/twisted/internet/__pycache__/interfaces.cpython-38.pyc
U
W[y � @ s\ d Z ddlmZmZ ddlmZmZ G dd� de�ZG dd� de�ZG dd � d e�Z G d
d� de�Z
G dd
� d
e�ZG dd� de�ZG dd� de �Z
G dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG d d!� d!e�ZG d"d#� d#e�ZG d$d%� d%e�ZG d&d'� d'e�ZG d(d)� d)e�ZG d*d+� d+e�ZG d,d-� d-ee�ZG d.d/� d/e�ZG d0d1� d1e�ZG d2d3� d3e�ZG d4d5� d5e�ZG d6d7� d7e�Z G d8d9� d9e�Z!G d:d;� d;e�Z"G d<d=� d=e"�Z#G d>d?� d?e#�Z$G d@dA� dAe#�Z%G dBdC� dCe$e%�Z&G dDdE� dEe�Z'G dFdG� dGe�Z(G dHdI� dIe�Z)G dJdK� dKe�Z*G dLdM� dMe*�Z+G dNdO� dOe*�Z,G dPdQ� dQe�Z-G dRdS� dSe�Z.G dTdU� dUe�Z/G dVdW� dWe�Z0G dXdY� dYe�Z1G dZd[� d[e�Z2G d\d]� d]e�Z3G d^d_� d_e3�Z4G d`da� dae3�Z5G dbdc� dce�Z6G ddde� dee�Z7G dfdg� dge�Z8G dhdi� die�Z9G djdk� dke4�Z:G dldm� dme4�Z;G dndo� doe;�Z<G dpdq� dqe�Z=G drds� dse�Z>G dtdu� due3�Z?G dvdw� dwe�Z@G dxdy� dye�ZAG dzd{� d{e�ZBG d|d}� d}e�ZCG d~d� de�ZDG d�d�� d�e�ZEG d�d�� d�e�ZFG d�d�� d�e�ZGG d�d�� d�e�ZHG d�d�� d�e�ZId�S )�z>
Interface documentation.
Maintainer: Itamar Shtull-Trauring
� )�division�absolute_import)� Interface� Attributec @ s e Zd ZdZdS )�IAddresszr
An address, e.g. a TCP C{(host, port)}.
Default implementations are in L{twisted.internet.address}.
N��__name__�
__module__�__qualname__�__doc__� r r �=/usr/lib/python3/dist-packages/twisted/internet/interfaces.pyr s r c @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
S )�
IConnectorzu
Object used to interface between connections and protocols.
Each L{IConnector} manages one connection.
c C s dS )z-
Stop attempting to connect.
Nr r r r r
�stopConnecting s zIConnector.stopConnectingc C s dS )z�
Disconnect regardless of the connection state.
If we are connected, disconnect, if we are trying to connect,
stop trying.
Nr r r r r
�
disconnect$ s zIConnector.disconnectc C s dS )z3
Try to connect to remote address.
Nr r r r r
�connect, s zIConnector.connectc C s dS )zy
Return destination this will try to connect to.
@return: An object which provides L{IAddress}.
Nr r r r r
�getDestination1 s zIConnector.getDestinationN)r r r
r r r r r r r r r
r s
r c @ s e Zd Zddd�ZdS )�IResolverSimple�� � � �- c C s dS )aO
Resolve the domain name C{name} into an IP address.
@type name: C{str}
@param name: DNS name to resolve.
@type timeout: Sequence of C{int}
@param timeout: Number of seconds after which to reissue the query.
When the last timeout expires, the query is considered failed.
@rtype: L{twisted.internet.defer.Deferred}
@return: The callback of the Deferred that is returned will be
passed a string that represents the IP address of the
specified name, or the errback will be called if the
lookup times out. If multiple types of address records
are associated with the name, A6 records will be returned
in preference to AAAA records, which will be returned in
preference to A records. If there are multiple records of
the type to be returned, one will be selected at random.
@raise twisted.internet.defer.TimeoutError: Raised
(asynchronously) if the name cannot be resolved within the
specified timeout period.
Nr ��name�timeoutr r r
�
getHostByName; s zIResolverSimple.getHostByNameN)r )r r r
r r r r r
r : s r c @ s e Zd ZdZed�Zdd� ZdS )�IHostResolutionz�
An L{IHostResolution} represents represents an in-progress recursive query
for a DNS name.
@since: Twisted 17.1.0
zB
L{unicode}; the name of the host being resolved.
c C s dS )z;
Stop the hostname resolution in progress.
Nr r r r r
�cancele s zIHostResolution.cancelN)r r r
r r r r r r r r
r W s
�r c @ s( e Zd ZdZdd� Zdd� Zdd� ZdS ) �IResolutionReceiverz�
An L{IResolutionReceiver} receives the results of a hostname resolution in
progress, initiated by an L{IHostnameResolver}.
@since: Twisted 17.1.0
c C s dS )zk
A hostname resolution began.
@param resolutionInProgress: an L{IHostResolution}.
Nr )ZresolutionInProgressr r r
�resolutionBegant s z#IResolutionReceiver.resolutionBeganc C s dS )a�
An internet address. This is called when an address for the given name
is discovered. In the current implementation this practically means
L{IPv4Address} or L{IPv6Address}, but implementations of this interface
should be lenient to other types being passed to this interface as
well, for future-proofing.
@param address: An address object.
@type address: L{IAddress}
Nr )�addressr r r
�addressResolved| s z#IResolutionReceiver.addressResolvedc C s dS )z�
Resolution has completed; no further addresses will be relayed to
L{IResolutionReceiver.addressResolved}.
Nr r r r r
�resolutionComplete� s z&IResolutionReceiver.resolutionCompleteN)r r r
r r r"