nl 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/Rakefile +7 -0
- data/lib/nl/async/dispatcher.rb +16 -16
- data/lib/nl/async/driver.rb +0 -2
- data/lib/nl/async/mailbox.rb +0 -2
- data/lib/nl/async/operation.rb +0 -2
- data/lib/nl/async.rb +0 -2
- data/lib/nl/attribute_set.rb +173 -0
- data/lib/nl/bitfield32.rb +86 -0
- data/lib/nl/blocking_transport.rb +12 -12
- data/lib/nl/connection.rb +7 -9
- data/lib/nl/datagram.rb +7 -9
- data/lib/nl/datatypes.rb +454 -0
- data/lib/nl/decoder.rb +4 -0
- data/lib/nl/endian.rb +10 -0
- data/lib/nl/exchange.rb +40 -18
- data/lib/nl/family.rb +18 -41
- data/lib/nl/genl/client.rb +104 -0
- data/lib/nl/genl/protocol.rb +59 -0
- data/lib/nl/genl/wire.rb +94 -0
- data/lib/nl/genl.rb +61 -61
- data/lib/nl/notification.rb +3 -6
- data/lib/nl/notification_router.rb +30 -23
- data/lib/nl/raw/client.rb +83 -0
- data/lib/nl/raw/protocol.rb +112 -0
- data/lib/nl/raw/wire.rb +146 -0
- data/lib/nl/raw.rb +104 -0
- data/lib/nl/sequence_allocator.rb +0 -2
- data/lib/nl/structured_payload.rb +61 -0
- data/lib/nl/sub_message.rb +94 -0
- data/lib/nl/version.rb +1 -1
- data/lib/nl.rb +5 -6
- data/sig/generated/nl/async/dispatcher.rbs +53 -0
- data/sig/generated/nl/async/driver.rbs +21 -0
- data/sig/generated/nl/async/mailbox.rbs +32 -0
- data/sig/generated/nl/async/operation.rbs +123 -0
- data/sig/generated/nl/async.rbs +9 -0
- data/sig/generated/nl/attribute_set.rbs +50 -0
- data/sig/generated/nl/bitfield32.rbs +41 -0
- data/sig/generated/nl/blocking_transport.rbs +33 -0
- data/sig/generated/nl/connection.rbs +26 -0
- data/sig/generated/nl/datagram.rbs +11 -0
- data/sig/generated/nl/datatypes.rbs +181 -0
- data/sig/generated/nl/decoder.rbs +38 -0
- data/sig/generated/nl/encoder.rbs +29 -0
- data/sig/generated/nl/endian.rbs +28 -0
- data/sig/generated/nl/error.rbs +27 -0
- data/sig/generated/nl/exchange.rbs +75 -0
- data/sig/generated/nl/family.rbs +71 -0
- data/sig/generated/nl/genl/client.rbs +74 -0
- data/sig/generated/nl/genl/protocol.rbs +37 -0
- data/sig/generated/nl/genl/wire.rbs +113 -0
- data/sig/generated/nl/genl.rbs +50 -0
- data/sig/generated/nl/notification.rbs +53 -0
- data/sig/generated/nl/notification_router.rbs +30 -0
- data/sig/generated/nl/raw/client.rbs +50 -0
- data/sig/generated/nl/raw/protocol.rbs +122 -0
- data/sig/generated/nl/raw/wire.rbs +151 -0
- data/sig/generated/nl/raw.rbs +70 -0
- data/sig/generated/nl/sequence_allocator.rbs +15 -0
- data/sig/generated/nl/socket.rbs +40 -0
- data/sig/generated/nl/structured_payload.rbs +25 -0
- data/sig/generated/nl/sub_message.rbs +74 -0
- data/sig/generated/nl/version.rbs +5 -0
- data/sig/generated/nl.rbs +2 -0
- metadata +48 -7
- data/lib/nl/core.rb +0 -94
- data/lib/nl/genl/connection.rb +0 -89
- data/lib/nl/protocols/genl.rb +0 -74
- data/lib/nl/protocols/raw.rb +0 -460
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Generated from lib/nl/async/driver.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
module Async
|
|
5
|
+
module Drivers
|
|
6
|
+
class Thread
|
|
7
|
+
def start: () ?{ (?) -> untyped } -> untyped
|
|
8
|
+
|
|
9
|
+
def stop: (untyped task) -> untyped
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class Fiber
|
|
13
|
+
def start: () ?{ (?) -> untyped } -> untyped
|
|
14
|
+
|
|
15
|
+
def stop: (untyped _task) -> untyped
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.driver: (untyped name) -> untyped
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Generated from lib/nl/async/mailbox.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
module Async
|
|
5
|
+
# A thread-safe, scheduler-aware, single-consumer mailbox.
|
|
6
|
+
class Mailbox
|
|
7
|
+
class FullError < StandardError
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def initialize: (?capacity: untyped) -> untyped
|
|
11
|
+
|
|
12
|
+
# Adds a value without executing consumer code.
|
|
13
|
+
# @rbs (untyped) -> bool
|
|
14
|
+
def push: (untyped) -> bool
|
|
15
|
+
|
|
16
|
+
# Adds a completion/error event even when the value capacity is full.
|
|
17
|
+
def push_terminal: (untyped value) -> untyped
|
|
18
|
+
|
|
19
|
+
private def push_value: (untyped value, enforce_capacity: untyped) -> untyped
|
|
20
|
+
|
|
21
|
+
# Removes the next value, suspending through the current thread or Fiber scheduler if empty.
|
|
22
|
+
# @rbs (?timeout: Numeric?) -> untyped
|
|
23
|
+
def pop: (?timeout: Numeric?) -> untyped
|
|
24
|
+
|
|
25
|
+
def close: () -> untyped
|
|
26
|
+
|
|
27
|
+
def closed?: () -> untyped
|
|
28
|
+
|
|
29
|
+
def empty?: () -> untyped
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Generated from lib/nl/async/operation.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
module Async
|
|
5
|
+
module Events
|
|
6
|
+
class Item < Data
|
|
7
|
+
attr_reader value(): untyped
|
|
8
|
+
|
|
9
|
+
def self.new: (untyped value) -> instance
|
|
10
|
+
| (value: untyped) -> instance
|
|
11
|
+
|
|
12
|
+
def self.members: () -> [ :value ]
|
|
13
|
+
|
|
14
|
+
def members: () -> [ :value ]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class Done < Data
|
|
18
|
+
def self.new: () -> instance
|
|
19
|
+
| () -> instance
|
|
20
|
+
|
|
21
|
+
def self.members: () -> [ ]
|
|
22
|
+
|
|
23
|
+
def members: () -> [ ]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class Error < Data
|
|
27
|
+
attr_reader exception(): untyped
|
|
28
|
+
|
|
29
|
+
def self.new: (untyped exception) -> instance
|
|
30
|
+
| (exception: untyped) -> instance
|
|
31
|
+
|
|
32
|
+
def self.members: () -> [ :exception ]
|
|
33
|
+
|
|
34
|
+
def members: () -> [ :exception ]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
class ConcurrentConsumptionError < StandardError
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class StreamOverflowError < StandardError
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Future for the result of an already-started, single-reply operation.
|
|
45
|
+
# @rbs generic out Result
|
|
46
|
+
class Future[out Result]
|
|
47
|
+
def self.build: (?mailbox: untyped, ?on_close: untyped) -> untyped
|
|
48
|
+
|
|
49
|
+
def initialize: (mailbox: untyped, on_close: untyped) -> untyped
|
|
50
|
+
|
|
51
|
+
# @rbs (?timeout: Numeric?) -> Result
|
|
52
|
+
def await: (?timeout: Numeric?) -> Result
|
|
53
|
+
|
|
54
|
+
alias value await
|
|
55
|
+
|
|
56
|
+
def ready?: () -> bool
|
|
57
|
+
|
|
58
|
+
# Stops local delivery. The dispatcher still drains the Netlink exchange.
|
|
59
|
+
def close: () -> nil
|
|
60
|
+
|
|
61
|
+
private def settle_done: (untyped value) -> untyped
|
|
62
|
+
|
|
63
|
+
private def settle_failed: (untyped error) -> untyped
|
|
64
|
+
|
|
65
|
+
private def terminal_result: () -> untyped
|
|
66
|
+
|
|
67
|
+
class Sink
|
|
68
|
+
def initialize: (untyped mailbox) -> untyped
|
|
69
|
+
|
|
70
|
+
def succeed: (untyped value) -> untyped
|
|
71
|
+
|
|
72
|
+
def finish: () -> untyped
|
|
73
|
+
|
|
74
|
+
def fail: (untyped exception) -> untyped
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Single-pass consumer handle for a multipart Netlink operation.
|
|
79
|
+
# @rbs generic out Item
|
|
80
|
+
class Stream[out Item]
|
|
81
|
+
include Enumerable[Item]
|
|
82
|
+
|
|
83
|
+
def self.build: (?mailbox: untyped, ?on_close: untyped) -> untyped
|
|
84
|
+
|
|
85
|
+
def initialize: (mailbox: untyped, on_close: untyped) -> untyped
|
|
86
|
+
|
|
87
|
+
# @rbs () { (Item) -> void } -> self
|
|
88
|
+
# | () -> Enumerator[Item, self]
|
|
89
|
+
def each: () { (Item) -> void } -> self
|
|
90
|
+
| () -> Enumerator[Item, self]
|
|
91
|
+
|
|
92
|
+
# @rbs (?timeout: Numeric?) -> Item
|
|
93
|
+
def next: (?timeout: Numeric?) -> Item
|
|
94
|
+
|
|
95
|
+
# Stops local delivery. The dispatcher still drains the Netlink exchange.
|
|
96
|
+
def close: () -> nil
|
|
97
|
+
|
|
98
|
+
def closed?: () -> bool
|
|
99
|
+
|
|
100
|
+
private def current_state: () -> untyped
|
|
101
|
+
|
|
102
|
+
private def open?: () -> untyped
|
|
103
|
+
|
|
104
|
+
private def claim_consumer!: () -> untyped
|
|
105
|
+
|
|
106
|
+
private def mark_completed: () -> untyped
|
|
107
|
+
|
|
108
|
+
private def mark_failed: (untyped error) -> untyped
|
|
109
|
+
|
|
110
|
+
private def terminal_result: (?next_item: untyped) -> untyped
|
|
111
|
+
|
|
112
|
+
class Sink
|
|
113
|
+
def initialize: (untyped mailbox) -> untyped
|
|
114
|
+
|
|
115
|
+
def push: (untyped value) -> untyped
|
|
116
|
+
|
|
117
|
+
def finish: () -> untyped
|
|
118
|
+
|
|
119
|
+
def fail: (untyped exception) -> untyped
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Generated from lib/nl/attribute_set.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
class AttributeSet
|
|
5
|
+
class Attribute < Struct[untyped]
|
|
6
|
+
attr_accessor value(): untyped
|
|
7
|
+
|
|
8
|
+
def self.new: (?untyped value) -> instance
|
|
9
|
+
| (?value: untyped) -> instance
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class Attribute
|
|
13
|
+
MULTI: bool
|
|
14
|
+
|
|
15
|
+
ORDER: untyped
|
|
16
|
+
|
|
17
|
+
SELECTOR_SLOT: untyped
|
|
18
|
+
|
|
19
|
+
def self.multi?: () -> untyped
|
|
20
|
+
|
|
21
|
+
def self.decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
22
|
+
|
|
23
|
+
def encode: (untyped encoder, ?context: untyped) -> untyped
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def initialize: (untyped attributes) -> untyped
|
|
27
|
+
|
|
28
|
+
def []: (untyped type) -> untyped
|
|
29
|
+
|
|
30
|
+
def <<: (untyped attr) -> untyped
|
|
31
|
+
|
|
32
|
+
SELECTOR_NAMES: untyped
|
|
33
|
+
|
|
34
|
+
private def encode1: (untyped encoder, untyped attr, untyped context) -> untyped
|
|
35
|
+
|
|
36
|
+
def encode: (untyped encoder, ?external_selectors: untyped) -> untyped
|
|
37
|
+
|
|
38
|
+
private def selector_name: (untyped error) -> untyped
|
|
39
|
+
|
|
40
|
+
private def self.decode1: (untyped decoder, untyped context) -> untyped
|
|
41
|
+
|
|
42
|
+
def self.decode: (untyped decoder, ?external_selectors: untyped) -> untyped
|
|
43
|
+
|
|
44
|
+
def self.build_attributes: (?untyped params, ?external_selectors: untyped, **untyped keywords) -> untyped
|
|
45
|
+
|
|
46
|
+
private def self.coerce: (untyped datatype, untyped value, untyped context) -> untyped
|
|
47
|
+
|
|
48
|
+
private def self.selector_name: (untyped error) -> untyped
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Generated from lib/nl/bitfield32.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
# A 32-bit value paired with a mask selecting the meaningful bits.
|
|
5
|
+
class Bitfield32
|
|
6
|
+
UINT32_RANGE: untyped
|
|
7
|
+
|
|
8
|
+
# A 32-bit flags
|
|
9
|
+
# @return [Integer]
|
|
10
|
+
attr_reader value: Integer
|
|
11
|
+
|
|
12
|
+
# A 32-bit mask selecting the meaningful bits
|
|
13
|
+
# @return [Integer]
|
|
14
|
+
attr_reader selector: Integer
|
|
15
|
+
|
|
16
|
+
# @param [Integer] value
|
|
17
|
+
# @param [Integer] selector
|
|
18
|
+
# @rbs (Integer value, Integer selector) -> void
|
|
19
|
+
def initialize: (Integer value, Integer selector) -> void
|
|
20
|
+
|
|
21
|
+
# Returns 1 or 0 for a selected bit, or nil for an unselected bit.
|
|
22
|
+
# @param [Integer] index Bits are indexed from the least significant bit, starting at zero.
|
|
23
|
+
# @return [0, 1, nil]
|
|
24
|
+
# @rbs (Integer index) -> (0 | 1 | nil)
|
|
25
|
+
def []: (Integer index) -> (0 | 1 | nil)
|
|
26
|
+
|
|
27
|
+
# Selects and sets or clears a bit. Assigning nil unselects it.
|
|
28
|
+
# @param [Integer] index Bits are indexed from the least significant bit, starting at zero.
|
|
29
|
+
# @param [0, 1, nil] state
|
|
30
|
+
# @rbs (Integer index, (0 | 1 | nil) state) -> (0 | 1 | nil)
|
|
31
|
+
def []=: (Integer index, 0 | 1 | nil state) -> (0 | 1 | nil)
|
|
32
|
+
|
|
33
|
+
# Converts a bit index to a bit mask
|
|
34
|
+
# @rbs (Integer index) -> Integer
|
|
35
|
+
private def bit_mask: (Integer index) -> Integer
|
|
36
|
+
|
|
37
|
+
# Validates if an Integer fits in uint32
|
|
38
|
+
# @rbs (Integer integer, Symbol name) -> void
|
|
39
|
+
private def validate_uint32: (Integer integer, Symbol name) -> void
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Generated from lib/nl/blocking_transport.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
# Drives one exchange at a time with blocking socket operations.
|
|
5
|
+
class BlockingTransport
|
|
6
|
+
class ConcurrentOperationError < StandardError
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
class UnexpectedSequenceError < StandardError
|
|
10
|
+
attr_reader expected: untyped
|
|
11
|
+
|
|
12
|
+
attr_reader actual: untyped
|
|
13
|
+
|
|
14
|
+
def initialize: (untyped expected, untyped actual) -> untyped
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def initialize: (untyped socket, protocol: untyped, notifications: untyped) -> untyped
|
|
18
|
+
|
|
19
|
+
def exchange: (untyped endpoint, untyped kind, untyped request_class, untyped reply_class, untyped args) -> untyped
|
|
20
|
+
|
|
21
|
+
def async_capable?: () -> false
|
|
22
|
+
|
|
23
|
+
def receive_notification: (untyped endpoint, ?timeout: untyped) -> untyped
|
|
24
|
+
|
|
25
|
+
def close: () -> void
|
|
26
|
+
|
|
27
|
+
private def receive: (untyped endpoint, untyped expected_key, untyped reply_class) -> untyped
|
|
28
|
+
|
|
29
|
+
private def receive_notifications: () -> untyped
|
|
30
|
+
|
|
31
|
+
private def receive_datagram: () -> untyped
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated from lib/nl/connection.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
# Owns one Netlink socket and the facilities shared by families using it.
|
|
5
|
+
class Connection
|
|
6
|
+
DEFAULT_NOTIFICATION_CAPACITY: ::Integer
|
|
7
|
+
|
|
8
|
+
def initialize: (protocol: untyped, ?executor: untyped, ?notification_capacity: untyped) -> untyped
|
|
9
|
+
|
|
10
|
+
def exchange: () -> untyped
|
|
11
|
+
|
|
12
|
+
def exchange_async: () -> untyped
|
|
13
|
+
|
|
14
|
+
def async_capable?: () -> untyped
|
|
15
|
+
|
|
16
|
+
def register_notifications: (untyped endpoint, untyped classes) -> untyped
|
|
17
|
+
|
|
18
|
+
def add_memberships: (untyped group_ids) -> untyped
|
|
19
|
+
|
|
20
|
+
def drop_memberships: (untyped group_ids) -> untyped
|
|
21
|
+
|
|
22
|
+
def receive_notification: (untyped endpoint, ?timeout: untyped) -> untyped
|
|
23
|
+
|
|
24
|
+
def close: () -> untyped
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Generated from lib/nl/datagram.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
# Splits Netlink datagrams into aligned header/payload frames.
|
|
5
|
+
module Datagram
|
|
6
|
+
# @rbs (IO::Buffer buffer) { (Raw::NlMsgHdr, IO::Buffer) -> void } -> nil
|
|
7
|
+
# | (IO::Buffer buffer) -> Enumerator[[Raw::NlMsgHdr, IO::Buffer], nil]
|
|
8
|
+
def self.each_frame: (IO::Buffer buffer) { (Raw::NlMsgHdr, IO::Buffer) -> void } -> nil
|
|
9
|
+
| (IO::Buffer buffer) -> Enumerator[[ Raw::NlMsgHdr, IO::Buffer ], nil]
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Generated from lib/nl/datatypes.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
interface _DataType
|
|
5
|
+
def encode: (Encoder, untyped, ?context: untyped) -> void
|
|
6
|
+
|
|
7
|
+
def decode: (Decoder, ?context: untyped, ?nlattr_type_flags: Integer) -> untyped
|
|
8
|
+
|
|
9
|
+
def nlattr_type_flags: (?untyped, ?context: untyped) -> Integer
|
|
10
|
+
|
|
11
|
+
def coerce: (untyped, ?context: untyped) -> untyped
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
module DataTypes
|
|
15
|
+
class Base
|
|
16
|
+
def initialize: (?check: untyped) -> untyped
|
|
17
|
+
|
|
18
|
+
def nlattr_type_flags: (?untyped _value, ?context: untyped) -> untyped
|
|
19
|
+
|
|
20
|
+
def coerce: (untyped value, ?context: untyped) -> untyped
|
|
21
|
+
|
|
22
|
+
private def checked: (untyped value) -> untyped
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
class Scalar < Base
|
|
26
|
+
def initialize: (untyped type, check: untyped) -> untyped
|
|
27
|
+
|
|
28
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
29
|
+
|
|
30
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
class VariableInteger < Base
|
|
34
|
+
UINT32_RANGE: untyped
|
|
35
|
+
|
|
36
|
+
UINT64_RANGE: untyped
|
|
37
|
+
|
|
38
|
+
SINT32_RANGE: untyped
|
|
39
|
+
|
|
40
|
+
SINT64_RANGE: untyped
|
|
41
|
+
|
|
42
|
+
def initialize: (untyped byte_order, signed: untyped, check: untyped) -> untyped
|
|
43
|
+
|
|
44
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
45
|
+
|
|
46
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
class String < Base
|
|
50
|
+
def initialize: (check: untyped) -> untyped
|
|
51
|
+
|
|
52
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
53
|
+
|
|
54
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class Binary < Base
|
|
58
|
+
def initialize: (check: untyped, ?length: untyped) -> untyped
|
|
59
|
+
|
|
60
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
61
|
+
|
|
62
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# An array whose elements are packed consecutively without per-element
|
|
66
|
+
# headers or alignment padding.
|
|
67
|
+
class PackedArray < Base
|
|
68
|
+
def initialize: (untyped sub_type, ?check: untyped) -> untyped
|
|
69
|
+
|
|
70
|
+
def encode: (untyped encoder, untyped values, ?context: untyped) -> untyped
|
|
71
|
+
|
|
72
|
+
def coerce: (untyped values, ?context: untyped) -> untyped
|
|
73
|
+
|
|
74
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
class Struct < Base
|
|
78
|
+
def initialize: (untyped type, ?check: untyped, ?consume_remaining: untyped) -> untyped
|
|
79
|
+
|
|
80
|
+
def coerce: (untyped value, ?context: untyped) -> untyped
|
|
81
|
+
|
|
82
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
83
|
+
|
|
84
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
class Flag < Base
|
|
88
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
89
|
+
|
|
90
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
class Bitfield32 < Base
|
|
94
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
95
|
+
|
|
96
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
class Pad < Base
|
|
100
|
+
def initialize: (?untyped length) -> untyped
|
|
101
|
+
|
|
102
|
+
def encode: (untyped encoder, untyped _value, ?context: untyped) -> untyped
|
|
103
|
+
|
|
104
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
class NestedAttributes < Base
|
|
108
|
+
def initialize: (untyped attribute_set, ?selector_bindings: untyped) -> untyped
|
|
109
|
+
|
|
110
|
+
def nlattr_type_flags: (?untyped _value, ?context: untyped) -> untyped
|
|
111
|
+
|
|
112
|
+
def coerce: (untyped value, ?context: untyped) -> untyped
|
|
113
|
+
|
|
114
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
115
|
+
|
|
116
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
117
|
+
|
|
118
|
+
private def selectors: (untyped context) -> untyped
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
class SubMessage < Base
|
|
122
|
+
class Format < Data
|
|
123
|
+
attr_reader type(): untyped
|
|
124
|
+
|
|
125
|
+
attr_reader selector_bindings(): untyped
|
|
126
|
+
|
|
127
|
+
attr_reader nested(): untyped
|
|
128
|
+
|
|
129
|
+
def self.new: (untyped type, untyped selector_bindings, untyped nested) -> instance
|
|
130
|
+
| (type: untyped, selector_bindings: untyped, nested: untyped) -> instance
|
|
131
|
+
|
|
132
|
+
def self.members: () -> [ :type, :selector_bindings, :nested ]
|
|
133
|
+
|
|
134
|
+
def members: () -> [ :type, :selector_bindings, :nested ]
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def initialize: (untyped selector, untyped formats) -> untyped
|
|
138
|
+
|
|
139
|
+
def nlattr_type_flags: (?untyped value, context: untyped) -> untyped
|
|
140
|
+
|
|
141
|
+
def coerce: (untyped value, context: untyped) -> untyped
|
|
142
|
+
|
|
143
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
144
|
+
|
|
145
|
+
def decode: (untyped decoder, context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
146
|
+
|
|
147
|
+
private def selectors: (untyped format, untyped context) -> untyped
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Nested attributes whose type numbers are keys rather than members of
|
|
151
|
+
# an attribute set. Each level is returned as an Integer-keyed Hash;
|
|
152
|
+
# values at the innermost level are decoded as @attribute_set.
|
|
153
|
+
class NestTypeValue < Base
|
|
154
|
+
def initialize: (untyped attribute_set, untyped levels, ?selector_bindings: untyped) -> untyped
|
|
155
|
+
|
|
156
|
+
def encode: (untyped encoder, untyped value, ?context: untyped) -> untyped
|
|
157
|
+
|
|
158
|
+
def coerce: (?untyped value, ?context: untyped, **untyped keywords) -> untyped
|
|
159
|
+
|
|
160
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
161
|
+
|
|
162
|
+
private def encode_level: (untyped encoder, untyped values, untyped levels, untyped external_selectors) -> untyped
|
|
163
|
+
|
|
164
|
+
private def coerce_level: (untyped values, untyped levels, untyped external_selectors) -> untyped
|
|
165
|
+
|
|
166
|
+
private def decode_level: (untyped decoder, untyped levels, untyped external_selectors) -> untyped
|
|
167
|
+
|
|
168
|
+
private def selectors: (untyped context) -> untyped
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
class IndexedArray < Base
|
|
172
|
+
def initialize: (untyped sub_type) -> untyped
|
|
173
|
+
|
|
174
|
+
def encode: (untyped encoder, untyped values, ?context: untyped) -> untyped
|
|
175
|
+
|
|
176
|
+
def coerce: (untyped values, ?context: untyped) -> untyped
|
|
177
|
+
|
|
178
|
+
def decode: (untyped decoder, ?context: untyped, ?nlattr_type_flags: untyped) -> untyped
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Generated from lib/nl/decoder.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
class Decoder
|
|
5
|
+
class Error < StandardError
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class OutOfBounds < Error
|
|
9
|
+
def initialize: (?untyped message) -> untyped
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class Unterminated < Error
|
|
13
|
+
def initialize: (?untyped message) -> untyped
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def initialize: (untyped buffer, ?untyped offset, ?untyped length) -> untyped
|
|
17
|
+
|
|
18
|
+
def available?: (?untyped size) -> untyped
|
|
19
|
+
|
|
20
|
+
def remaining: () -> untyped
|
|
21
|
+
|
|
22
|
+
def limit: (untyped size) -> untyped
|
|
23
|
+
|
|
24
|
+
def skip: (?untyped length) -> untyped
|
|
25
|
+
|
|
26
|
+
def get_string: (?untyped length) -> untyped
|
|
27
|
+
|
|
28
|
+
def get_buffer: (?untyped length) -> untyped
|
|
29
|
+
|
|
30
|
+
def get_zstring: (?unterminated_ok: untyped) -> untyped
|
|
31
|
+
|
|
32
|
+
def get_value: (untyped type) -> untyped
|
|
33
|
+
|
|
34
|
+
def get_values: (untyped types) -> untyped
|
|
35
|
+
|
|
36
|
+
def align_to: (untyped alignment) -> untyped
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Generated from lib/nl/encoder.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
class Encoder
|
|
5
|
+
attr_reader position: untyped
|
|
6
|
+
|
|
7
|
+
def initialize: (?untyped capacity) -> untyped
|
|
8
|
+
|
|
9
|
+
def reserve: (untyped size) -> untyped
|
|
10
|
+
|
|
11
|
+
def put_string: (untyped value) -> untyped
|
|
12
|
+
|
|
13
|
+
def put_zstring: (untyped value) -> untyped
|
|
14
|
+
|
|
15
|
+
def put_value: (untyped type, untyped value) -> untyped
|
|
16
|
+
|
|
17
|
+
def put_values: (untyped types, untyped values) -> untyped
|
|
18
|
+
|
|
19
|
+
def align_to: (untyped alignment) -> untyped
|
|
20
|
+
|
|
21
|
+
def put_value_at: (untyped offset, untyped type, untyped value) -> untyped
|
|
22
|
+
|
|
23
|
+
def put_values_at: (untyped offset, untyped types, untyped values) -> untyped
|
|
24
|
+
|
|
25
|
+
def buffer: () -> untyped
|
|
26
|
+
|
|
27
|
+
def measure: (untyped type, ?untyped offset) -> untyped
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Generated from lib/nl/endian.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
module Endian
|
|
5
|
+
# sizeof(int)
|
|
6
|
+
SIZEOF_INT: untyped
|
|
7
|
+
|
|
8
|
+
# sizeof(long)
|
|
9
|
+
SIZEOF_LONG: untyped
|
|
10
|
+
|
|
11
|
+
# sizeof(long long)
|
|
12
|
+
SIZEOF_LLONG: untyped
|
|
13
|
+
|
|
14
|
+
# Little-endian scalar types.
|
|
15
|
+
module Little
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Big-endian scalar types.
|
|
19
|
+
module Big
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Host-endian scalar types.
|
|
23
|
+
#
|
|
24
|
+
# This module includes either {Little} or {Big} depending on the host's native byte order.
|
|
25
|
+
module Host
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Generated from lib/nl/error.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nl
|
|
4
|
+
class Error < StandardError
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
class ProtocolViolation < Error
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class ExhaustedSequenceNumber < Error
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class TimeoutError < Error
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class ClosedError < Error
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class NotificationLossError < Error
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class UnknownMulticastGroupError < Error
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
class UnresolvedMulticastGroupError < Error
|
|
26
|
+
end
|
|
27
|
+
end
|