Skip to main content

GotifyHost

Trait GotifyHost 

Source
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§

Source

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.

Source

fn subscriptions(&self) -> Vec<GotifySubscription>

The active subscriptions to match inbound messages against.

Source

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).

Source

fn store_app_index(&self, index: HashMap<String, u64>)

Replace the fetched name->appid index.

Source

fn set_connected(&self, connected: bool)

Record stream liveness for the Inspector’s GOTIFY status line.

Source

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".

Implementors§