Add a constructor for get_message_events::Request

This commit is contained in:
Jonas Platte 2020-07-03 22:06:47 +02:00
parent ba95fd6c4e
commit 9ecc7c11cf
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 12 additions and 1 deletions

View File

@ -24,7 +24,9 @@ Improvements:
* Add method `into_event_content` for `r0::room::create_room::CreationContent`
* Add room visibility endpoints: `r0::directory::{get_room_visibility, set_room_visibility}`.
* Add is_empty helpers for structs in `r0::sync::sync_events`
* Add a constructor for `r0::room::create_room::Request`
* Add a constructor for request structs of the followign endpoints
* `r0::room::create_room`
* `r0::message::get_message_events`
Deprecations:

View File

@ -82,6 +82,15 @@ ruma_api! {
error: crate::Error
}
impl Request {
/// Creates a `Request` with the given parameters.
///
/// All other parameters will be defaulted.
pub fn new(room_id: RoomId, from: String, dir: Direction) -> Self {
Self { room_id, from, to: None, dir, limit: default_limit(), filter: None }
}
}
fn default_limit() -> UInt {
uint!(10)
}