Trait merfolk::interfaces::Frontend [−][src]
The Frontend
is responsible for processing incomming RPCs and for passing on outgoing RPCs to the Backend
.
The Frontend
provides a way to make calls on the client side and a way to register procedures on the server side.
Incomming RPCs
The Frontend
is acting as server.
Incomming Call
<Intermediate
>
s are received from the Backend
.
The calls are deserialized via Backend::deserialize
to the correct type.
The calls are processed and the replys serialized via Backend::serialize
and passed on to the Backend
as Reply
<Intermediate
>
.
Outgoing RPCs
The Frontend
is acting as client.
The Frontend
serializes the calls via Backend::serialize
and passes them to the Backend
as Call
<Intermediate
>
.
The replies are received from the Backend
deserialized via Backend::deserialize
passed on as response.
Examples
For examples look at the provided Frontend
s:
Associated Types
Loading content...Required methods
fn register<T>(&mut self, caller: T) -> Result<()> where
T: Fn(Call<<Self::Backend as Backend>::Intermediate>) -> Result<Reply<<Self::Backend as Backend>::Intermediate>> + Send + Sync + 'static,
[src]
T: Fn(Call<<Self::Backend as Backend>::Intermediate>) -> Result<Reply<<Self::Backend as Backend>::Intermediate>> + Send + Sync + 'static,
Registers the client callback function from Mer
. The callback is used to pass outgoing Call
s to the Backend
.
fn receive(
&self,
call: Call<<Self::Backend as Backend>::Intermediate>
) -> Result<Reply<<Self::Backend as Backend>::Intermediate>>
[src]
&self,
call: Call<<Self::Backend as Backend>::Intermediate>
) -> Result<Reply<<Self::Backend as Backend>::Intermediate>>