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