azure_storage_blobs/options/
condition_append_position.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 azure_core::headers::{self, Header};

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

impl ConditionAppendPosition {
    pub fn new(max_size: u64) -> Self {
        Self(max_size)
    }
}

impl From<u64> for ConditionAppendPosition {
    fn from(n: u64) -> Self {
        Self(n)
    }
}

impl Header for ConditionAppendPosition {
    fn name(&self) -> headers::HeaderName {
        "x-ms-blob-condition-appendpos".into()
    }

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