azure_storage_blobs/options/
condition_append_position.rs

1use azure_core::headers::{self, Header};
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
4pub struct ConditionAppendPosition(u64);
5
6impl ConditionAppendPosition {
7    pub fn new(max_size: u64) -> Self {
8        Self(max_size)
9    }
10}
11
12impl From<u64> for ConditionAppendPosition {
13    fn from(n: u64) -> Self {
14        Self(n)
15    }
16}
17
18impl Header for ConditionAppendPosition {
19    fn name(&self) -> headers::HeaderName {
20        "x-ms-blob-condition-appendpos".into()
21    }
22
23    fn value(&self) -> headers::HeaderValue {
24        self.0.to_string().into()
25    }
26}