class
MQTT::V5::Property
- MQTT::V5::Property
- BinData
- Reference
- Object
Overview
One property: an identifier followed by exactly one value.
onlyif picks the value's encoding from the identifier that was just
read, which is what lets the whole property system stay declarative
Defined in:
mqtt/v5/property.crConstant Summary
-
AFTER_DESERIALIZE =
[] of Nil -
One property: an identifier followed by exactly one value.
onlyifpicks the value's encoding from the identifier that was just read, which is what lets the whole property system stay declarative -
BEFORE_SERIALIZE =
[] of Nil -
One property: an identifier followed by exactly one value.
onlyifpicks the value's encoding from the identifier that was just read, which is what lets the whole property system stay declarative -
ENDIAN =
["big"] -
One property: an identifier followed by exactly one value.
onlyifpicks the value's encoding from the identifier that was just read, which is what lets the whole property system stay declarative -
KLASS_NAME =
[MQTT::V5::Property] -
One property: an identifier followed by exactly one value.
onlyifpicks the value's encoding from the identifier that was just read, which is what lets the whole property system stay declarative -
PARTS =
[{type: "enum", name: identifier, cls: typeof(PropertyId::UserProperty.value), onlyif: nil, verify: nil, value: nil, encoding: nil, enum_type: MQTT::V5::PropertyId}, {type: "basic", name: byte_value, cls: UInt8, onlyif: -> do identifier.data_type.byte? end, verify: nil, value: nil, endian: nil}, {type: "basic", name: two_byte_value, cls: UInt16, onlyif: -> do identifier.data_type.two_byte? end, verify: nil, value: nil, endian: nil}, {type: "basic", name: four_byte_value, cls: UInt32, onlyif: -> do identifier.data_type.four_byte? end, verify: nil, value: nil, endian: nil}, {type: "basic", name: vbi1, cls: UInt8, onlyif: -> do variable_byte? end, verify: nil, value: nil, endian: nil}, {type: "basic", name: vbi2, cls: UInt8, onlyif: -> do variable_byte? && (vbi1 & 128) > 0 end, verify: nil, value: nil, endian: nil}, {type: "basic", name: vbi3, cls: UInt8, onlyif: -> do variable_byte? && (vbi2 & 128) > 0 end, verify: nil, value: nil, endian: nil}, {type: "basic", name: vbi4, cls: UInt8, onlyif: -> do variable_byte? && (vbi3 & 128) > 0 end, verify: nil, value: nil, endian: nil}, {type: "basic", name: key_size, cls: UInt16, onlyif: -> do string? end, verify: nil, value: -> do key.bytesize end, endian: nil}, {type: "string", name: key, cls: String, onlyif: -> do string? end, verify: nil, length: -> do key_size end, value: nil, encoding: nil}, {type: "basic", name: value_size, cls: UInt16, onlyif: -> do pair? end, verify: nil, value: -> do value.bytesize end, endian: nil}, {type: "string", name: value, cls: String, onlyif: -> do pair? end, verify: nil, length: -> do value_size end, value: nil, encoding: nil}, {type: "basic", name: data_size, cls: UInt16, onlyif: -> do binary? end, verify: nil, value: -> do data.size end, endian: nil}, {type: "bytes", name: data, cls: Slice(UInt8), onlyif: -> do binary? end, verify: nil, length: -> do data_size end, value: nil}] of Nil -
One property: an identifier followed by exactly one value.
onlyifpicks the value's encoding from the identifier that was just read, which is what lets the whole property system stay declarative -
REMAINING =
[] of Nil -
One property: an identifier followed by exactly one value.
onlyifpicks the value's encoding from the identifier that was just read, which is what lets the whole property system stay declarative
Class Method Summary
-
.bit_fields
One property: an identifier followed by exactly one value.
Instance Method Summary
-
#__format__ : IO::ByteFormat
A
grouporbit_fieldcaptures the endianness at its declaration point, so declaringendianafter one would silently leave it system-endian. - #binary? : Bool
- #byte_value : UInt8
- #byte_value=(byte_value : UInt8)
-
#bytesize : Int32
Bytes this property occupies on the wire
- #data : Bytes
- #data=(data : Bytes)
- #data_size : UInt16
- #data_size=(data_size : UInt16)
- #four_byte_value : UInt32
- #four_byte_value=(four_byte_value : UInt32)
- #identifier : PropertyId
- #identifier=(identifier : PropertyId)
- #key : String
- #key=(key : String)
-
#key_size : UInt16
a string pair is simply two strings back to back, so the first one shares its encoding with a plain UTF-8 string
-
#key_size=(key_size : UInt16)
a string pair is simply two strings back to back, so the first one shares its encoding with a plain UTF-8 string
- #pair? : Bool
- #string? : Bool
- #two_byte_value : UInt16
- #two_byte_value=(two_byte_value : UInt16)
- #value : String
- #value=(value : String)
- #value_size : UInt16
- #value_size=(value_size : UInt16)
- #variable_byte? : Bool
-
#variable_value : UInt32
The variable byte integer value, decoded
- #variable_value=(value : UInt32) : UInt32
-
#vbi1 : UInt8
variable byte integer, a continuation bit per byte
-
#vbi1=(vbi1 : UInt8)
variable byte integer, a continuation bit per byte
- #vbi2 : UInt8
- #vbi2=(vbi2 : UInt8)
- #vbi3 : UInt8
- #vbi3=(vbi3 : UInt8)
- #vbi4 : UInt8
- #vbi4=(vbi4 : UInt8)
Class Method Detail
One property: an identifier followed by exactly one value.
onlyif picks the value's encoding from the identifier that was just
read, which is what lets the whole property system stay declarative
Instance Method Detail
A group or bit_field captures the endianness at its declaration point, so
declaring endian after one would silently leave it system-endian. Fail loudly.
a string pair is simply two strings back to back, so the first one shares its encoding with a plain UTF-8 string
a string pair is simply two strings back to back, so the first one shares its encoding with a plain UTF-8 string