[−][src]Struct fish::Server
A fully kitted-callback handling server that can handle async communication over HTTP-Webhooks
Implementations
impl Server
[src]
pub fn start<A: Into<SocketAddr>>(addr: A) -> Self
[src]
Create a new callback server on the provided address
Example
ⓘThis example is not tested
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
pub fn start_with_proxy<A: Into<SocketAddr>>(addr: A, proxy: Url) -> Self
[src]
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
pub fn spawn(&self) -> Webhook
[src]
Spawn a webhook
Example
ⓘThis example is not tested
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
Auto Trait Implementations
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnwindSafe for Server
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,