api: Make Clone a supertrait of OutgoingRequest

Allow to retry a request.
This commit is contained in:
Kévin Commaille 2022-07-30 14:38:17 +02:00 committed by Kévin Commaille
parent 04a32fe010
commit 8e2c4b5cb7
3 changed files with 3 additions and 2 deletions

View File

@ -26,6 +26,7 @@ Breaking changes:
* Split `RoomId` matrix URI constructors between methods with and without routing
* Allow to add routing servers to `RoomId::matrix_to_event_uri()`
* Move `receipt::ReceiptType` to `events::receipt`
* Make `Clone` as supertrait of `api::OutgoingRequest`
[spec]: https://github.com/matrix-org/matrix-spec-proposals/pull/3669

View File

@ -240,7 +240,7 @@ impl<'a> SendAccessToken<'a> {
}
/// A request type for a Matrix API endpoint, used for sending requests.
pub trait OutgoingRequest: Sized {
pub trait OutgoingRequest: Sized + Clone {
/// A type capturing the expected error conditions the server can return.
type EndpointError: EndpointError;

View File

@ -17,7 +17,7 @@ use ruma_common::{
use serde::{Deserialize, Serialize};
/// A request to create a new room alias.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Request {
pub room_id: OwnedRoomId, // body
pub room_alias: OwnedRoomAliasId, // path