Struct ruma_common::api::Metadata
source · pub struct Metadata {
pub method: Method,
pub rate_limited: bool,
pub authentication: AuthScheme,
pub history: VersionHistory,
}Available on crate feature
api only.Expand description
Metadata about an API endpoint.
Fields§
§method: MethodThe HTTP method used by this endpoint.
rate_limited: boolWhether or not this endpoint is rate limited by the server.
authentication: AuthSchemeWhat authentication scheme the server uses for this endpoint.
history: VersionHistoryAll info pertaining to an endpoint’s (historic) paths, deprecation version, and removal.
Implementations§
source§impl Metadata
impl Metadata
sourcepub fn empty_request_body<B>(&self) -> Bwhere
B: Default + BufMut,
pub fn empty_request_body<B>(&self) -> Bwhere
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 ({}).
Transform the SendAccessToken into an access token if the endpoint requires it, or if it
is SendAccessToken::Force.
Fails if the endpoint requires an access token but the parameter is SendAccessToken::None,
or if the access token can’t be converted to a HeaderValue.
sourcepub fn make_endpoint_url(
&self,
versions: &[MatrixVersion],
base_url: &str,
path_args: &[&dyn Display],
query_string: &str
) -> Result<String, IntoHttpError>
pub fn make_endpoint_url(
&self,
versions: &[MatrixVersion],
base_url: &str,
path_args: &[&dyn Display],
query_string: &str
) -> Result<String, IntoHttpError>
Generate the endpoint URL for this endpoint.