pub struct CallbackServer { /* private fields */ }Expand description
The server. Clones share state.
Implementations§
Source§impl CallbackServer
impl CallbackServer
pub fn new(config: CallbackConfig) -> Self
Sourcepub fn host_context(
&self,
source_id: &str,
hosted: HostedContext,
) -> Result<(), String>
pub fn host_context( &self, source_id: &str, hosted: HostedContext, ) -> Result<(), String>
Host a context source under source_id, replacing any hosted there.
A replacement changes the describe digest, which clients that
described before then see as describe_mismatch.
Sourcepub fn host_acquisition(
&self,
source_id: &str,
source: Arc<dyn AcquisitionSource>,
) -> Result<(), String>
pub fn host_acquisition( &self, source_id: &str, source: Arc<dyn AcquisitionSource>, ) -> Result<(), String>
Serve acquisitions for the context source hosted under source_id,
replacing any served there: describe then carries the source’s
descriptor with its SourceId (3.10.1), so the describe digest
changes. The context source must be hosted first, and no other hosted
source may carry the same SourceId.
Sourcepub fn host_sink(&self, hosted: HostedSink) -> Result<(), String>
pub fn host_sink(&self, hosted: HostedSink) -> Result<(), String>
Host the evidence sink, replacing any hosted before.
Sourcepub fn dispatched(&self) -> u64
pub fn dispatched(&self) -> u64
Hosted calls started so far: fetches, acquisitions and deliveries.
Sourcepub fn describe_digest(&self) -> Result<ContentDigest, String>
pub fn describe_digest(&self) -> Result<ContentDigest, String>
The digest of the describe answer clients receive now.
Sourcepub fn publish_invalidation(
&self,
source_id: &str,
kind: InvalidationKind,
fields: Vec<String>,
scope: InvalidationScope,
) -> Result<u64, String>
pub fn publish_invalidation( &self, source_id: &str, kind: InvalidationKind, fields: Vec<String>, scope: InvalidationScope, ) -> Result<u64, String>
Record an invalidation for pollers (3.10.6) and return its sequence number, strictly increasing across every source this server hosts.
Sourcepub fn serve(
&self,
listener: TcpListener,
tls: Option<Arc<ServerConfig>>,
) -> Result<CallbackHandle>
pub fn serve( &self, listener: TcpListener, tls: Option<Arc<ServerConfig>>, ) -> Result<CallbackHandle>
Serve on listener. Plain HTTP is refused for a non-loopback
address unless tls is given (3.10).
Sourcepub fn serve_unix(&self, listener: UnixListener) -> CallbackHandle
pub fn serve_unix(&self, listener: UnixListener) -> CallbackHandle
Serve a Unix socket listener; its file permissions authenticate.
Sourcepub async fn serve_loopback(&self) -> Result<CallbackHandle>
pub async fn serve_loopback(&self) -> Result<CallbackHandle>
Bind 127.0.0.1:0 and serve plain HTTP: the loopback setting.