lightspeed/protocol
Versioned protocol frame model.
Types
Protocol decode errors.
pub type DecodeError {
EmptyFrame
UnknownFrameTag(String)
BadFieldCount(tag: String, expected: Int, actual: Int)
InvalidVersion(String)
UnsupportedVersion(Int)
UnsupportedProtocol(String)
InvalidEscapeSequence
}
Constructors
-
EmptyFrame -
UnknownFrameTag(String) -
BadFieldCount(tag: String, expected: Int, actual: Int) -
InvalidVersion(String) -
UnsupportedVersion(Int) -
UnsupportedProtocol(String) -
InvalidEscapeSequence
Protocol frame exchanged between client and server.
pub type Frame {
Hello(protocol: String, version: Int)
Event(ref: String, name: String, payload: String)
Diff(ref: String, html: String)
Ack(ref: String)
Failure(ref: String, reason: String)
}
Constructors
-
Hello(protocol: String, version: Int) -
Event(ref: String, name: String, payload: String) -
Diff(ref: String, html: String) -
Ack(ref: String) -
Failure(ref: String, reason: String)
Values
pub fn decode_error_to_string(error: DecodeError) -> String
Convert decode errors to stable strings for logs and adapter errors.
pub fn is_current_hello(frame: Frame) -> Bool
True when the frame is part of the current protocol.
pub const protocol_name: String
pub const protocol_version: Int