ferroui_remote_protocol/lib.rs
1//! The remote protocol: the wire protocol of the previewer and of remote
2//! rendering.
3//!
4//! - The messages ([`viewport`], [`input`], [`designer`] and
5//! [`HtmlTransportStartedMessage`]). Each message class has an identifier
6//! ([`FerroRemoteMessageGuidAttribute`]) by which the two ends name it; a
7//! resolver ([`IMessageTypeResolver`], [`DefaultMessageTypeResolver`])
8//! maps identifiers to classes.
9//! - The serialization of a message as a BSON document ([`metsys_bson`]).
10//! - The transports: the contract of a connection
11//! ([`IFerroRemoteTransportConnection`], whose module states the threading
12//! contract of the port), the connection over a pair of byte streams, the
13//! transport over TCP ([`BsonTcpTransport`], [`TcpTransportBase`]) and the
14//! wrapper that stashes events and queues sends
15//! ([`TransportConnectionWrapper`]).
16//!
17//! The library is a leaf, as the upstream project is: it uses nothing of the
18//! framework, so that a tool that only talks the protocol can use it alone.
19
20pub mod metsys_bson;
21
22mod assembly;
23mod bson_stream_transport;
24mod bson_tcp_transport;
25mod default_message_type_resolver;
26mod design_messages;
27mod error;
28mod event_stash;
29mod ferro_remote_message_guid_attribute;
30mod guid;
31mod i_message_type_resolver;
32mod i_transport;
33mod input_messages;
34mod task;
35mod tcp_transport_base;
36mod transport_connection_wrapper;
37mod transport_messages;
38mod viewport_messages;
39
40// The two key enumerations of the base library are compiled into this
41// library, as the upstream project file does (`<Compile Include>` of
42// `Input/Key.cs` and `Input/PhysicalKey.cs`, which put the types in the
43// input namespace of the protocol when they are built here): the library
44// stays a leaf. The two files under `input/` are copies of the files of the
45// base library, because a published crate is built from its package, which
46// holds no file of another crate; a test keeps the copies identical to their
47// originals (`tests/remote_protocol_tests.rs`), so the numbers of the keys
48// cannot drift apart.
49#[path = "input/key.rs"]
50mod key;
51#[path = "input/physical_key.rs"]
52mod physical_key;
53
54#[cfg(test)]
55mod metsys_bson_tests;
56
57/// `FerroUI.Remote.Protocol.Viewport`.
58pub mod viewport {
59 pub use crate::viewport_messages::*;
60}
61
62/// `FerroUI.Remote.Protocol.Input`.
63pub mod input {
64 pub use crate::input_messages::*;
65 pub use crate::key::{Key, ParseKeyError};
66 pub use crate::physical_key::{ParsePhysicalKeyError, PhysicalKey};
67}
68
69/// `FerroUI.Remote.Protocol.Designer`.
70pub mod designer {
71 pub use crate::design_messages::*;
72}
73
74pub use assembly::{Assembly, ExportedType, ASSEMBLY};
75pub use bson_tcp_transport::BsonTcpTransport;
76pub use default_message_type_resolver::DefaultMessageTypeResolver;
77pub use error::Error;
78pub use ferro_remote_message_guid_attribute::{FerroRemoteMessage, FerroRemoteMessageGuidAttribute};
79pub use guid::Guid;
80pub use i_message_type_resolver::IMessageTypeResolver;
81pub use i_transport::{
82 exception_handler, message_handler, Delegate, ExceptionHandler, Handler, HandlerToken,
83 IFerroRemoteTransportConnection, Message, MessageHandler,
84};
85pub use task::{Task, TaskCompletionSource};
86pub use tcp_transport_base::{DisposableServer, DisposeCallback, TcpTransportBase};
87pub use transport_connection_wrapper::TransportConnectionWrapper;
88pub use transport_messages::HtmlTransportStartedMessage;