Capsule class abstract

Base class for the Capsule Protocol (RFC 9297).

Each capsule on the wire is: VarInt(Type) + VarInt(Length) + Data (Length bytes)

NOTE: This HTTP/3 Capsule class is distinct from the Capsule class in lib/src/webtransport/capsule_types.dart. Both are exported from quic_lib.dart (via different barrel files), which creates a naming ambiguity when both are imported. This will be resolved in v2.0.0 by renaming the WebTransport class to WebTransportCapsule.

Implementers

Constructors

Capsule({required int type, required Uint8List data})

Properties

data Uint8List
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type int
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize() Uint8List
Serializes this capsule into its on-the-wire representation.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

parse(Uint8List bytes, {int offset = 0}) → (Capsule, int)
Parses a capsule from bytes starting at offset.