Module adapter

Source
Expand description

The adapter module contains the CoreAdapter trait and other related types.

It is used to implement communication between socket.io servers to share messages and state.

The CoreLocalAdapter provide a local implementation that will allow any implementors to apply local operations (broadcast_with_ack, broadcast, rooms, etc…).

Modules§

errors
All the errors that can be returned by the crate. Mostly when using the adapter module.

Structs§

BroadcastIter
An iterator that yields the socket ids that match the broadcast options. Used with the SocketEmitter interface.
BroadcastOptions
Options that can be used to modify the behavior of the broadcast methods.
CoreLocalAdapter
The default adapter. Store the state in memory.
RemoteSocketData
Represent the data of a remote socket.

Enums§

BroadcastFlags
Flags that can be used to modify the behavior of the broadcast methods.

Traits§

CoreAdapter
An adapter is responsible for managing the state of the namespace. This adapter can be implemented to share the state between multiple servers.
DefinedAdapter
A trait to add a “defined” bound to adapter types. This allow the socket io library to implement function given a defined adapter and not a generic A: Adapter.
RoomParam
A trait for types that can be used as a room parameter.
SocketEmitter
The SocketEmitter will be implemented by the socketioxide library. It is simply used as an abstraction to allow the adapter to communicate with the socket server without the need to depend on the socketioxide lib.
Spawnable
For static namespaces, the init response will be managed by the user. However, for dynamic namespaces, the socket.io client will manage the response. As it does not know the type of the response, the spawnable trait is used to spawn the response. Without the client having to know the type of the response.

Type Aliases§

AckStreamItem
A item yield by the ack stream.
Room
A room identifier