diff --git a/src/core.rs b/src/core.rs index 3351038..c8a7747 100644 --- a/src/core.rs +++ b/src/core.rs @@ -4,6 +4,7 @@ mod addresses; mod hashing; +mod origin; mod point; mod points; mod resolution; @@ -17,6 +18,7 @@ use crate::func::*; pub use self::addresses::*; pub use self::hashing::*; +pub use self::origin::*; pub use self::point::*; pub use self::points::TakesPoints; pub use self::resolution::*; @@ -97,16 +99,6 @@ pub trait Factory<'a, Ctx: 'a + Context>: 'a + Send + Sync + Clone { fn unexpected_tail(&self, tail: &[u8]) -> Self::ParseError; } -/// Represents a potentially resolvable [`Mentionable`]. -pub trait Origin<'a, Ctx: 'a + Context>: 'a { - /// Type of the associated object. - type Mtbl: Mentionable<'a, Ctx>; - /// Value of the associated factory. - fn factory(&self) -> >::Fctr; - /// Try resolving the value. - fn resolve(self: Rc) -> Resolution<'a, Ctx, Self::Mtbl>; -} - /// Extension trait for factories. pub trait ExtFactory<'a, Ctx: 'a + Context>: Factory<'a, Ctx> { /// Parse the object from a slice. diff --git a/src/core/origin.rs b/src/core/origin.rs new file mode 100644 index 0000000..7bdade0 --- /dev/null +++ b/src/core/origin.rs @@ -0,0 +1,11 @@ +use super::*; + +/// Represents a potentially resolvable [`Mentionable`]. +pub trait Origin<'a, Ctx: 'a + Context>: 'a { + /// Type of the associated object. + type Mtbl: Mentionable<'a, Ctx>; + /// Value of the associated factory. + fn factory(&self) -> >::Fctr; + /// Try resolving the value. + fn resolve(self: Rc) -> Resolution<'a, Ctx, Self::Mtbl>; +}