Struct fish::Server[][src]

pub struct Server { /* fields omitted */ }
Expand description

A fully kitted-callback handling server that can handle async communication over HTTP-Webhooks

Implementations

Create a new callback server on the provided address

Example
let fish = Server::start("127.0.0.1:3306");

let hook = fish.spawn();

let _ = async {
    reqwest::get(format!("http://some.api/?callback={}", hook.url())).await
};

// don't forget to spin up the server!
server.await

Create a callback server but with a proxy URL that will forward traffic there. E.g. you could use ngrok to tunnel a public Url to your development server’s fish::Server

Spawn a webhook

Example

let server = Server::new(([127, 0, 0, 1], 3031));
let webhook = server.spawn();
// make your call
// e.g. http_client.body(webhook.url()).send().await
webhook.await

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more