azure_core/request_options/
if_source_match_condition.rs

1use crate::headers::{self, Header};
2
3#[derive(Debug, Clone, PartialEq, Eq)]
4pub enum IfSourceMatchCondition {
5    Match(String),
6    NotMatch(String),
7}
8
9impl Header for IfSourceMatchCondition {
10    fn name(&self) -> headers::HeaderName {
11        match self {
12            IfSourceMatchCondition::Match(_) => headers::SOURCE_IF_MATCH,
13            IfSourceMatchCondition::NotMatch(_) => headers::SOURCE_IF_NONE_MATCH,
14        }
15    }
16
17    fn value(&self) -> headers::HeaderValue {
18        match self.clone() {
19            IfSourceMatchCondition::Match(etag) | IfSourceMatchCondition::NotMatch(etag) => {
20                etag.into()
21            }
22        }
23    }
24}