azure_core/request_options/
lease_break_period.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use crate::headers::{self, Header};
use std::time::Duration;

#[derive(Debug, Clone, Copy)]
pub struct LeaseBreakPeriod(Duration);

impl From<Duration> for LeaseBreakPeriod {
    fn from(duration: Duration) -> Self {
        Self(duration)
    }
}

impl Header for LeaseBreakPeriod {
    fn name(&self) -> headers::HeaderName {
        headers::LEASE_BREAK_PERIOD
    }

    fn value(&self) -> headers::HeaderValue {
        format!("{}", self.0.as_secs()).into()
    }
}