Sample class

A sample received from a subscriber.

Contains the key expression, payload, kind, and optional attachment extracted from a zenoh sample notification.

Constructors

Sample({required String keyExpr, required String payload, required Uint8List payloadBytes, required SampleKind kind, String? attachment, Uint8List? attachmentBytes, String? encoding, Uint8List? encodingBytes, Timestamp? timestamp, Priority priority = Priority.data, CongestionControl congestionControl = CongestionControl.drop, bool express = false, ZBytes? payloadZBytes})
Creates a Sample with the given fields.

Properties

attachment String?
Optional attachment metadata as a UTF-8 string, decoded leniently.
final
attachmentBytes Uint8List?
The raw attachment bytes, or null if no attachment was present.
final
congestionControl CongestionControl
The CongestionControl strategy the sample was published with.
final
encoding String?
The encoding of the payload as a MIME type string, decoded leniently.
final
encodingBytes Uint8List?
The raw bytes of the rendered encoding, or null if none was carried.
final
express bool
Whether the sample was published in express mode (batching disabled).
final
hashCode int
The hash code for this object.
no setterinherited
keyExpr String
The key expression the sample was published on.
final
kind SampleKind
The kind of sample (put or delete).
final
payload String
The payload as a UTF-8 string, decoded leniently.
final
payloadBytes Uint8List
The raw payload bytes.
final
payloadZBytes ZBytes?
The payload as a retained ZBytes handle, or null when this sample's carrier did not opt in.
final
priority Priority
The Priority the sample was published with.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp Timestamp?
The Timestamp attached to this sample, or null when absent.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited