Skip to main content

Crate ferroui_remote_protocol

Crate ferroui_remote_protocol 

Source
Expand description

The remote protocol: the wire protocol of the previewer and of remote rendering.

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.IsEnum and Enum.GetUnderlyingType. The enumeration is #[repr(i32)], Copy, and has fn 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.
BsonTcpTransport
The transport of the protocol over TCP: BSON messages over the stream of a socket.
DefaultMessageTypeResolver
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.
DisposableServer
DisposableServer: what TcpTransportBase::listen returns. Disposing it stops the listening; connections that were accepted stay open. As in the original, a server that is never disposed keeps listening.
ExportedType
An exported type of an assembly with the identifier attribute it carries.
FerroRemoteMessageGuidAttribute
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.
HandlerToken
What adding a handler returns and removing it takes: the identity of a delegate in event -= handler.
HtmlTransportStartedMessage
Task
The result of an operation that completes on another thread. A clone is another handle of the same operation.
TaskCompletionSource
TaskCompletionSource<int> of the upstream code: the producing side of a Task.
TransportConnectionWrapper
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§

FerroRemoteMessage
A class that carries the attribute: the counterpart of GetCustomAttribute<FerroRemoteMessageGuidAttribute>() on a type. ferro_remote_message_guid! puts the attribute on a class.
IFerroRemoteTransportConnection
A connection to the other end of the protocol.
IMessageTypeResolver
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 KeyNotFoundException in the original and Error::KeyNotFound here.
TcpTransportBase
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 is Clone because 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§

DisposeCallback
What a connection calls when it is disposed.
ExceptionHandler
A handler of the exception event.
Handler
Action<IFerroRemoteTransportConnection, T>: a handler of an event of a connection.
Message
A message of the protocol: object in the signatures of the original. The class of a received message is found with message.downcast_ref::<MeasureViewportMessage>().
MessageHandler
A handler of the message event.