-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathiggy_py.pyi
198 lines (152 loc) · 5.63 KB
/
iggy_py.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401
import builtins
import typing
from enum import Enum, auto
class IggyClient:
r"""
A Python class representing the Iggy client.
It wraps the RustIggyClient and provides asynchronous functionality
through the contained runtime.
"""
def new(self, conn:typing.Optional[builtins.str]) -> IggyClient:
r"""
Constructs a new IggyClient.
This initializes a new runtime for asynchronous operations.
Future versions might utilize asyncio for more Pythonic async.
"""
...
def ping(self) -> typing.Any:
r"""
Sends a ping request to the server to check connectivity.
Returns `Ok(())` if the server responds successfully, or a `PyRuntimeError`
if the connection fails.
"""
...
def login_user(self, username:builtins.str, password:builtins.str) -> typing.Any:
r"""
Logs in the user with the given credentials.
Returns `Ok(())` on success, or a PyRuntimeError on failure.
"""
...
def connect(self) -> typing.Any:
r"""
Connects the IggyClient to its service.
Returns Ok(()) on successful connection or a PyRuntimeError on failure.
"""
...
def create_stream(self, name:builtins.str, stream_id:typing.Optional[builtins.int]) -> typing.Any:
r"""
Creates a new stream with the provided ID and name.
Returns Ok(()) on successful stream creation or a PyRuntimeError on failure.
"""
...
def get_stream(self, stream_id:PyIdentifier) -> typing.Any:
r"""
Gets stream by id.
Returns Option of stream details or a PyRuntimeError on failure.
"""
...
def create_topic(self, stream:PyIdentifier, name:builtins.str, partitions_count:builtins.int, compression_algorithm:typing.Optional[builtins.str], topic_id:typing.Optional[builtins.int], replication_factor:typing.Optional[builtins.int]) -> typing.Any:
r"""
Creates a new topic with the given parameters.
Returns Ok(()) on successful topic creation or a PyRuntimeError on failure.
"""
...
def get_topic(self, stream_id:PyIdentifier, topic_id:PyIdentifier) -> typing.Any:
r"""
Gets topic by stream and id.
Returns Option of topic details or a PyRuntimeError on failure.
"""
...
def send_messages(self, stream:PyIdentifier, topic:PyIdentifier, partitioning:builtins.int, messages:list) -> typing.Any:
r"""
Sends a list of messages to the specified topic.
Returns Ok(()) on successful sending or a PyRuntimeError on failure.
"""
...
def poll_messages(self, stream:PyIdentifier, topic:PyIdentifier, partition_id:builtins.int, polling_strategy:PollingStrategy, count:builtins.int, auto_commit:builtins.bool) -> typing.Any:
r"""
Polls for messages from the specified topic and partition.
Returns a list of received messages or a PyRuntimeError on failure.
"""
...
class ReceiveMessage:
r"""
A Python class representing a received message.
This class wraps a Rust message, allowing for access to its payload and offset from Python.
"""
def payload(self) -> typing.Any:
r"""
Retrieves the payload of the received message.
The payload is returned as a Python bytes object.
"""
...
def offset(self) -> builtins.int:
r"""
Retrieves the offset of the received message.
The offset represents the position of the message within its topic.
"""
...
def timestamp(self) -> builtins.int:
r"""
Retrieves the timestamp of the received message.
The timestamp represents the time of the message within its topic.
"""
...
def id(self) -> builtins.int:
r"""
Retrieves the id of the received message.
The id represents unique identifier of the message within its topic.
"""
...
def checksum(self) -> builtins.int:
r"""
Retrieves the checksum of the received message.
The checksum represents the integrity of the message within its topic.
"""
...
def state(self) -> MessageState:
r"""
Retrieves the Message's state of the received message.
State represents the state of the response.
"""
...
def length(self) -> builtins.int:
r"""
Retrieves the length of the received message.
The length represents the length of the payload.
"""
...
class SendMessage:
r"""
A Python class representing a message to be sent.
This class wraps a Rust message meant for sending, facilitating
the creation of such messages from Python and their subsequent use in Rust.
"""
def __new__(cls,data:builtins.str): ...
...
class StreamDetails:
id: builtins.int
name: builtins.str
messages_count: builtins.int
topics_count: builtins.int
class TopicDetails:
id: builtins.int
name: builtins.str
messages_count: builtins.int
topics_count: builtins.int
class MessageState(Enum):
Available = auto()
Unavailable = auto()
Poisoned = auto()
MarkedForDeletion = auto()
class PollingStrategy(Enum):
Offset = auto()
Timestamp = auto()
First = auto()
Last = auto()
Next = auto()
class PyIdentifier(Enum):
String = auto()
Int = auto()