pub trait GotifyHost: Send + Sync {
// Required methods
fn http_client(&self, timeout: Duration) -> Result<Client, String>;
fn subscriptions(&self) -> Vec<GotifySubscription>;
fn app_name(&self, appid: u64) -> Option<String>;
fn store_app_index(&self, index: HashMap<String, u64>);
fn set_connected(&self, connected: bool);
fn deliver(
&self,
subscription: &GotifySubscription,
app: &str,
message: &GotifyMessage,
);
}Expand description
The host port, implemented by forge-workspace. The only workspace-side state, delivery or TLS-trust plumbing a connector may reach, so this crate stays stream + mapping.
Required Methods§
Sourcefn http_client(&self, timeout: Duration) -> Result<Client, String>
fn http_client(&self, timeout: Duration) -> Result<Client, String>
A reqwest client with the NODE_EXTRA_CA_CERTS roots applied and the caller’s timeout baked in.
Sourcefn subscriptions(&self) -> Vec<GotifySubscription>
fn subscriptions(&self) -> Vec<GotifySubscription>
The active subscriptions to match inbound messages against.
Sourcefn app_name(&self, appid: u64) -> Option<String>
fn app_name(&self, appid: u64) -> Option<String>
The application NAME for appid via the app index, or None
when the id isn’t known (index not yet fetched, or a new app
the server added after the last refresh).
Sourcefn store_app_index(&self, index: HashMap<String, u64>)
fn store_app_index(&self, index: HashMap<String, u64>)
Replace the fetched name->appid index.
Sourcefn set_connected(&self, connected: bool)
fn set_connected(&self, connected: bool)
Record stream liveness for the Inspector’s GOTIFY status line.
Sourcefn deliver(
&self,
subscription: &GotifySubscription,
app: &str,
message: &GotifyMessage,
)
fn deliver( &self, subscription: &GotifySubscription, app: &str, message: &GotifyMessage, )
Deliver one matched message to its subscriber’s session: dispatch a user-turn into the running target, or buffer + spawn the asleep one.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".