Skip to main content

FedTransport

Trait FedTransport 

Source
pub trait FedTransport: Send + Sync {
    // Required method
    fn request<'a>(
        &'a self,
        destination: &'a str,
        method: &'a str,
        uri: &'a str,
        authorization: &'a str,
        body: Option<&'a Value>,
    ) -> ReqFuture<'a>;

    // Provided method
    fn request_raw<'a>(
        &'a self,
        _destination: &'a str,
        _method: &'a str,
        _uri: &'a str,
        _authorization: &'a str,
        _max_bytes: usize,
    ) -> RawFuture<'a> { ... }
}
Expand description

Sends one signed federation request and returns (status, json body). uri is the full path and query including /_matrix.

Required Methods§

Source

fn request<'a>( &'a self, destination: &'a str, method: &'a str, uri: &'a str, authorization: &'a str, body: Option<&'a Value>, ) -> ReqFuture<'a>

Deliver to destination; authorization is the complete X-Matrix header value.

Provided Methods§

Source

fn request_raw<'a>( &'a self, _destination: &'a str, _method: &'a str, _uri: &'a str, _authorization: &'a str, _max_bytes: usize, ) -> RawFuture<'a>

Like request but for a binary answer (media): the raw body, capped at max_bytes (a longer body is an error). Transports that cannot do it say so.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§