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 make_endpoint_url(
path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>,
base_url: &str,
path_args: &[&dyn Display],
query_string: &str,
) -> Result<String, IntoHttpError> { ... }
fn required_client_scopes() -> &'static [OAuthClientScope]
where Self::Authentication: ClientScopedAuthScheme { ... }
}api only.Expand description
Metadata about an API endpoint.
Required Associated Constants§
Sourceconst RATE_LIMITED: bool
const RATE_LIMITED: bool
Whether or not this endpoint is rate limited by the server.
Sourceconst PATH_BUILDER: Self::PathBuilder
const PATH_BUILDER: Self::PathBuilder
All info pertaining to an endpoint’s path.
Required Associated Types§
Sourcetype Authentication: AuthScheme
type Authentication: AuthScheme
What authentication scheme the server uses for this endpoint.
Sourcetype PathBuilder: PathBuilder
type PathBuilder: PathBuilder
The type used to build an endpoint’s path.
Provided Methods§
Sourcefn make_endpoint_url(
path_builder_input: <Self::PathBuilder as PathBuilder>::Input<'_>,
base_url: &str,
path_args: &[&dyn Display],
query_string: &str,
) -> Result<String, IntoHttpError>
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.
Sourcefn required_client_scopes() -> &'static [OAuthClientScope]where
Self::Authentication: ClientScopedAuthScheme,
fn required_client_scopes() -> &'static [OAuthClientScope]where
Self::Authentication: ClientScopedAuthScheme,
The OAuth scopes which grant access to this endpoint.
Clients which authenticated using the OAuth 2.0 API may only use this endpoint
if they requested any one of the scopes in the returned slice. For most endpoints,
this is only OAuthClientScope::ApiFullAccess.
This function is only defined for request structs with an authentication scheme
that implements the ClientScopedAuthScheme marker trait.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".