ferroui-remote-protocol 0.3.0

The remote protocol of FerroUI: the messages of the previewer and of remote rendering, their BSON serialization and the transports that carry them
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::error::Error;
use crate::guid::Guid;
use crate::metsys_bson::ClassType;

/// 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.
pub trait IMessageTypeResolver: Send + Sync {
    fn get_by_guid(&self, id: Guid) -> Result<&'static ClassType, Error>;
    fn get_guid(&self, ty: &'static ClassType) -> Result<Guid, Error>;
}