Struct matrix_sdk_base::ruma::api::Metadata
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§
§impl Metadata
impl Metadata
pub 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
.
pub 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§
Auto Trait Implementations§
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