37 b'version': 1, |
37 b'version': 1, |
38 }, |
38 }, |
39 } |
39 } |
40 |
40 |
41 |
41 |
42 class bytesresponse(object): |
42 class bytesresponse: |
43 """A wire protocol response consisting of raw bytes.""" |
43 """A wire protocol response consisting of raw bytes.""" |
44 |
44 |
45 def __init__(self, data): |
45 def __init__(self, data): |
46 self.data = data |
46 self.data = data |
47 |
47 |
48 |
48 |
49 class ooberror(object): |
49 class ooberror: |
50 """wireproto reply: failure of a batch of operation |
50 """wireproto reply: failure of a batch of operation |
51 |
51 |
52 Something failed during a batch call. The error message is stored in |
52 Something failed during a batch call. The error message is stored in |
53 `self.message`. |
53 `self.message`. |
54 """ |
54 """ |
55 |
55 |
56 def __init__(self, message): |
56 def __init__(self, message): |
57 self.message = message |
57 self.message = message |
58 |
58 |
59 |
59 |
60 class pushres(object): |
60 class pushres: |
61 """wireproto reply: success with simple integer return |
61 """wireproto reply: success with simple integer return |
62 |
62 |
63 The call was successful and returned an integer contained in `self.res`. |
63 The call was successful and returned an integer contained in `self.res`. |
64 """ |
64 """ |
65 |
65 |
66 def __init__(self, res, output): |
66 def __init__(self, res, output): |
67 self.res = res |
67 self.res = res |
68 self.output = output |
68 self.output = output |
69 |
69 |
70 |
70 |
71 class pusherr(object): |
71 class pusherr: |
72 """wireproto reply: failure |
72 """wireproto reply: failure |
73 |
73 |
74 The call failed. The `self.res` attribute contains the error message. |
74 The call failed. The `self.res` attribute contains the error message. |
75 """ |
75 """ |
76 |
76 |
77 def __init__(self, res, output): |
77 def __init__(self, res, output): |
78 self.res = res |
78 self.res = res |
79 self.output = output |
79 self.output = output |
80 |
80 |
81 |
81 |
82 class streamres(object): |
82 class streamres: |
83 """wireproto reply: binary stream |
83 """wireproto reply: binary stream |
84 |
84 |
85 The call was successful and the result is a stream. |
85 The call was successful and the result is a stream. |
86 |
86 |
87 Accepts a generator containing chunks of data to be sent to the client. |
87 Accepts a generator containing chunks of data to be sent to the client. |
94 def __init__(self, gen=None, prefer_uncompressed=False): |
94 def __init__(self, gen=None, prefer_uncompressed=False): |
95 self.gen = gen |
95 self.gen = gen |
96 self.prefer_uncompressed = prefer_uncompressed |
96 self.prefer_uncompressed = prefer_uncompressed |
97 |
97 |
98 |
98 |
99 class streamreslegacy(object): |
99 class streamreslegacy: |
100 """wireproto reply: uncompressed binary stream |
100 """wireproto reply: uncompressed binary stream |
101 |
101 |
102 The call was successful and the result is a stream. |
102 The call was successful and the result is a stream. |
103 |
103 |
104 Accepts a generator containing chunks of data to be sent to the client. |
104 Accepts a generator containing chunks of data to be sent to the client. |
437 serverdercerts = attr.ib(default=None) |
437 serverdercerts = attr.ib(default=None) |
438 servercadercerts = attr.ib(default=None) |
438 servercadercerts = attr.ib(default=None) |
439 |
439 |
440 |
440 |
441 @attr.s |
441 @attr.s |
442 class indefinitebytestringresponse(object): |
442 class indefinitebytestringresponse: |
443 """Represents an object to be encoded to an indefinite length bytestring. |
443 """Represents an object to be encoded to an indefinite length bytestring. |
444 |
444 |
445 Instances are initialized from an iterable of chunks, with each chunk being |
445 Instances are initialized from an iterable of chunks, with each chunk being |
446 a bytes instance. |
446 a bytes instance. |
447 """ |
447 """ |