Merge serde attributes
This commit is contained in:
parent
cf40608b78
commit
abc5b5d446
@ -23,8 +23,11 @@ ruma_api! {
|
||||
request {
|
||||
/// The time (in milliseconds) to wait when downloading keys from remote servers.
|
||||
/// 10 seconds is the recommended default.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[serde(default, with = "crate::serde::duration::opt_ms")]
|
||||
#[serde(
|
||||
with = "crate::serde::duration::opt_ms",
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none",
|
||||
)]
|
||||
pub timeout: Option<Duration>,
|
||||
|
||||
/// The keys to be claimed.
|
||||
|
@ -21,8 +21,11 @@ ruma_api! {
|
||||
request {
|
||||
/// The time (in milliseconds) to wait when downloading keys from remote servers.
|
||||
/// 10 seconds is the recommended default.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[serde(default, with = "crate::serde::duration::opt_ms")]
|
||||
#[serde(
|
||||
with = "crate::serde::duration::opt_ms",
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none",
|
||||
)]
|
||||
pub timeout: Option<Duration>,
|
||||
|
||||
/// The keys to be downloaded. An empty list indicates all devices for the corresponding user.
|
||||
|
@ -30,8 +30,11 @@ ruma_api! {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub currently_active: Option<bool>,
|
||||
/// The length of time in milliseconds since an action was performed by the user.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[serde(default, with = "crate::serde::duration::opt_ms")]
|
||||
#[serde(
|
||||
with = "crate::serde::duration::opt_ms",
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none",
|
||||
)]
|
||||
pub last_active_ago: Option<Duration>,
|
||||
/// The user's presence state.
|
||||
pub presence: PresenceState,
|
||||
|
@ -20,8 +20,11 @@ ruma_api! {
|
||||
#[ruma_api(path)]
|
||||
pub room_id: RoomId,
|
||||
/// The length of time in milliseconds to mark this user as typing.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[serde(default, with = "crate::serde::duration::opt_ms")]
|
||||
#[serde(
|
||||
with = "crate::serde::duration::opt_ms",
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none",
|
||||
)]
|
||||
pub timeout: Option<Duration>,
|
||||
/// Whether the user is typing or not. If `false`, the `timeout` key can be omitted.
|
||||
pub typing: bool,
|
||||
|
@ -44,8 +44,11 @@ mod tests {
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
|
||||
struct DurationTest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[serde(default, with = "crate::serde::duration::opt_ms")]
|
||||
#[serde(
|
||||
with = "crate::serde::duration::opt_ms",
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none"
|
||||
)]
|
||||
timeout: Option<Duration>,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user