1/*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 */
56#[derive(Debug)]
7#[non_exhaustive]
8pub(crate) enum Phase {
9/// Represents the phase of an operation prior to serialization.
10BeforeSerialization,
11/// Represents the phase of an operation where the request is serialized.
12Serialization,
13/// Represents the phase of an operation prior to transmitting a request over the network.
14BeforeTransmit,
15/// Represents the phase of an operation where the request is transmitted over the network.
16Transmit,
17/// Represents the phase of an operation prior to parsing a response.
18BeforeDeserialization,
19/// Represents the phase of an operation where the response is parsed.
20Deserialization,
21/// Represents the phase of an operation after parsing a response.
22AfterDeserialization,
23}
2425impl Phase {
26pub(crate) fn is_before_serialization(&self) -> bool {
27matches!(self, Self::BeforeSerialization)
28 }
2930pub(crate) fn is_serialization(&self) -> bool {
31matches!(self, Self::Serialization)
32 }
3334pub(crate) fn is_before_transmit(&self) -> bool {
35matches!(self, Self::BeforeTransmit)
36 }
3738pub(crate) fn is_transmit(&self) -> bool {
39matches!(self, Self::Transmit)
40 }
4142pub(crate) fn is_before_deserialization(&self) -> bool {
43matches!(self, Self::BeforeDeserialization)
44 }
4546pub(crate) fn is_deserialization(&self) -> bool {
47matches!(self, Self::Deserialization)
48 }
4950pub(crate) fn is_after_deserialization(&self) -> bool {
51matches!(self, Self::AfterDeserialization)
52 }
53}