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: Method
The HTTP method used by this endpoint.
rate_limited: bool
Whether or not this endpoint is rate limited by the server.
authentication: AuthScheme
What authentication scheme the server uses for this endpoint.
history: VersionHistory
All 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) -> B
pub fn empty_request_body<B>(&self) -> B
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.
Trait Implementations§
impl Eq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.