Skip to main content

jsonld_syntax/context/definition/
import.rs

1use std::hash::Hash;
2
3#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
4/// The `@import` key of a context definition, as a type of its own.
5pub struct Import;
6
7impl Import {
8    /// Returns `"@import"`.
9    #[must_use]
10    pub fn into_str(self) -> &'static str {
11        "@import"
12    }
13}
14
15#[allow(clippy::derived_hash_with_manual_eq)]
16impl Hash for Import {
17    fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
18        self.into_str().hash(state);
19    }
20}