azure_core/request_options/
lease_break_period.rs

1use crate::headers::{self, Header};
2use std::time::Duration;
3
4#[derive(Debug, Clone, Copy)]
5pub struct LeaseBreakPeriod(Duration);
6
7impl From<Duration> for LeaseBreakPeriod {
8    fn from(duration: Duration) -> Self {
9        Self(duration)
10    }
11}
12
13impl Header for LeaseBreakPeriod {
14    fn name(&self) -> headers::HeaderName {
15        headers::LEASE_BREAK_PERIOD
16    }
17
18    fn value(&self) -> headers::HeaderValue {
19        format!("{}", self.0.as_secs()).into()
20    }
21}