[][src]Crate flubber_backend_proto

The protocol between the server and backends.

Example Session

P: {"backend_name": "Example", "backend_version": [0, 0, 1], "protocol_version": [0, 1, 0]}
S: {"sequence_number": 0, "body": {"type": "RoomLookup", "value": "#general"}}
P: {"sequence_number": 0, "body": {"type": "RoomID", "value": "#general"}}
S: {"sequence_number": 1, "body": {"type": "RoomJoin", "value": "#general"}}
P: {"sequence_number": 1, "body": {"type": "Success", "value": null}}
S: {"sequence_number": 2, "body": {"type": "MessageSend", "value": {"recipient": "#general", "attachments": [], "content": {"type": "Text", "value: "Hello, world!"}, "extra": null}}}
P: {"sequence_number": 2, "body": {"type": "MessageID", "value": "test"}}

TODO:

  • Work out how emotes should work
    • EmoteID? Store emotes by hash?
  • Users

Modules

serde

Serde serialization modules.

Structs

InitInfo

Backend sends this to the server when it starts.

Message

A message sent from a user to another user or a room.

MessageAttachment

MIME-typed data attached to a message.

MessageID

A name for a message on a service. This should uniquely identify the message, even if it gets edited.

NewMessage

A message sent from a user to another user or a room.

NewRoom

A request to create a new room with the given properties.

Request

A request as sent to the backend.

Response

A response as sent from the backend.

ResponseError

An error with a request.

Room

The information corresponding to a room.

RoomID

A name for a room on a service. This should uniquely identify a room through renames if possible.

UserID

A name for a user on a service. This should uniquely identify a user through renames if possible.

Version

The version of the backend or protocol.

Enums

MessageContent

The contents of a message.

RequestBody

A request made to a server.

ResponseBody

The response to a request.

ResponseOrUpdate

A Response or Update.

RoomIDOrUserID

A RoomID or UserID.

Update

Information sent from the backend to the server.