Skip to main content

Metadata

Trait Metadata 

Source
pub trait Metadata: Sized {
    type Authentication: AuthScheme;
    type PathBuilder: PathBuilder;

    const METHOD: Method;
    const RATE_LIMITED: bool;
    const PATH_BUILDER: Self::PathBuilder;

    // Provided methods
    fn empty_request_body<B>() -> B
       where B: Default + BufMut { ... }
    fn make_endpoint_url(
        path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>,
        base_url: &str,
        path_args: &[&dyn Display],
        query_string: &str,
    ) -> Result<String, IntoHttpError> { ... }
}
Available on crate feature api only.
Expand description

Metadata about an API endpoint.

Required Associated Constants§

Source

const METHOD: Method

The HTTP method used by this endpoint.

Source

const RATE_LIMITED: bool

Whether or not this endpoint is rate limited by the server.

Source

const PATH_BUILDER: Self::PathBuilder

All info pertaining to an endpoint’s path.

Required Associated Types§

Source

type Authentication: AuthScheme

What authentication scheme the server uses for this endpoint.

Source

type PathBuilder: PathBuilder

The type used to build an endpoint’s path.

Provided Methods§

Source

fn empty_request_body<B>() -> B
where B: Default + BufMut,

Returns an empty request body for this Matrix request.

For GET requests, it returns an entirely empty buffer, for others it returns an empty JSON object ({}).

Source

fn make_endpoint_url( path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>, base_url: &str, path_args: &[&dyn Display], query_string: &str, ) -> Result<String, IntoHttpError>

Generate the endpoint URL for this endpoint.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§