azure_core/request_options/
sequence_number.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use crate::headers::{self, Header};

#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord)]
pub struct SequenceNumber(u64);

impl SequenceNumber {
    pub fn new(max_results: u64) -> Self {
        Self(max_results)
    }
}

impl From<u64> for SequenceNumber {
    fn from(max_results: u64) -> Self {
        Self::new(max_results)
    }
}

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

    fn value(&self) -> headers::HeaderValue {
        self.0.to_string().into()
    }
}