15 lines
523 B
Rust
15 lines
523 B
Rust
use super::*;
|
|
|
|
/// Represents a potentially resolvable [`Mentionable`].
|
|
pub trait Origin<'a, Ctx: Context<'a>>: 'a {
|
|
/// Type of the associated object.
|
|
type Mtbl: Mentionable<'a, Ctx>;
|
|
/// Value of the associated factory.
|
|
fn factory(&self) -> OFctr<'a, Ctx, Self>;
|
|
/// Try resolving the value.
|
|
fn resolve(self: Rc<Self>) -> Resolution<'a, Ctx, Self::Mtbl>;
|
|
fn resolve_bytes(self: Rc<Self>) -> HashResolution<'a, Ctx>;
|
|
}
|
|
|
|
pub type OFctr<'a, Ctx, O> = Fctr<'a, Ctx, <O as Origin<'a, Ctx>>::Mtbl>;
|