Define regular link.
This commit is contained in:
parent
fd45e4381c
commit
66befc66a9
@ -1,6 +1,11 @@
|
||||
pub trait Source<'s> {
|
||||
fn get_source(&'s self) -> &'s str;
|
||||
}
|
||||
|
||||
pub enum Object<'s> {
|
||||
TextMarkup(TextMarkup<'s>),
|
||||
PlainText(PlainText<'s>),
|
||||
RegularLink(RegularLink<'s>),
|
||||
}
|
||||
|
||||
pub struct TextMarkup<'s> {
|
||||
@ -11,8 +16,8 @@ pub struct PlainText<'s> {
|
||||
pub source: &'s str,
|
||||
}
|
||||
|
||||
pub trait Source<'s> {
|
||||
fn get_source(&'s self) -> &'s str;
|
||||
pub struct RegularLink<'s> {
|
||||
pub source: &'s str,
|
||||
}
|
||||
|
||||
impl<'s> Source<'s> for Object<'s> {
|
||||
@ -20,6 +25,7 @@ impl<'s> Source<'s> for Object<'s> {
|
||||
match self {
|
||||
Object::TextMarkup(obj) => obj.source,
|
||||
Object::PlainText(obj) => obj.source,
|
||||
Object::RegularLink(obj) => obj.source,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user