azure_core/request_options/
if_source_match_condition.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
use crate::headers::{self, Header};

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum IfSourceMatchCondition {
    Match(String),
    NotMatch(String),
}

impl Header for IfSourceMatchCondition {
    fn name(&self) -> headers::HeaderName {
        match self {
            IfSourceMatchCondition::Match(_) => headers::SOURCE_IF_MATCH,
            IfSourceMatchCondition::NotMatch(_) => headers::SOURCE_IF_NONE_MATCH,
        }
    }

    fn value(&self) -> headers::HeaderValue {
        match self.clone() {
            IfSourceMatchCondition::Match(etag) | IfSourceMatchCondition::NotMatch(etag) => {
                etag.into()
            }
        }
    }
}