rosetta_types/direction.rs
1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Direction : Used by RelatedTransaction to indicate the direction of the relation (i.e. cross-shard/cross-network sends may reference `backward` to an earlier transaction and async execution may reference `forward`). Can be used to indicate if a transaction relation is from child to parent or the reverse.
12
13/// Used by RelatedTransaction to indicate the direction of the relation (i.e. cross-shard/cross-network sends may reference `backward` to an earlier transaction and async execution may reference `forward`). Can be used to indicate if a transaction relation is from child to parent or the reverse.
14#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
15pub enum Direction {
16 #[serde(rename = "forward")]
17 Forward,
18 #[serde(rename = "backward")]
19 Backward,
20}
21
22impl ToString for Direction {
23 fn to_string(&self) -> String {
24 match self {
25 Self::Forward => String::from("forward"),
26 Self::Backward => String::from("backward"),
27 }
28 }
29}
30
31impl Default for Direction {
32 fn default() -> Direction {
33 Self::Forward
34 }
35}