Initial import to Tizen
[profile/ivi/python-twisted.git] / twisted / internet / iocpreactor / interfaces.py
1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4
5 """
6 Interfaces for iocpreactor
7 """
8
9
10 from zope.interface import Interface
11
12
13
14 class IReadHandle(Interface):
15     def readFromHandle(bufflist, evt):
16         """
17         Read into the given buffers from this handle.
18
19         @param buff: the buffers to read into
20         @type buff: list of objects implementing the read/write buffer protocol
21
22         @param evt: an IOCP Event object
23
24         @return: tuple (return code, number of bytes read)
25         """
26
27
28
29 class IWriteHandle(Interface):
30     def writeToHandle(buff, evt):
31         """
32         Write the given buffer to this handle.
33
34         @param buff: the buffer to write
35         @type buff: any object implementing the buffer protocol
36
37         @param evt: an IOCP Event object
38
39         @return: tuple (return code, number of bytes written)
40         """
41
42
43
44 class IReadWriteHandle(IReadHandle, IWriteHandle):
45     pass
46
47