-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathepyxid.pyi
89 lines (61 loc) · 1.56 KB
/
epyxid.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
from datetime import datetime
from typing import Optional, Union
__version__: str
class XIDError(ValueError):
pass
class XID:
"""
Globally unique sortable id.
"""
def __new__(cls, value: Optional[Union[str, bytes]] = None):
pass
def as_bytes(self) -> bytes:
"""
The binary representation of the id.
"""
def to_str(self) -> str:
"""
The string representation of the id.
"""
@property
def machine(self) -> bytes:
"""
Extract the 3-byte machine id.
"""
@property
def pid(self) -> int:
"""
Extract the process id.
"""
@property
def time(self) -> datetime:
"""
Extract the timestamp.
"""
@property
def counter(self) -> int:
"""
Extract the incrementing counter.
"""
def __hash__(self) -> int: ...
def __bytes__(self) -> bytes: ...
def __str__(self) -> str: ...
def __repr__(self) -> str: ...
def __eq__(self, object: 'XID') -> bool: ...
def __ne__(self, object: 'XID') -> bool: ...
def __lt__(self, object: 'XID') -> bool: ...
def __le__(self, object: 'XID') -> bool: ...
def __gt__(self, object: 'XID') -> bool: ...
def __ge__(self, object: 'XID') -> bool: ...
def xid_create() -> XID:
"""
Generate a new globally unique id.
"""
def xid_from_str(s: str) -> XID:
"""
Create an id from its string representation.
"""
def xid_from_bytes(b: bytes) -> XID:
"""
Create an id from bytes.
"""