rdf_model/
base_direction.rs1#[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
7#[cfg_attr(
8 feature = "borsh",
9 derive(borsh::BorshSerialize, borsh::BorshDeserialize)
10)]
11#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12pub enum BaseDirection {
13 #[default]
15 Ltr,
16
17 Rtl,
19}
20
21impl BaseDirection {
22 pub fn as_str(&self) -> &'static str {
23 match self {
24 Self::Ltr => "ltr",
25 Self::Rtl => "rtl",
26 }
27 }
28}
29
30#[cfg(feature = "oxrdf")]
31impl From<oxrdf::BaseDirection> for BaseDirection {
32 fn from(input: oxrdf::BaseDirection) -> Self {
33 use oxrdf::BaseDirection::*;
34 match input {
35 Ltr => Self::Ltr,
36 Rtl => Self::Rtl,
37 }
38 }
39}
40
41#[cfg(feature = "oxrdf")]
42impl From<BaseDirection> for oxrdf::BaseDirection {
43 fn from(input: BaseDirection) -> Self {
44 use BaseDirection::*;
45 match input {
46 Ltr => Self::Ltr,
47 Rtl => Self::Rtl,
48 }
49 }
50}