Function vfs::service::endpoint

source ยท
pub fn endpoint<Open>(open: Open) -> Arc<Service>
where Open: Fn(ExecutionScope, Channel) + Send + Sync + 'static,
Expand description

Constructs a node in your file system that will host a service.

This is a lower level version of host, which you should prefer if it matches your use case. Unlike host, endpoint uses a callback that will just consume the server side of the channel when it is connected to the service node. It is up to the implementer of the open callback to decide how to interpret the channel (allowing for non-static protocol selection) and/or where the processing of the messages received over the channel will occur (but the ExecutionScope connected to the connection is provided every time).