Expand description
The remote protocol: the wire protocol of the previewer and of remote rendering.
- The messages (
viewport,input,designerandHtmlTransportStartedMessage). Each message class has an identifier (FerroRemoteMessageGuidAttribute) by which the two ends name it; a resolver (IMessageTypeResolver,DefaultMessageTypeResolver) maps identifiers to classes. - The serialization of a message as a BSON document (
metsys_bson). - The transports: the contract of a connection
(
IFerroRemoteTransportConnection, whose module states the threading contract of the port), the connection over a pair of byte streams, the transport over TCP (BsonTcpTransport,TcpTransportBase) and the wrapper that stashes events and queues sends (TransportConnectionWrapper).
The library is a leaf, as the upstream project is: it uses nothing of the framework, so that a tool that only talks the protocol can use it alone.
Modules§
- designer
FerroUI.Remote.Protocol.Designer.- input
FerroUI.Remote.Protocol.Input.- metsys_
bson - The BSON serializer of the protocol.
- viewport
FerroUI.Remote.Protocol.Viewport.
Macros§
- bson_
class - States the properties of a class for the serializer: the counterpart of the reflection over the properties of a type.
- bson_
enum - States that an enumeration is serialized as its number: the counterpart
of
Type.IsEnumandEnum.GetUnderlyingType. The enumeration is#[repr(i32)],Copy, and hasfn from_value(i32) -> Option<Self>. - ferro_
remote_ message_ guid - Puts the identifier attribute on a message class and gives the class the
identifier as the constant
GUID:
Structs§
- Assembly
- An assembly, as far as a resolver reads one.
- Bson
TcpTransport - The transport of the protocol over TCP: BSON messages over the stream of a socket.
- Default
Message Type Resolver - Delegate
- A multicast delegate: the handlers of an event in the order they were added. Public for the connections that are implemented outside this library (the ones of the designer support), which keep their handlers in one as the connections here do.
- Disposable
Server DisposableServer: whatTcpTransportBase::listenreturns. Disposing it stops the listening; connections that were accepted stay open. As in the original, a server that is never disposed keeps listening.- Exported
Type - An exported type of an assembly with the identifier attribute it carries.
- Ferro
Remote Message Guid Attribute - The identifier of a message class on the wire: the header of every message carries it, and the receiving end finds the class by it.
- Guid
- A 128-bit identifier.
- Handler
Token - What adding a handler returns and removing it takes: the identity of a
delegate in
event -= handler. - Html
Transport Started Message - Task
- The result of an operation that completes on another thread. A clone is another handle of the same operation.
- Task
Completion Source TaskCompletionSource<int>of the upstream code: the producing side of aTask.- Transport
Connection Wrapper - A connection around another one that keeps the events raised before a handler is subscribed, and that queues the messages to send so that any number of threads may send at once.
Enums§
- Error
- What a serializer, a resolver or a transport reports. Each variant is the exception of the same name in the upstream code.
Statics§
- ASSEMBLY
- This library: every message class of the protocol.
Traits§
- Ferro
Remote Message - A class that carries the attribute: the counterpart of
GetCustomAttribute<FerroRemoteMessageGuidAttribute>()on a type.ferro_remote_message_guid!puts the attribute on a class. - IFerro
Remote Transport Connection - A connection to the other end of the protocol.
- IMessage
Type Resolver - Maps the identifier a message carries on the wire to its class and back.
An identifier or a class the resolver does not know is a
KeyNotFoundExceptionin the original andError::KeyNotFoundhere. - TcpTransport
Base - A transport over TCP sockets. The abstract class of the original is a
trait: an implementor holds the resolver its constructor is given
(
TcpTransportBase::resolver) and makes the connection of a socket (TcpTransportBase::create_transport). It isClonebecause the listener thread keeps one.
Functions§
- exception_
handler - Makes a handler of the exception event from a closure.
- message_
handler - Makes a handler of the message event from a closure.
Type Aliases§
- Dispose
Callback - What a connection calls when it is disposed.
- Exception
Handler - A handler of the exception event.
- Handler
Action<IFerroRemoteTransportConnection, T>: a handler of an event of a connection.- Message
- A message of the protocol:
objectin the signatures of the original. The class of a received message is found withmessage.downcast_ref::<MeasureViewportMessage>(). - Message
Handler - A handler of the message event.