hopr_transport_protocol/ticket_aggregation/
config.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::time::Duration;

use serde::{Deserialize, Serialize};
use serde_with::{serde_as, DurationSeconds};
use validator::Validate;

/// Configuration for the `ticket_aggregation` protocol.
#[serde_as]
#[derive(Debug, Copy, Clone, smart_default::SmartDefault, Validate, Serialize, Deserialize, Eq, PartialEq)]
pub struct TicketAggregationProtocolConfig {
    /// Maximum duration before the request times out
    #[serde_as(as = "DurationSeconds<u64>")]
    #[default(Duration::from_secs(15))]
    pub timeout: Duration,
}