Add regular link.
This commit is contained in:
@@ -1,15 +1,29 @@
|
||||
use crate::error::CustomError;
|
||||
|
||||
use super::registry::Registry;
|
||||
use super::IObject;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct IRegularLink {}
|
||||
pub(crate) struct IRegularLink {
|
||||
pub(crate) path: String,
|
||||
pub(crate) children: Vec<IObject>,
|
||||
}
|
||||
|
||||
impl IRegularLink {
|
||||
pub(crate) async fn new<'parse>(
|
||||
registry: &mut Registry<'parse>,
|
||||
original: &organic::types::RegularLink<'parse>,
|
||||
) -> Result<IRegularLink, CustomError> {
|
||||
Ok(IRegularLink {})
|
||||
let children = {
|
||||
let mut ret = Vec::new();
|
||||
for obj in original.children.iter() {
|
||||
ret.push(IObject::new(registry, obj).await?);
|
||||
}
|
||||
ret
|
||||
};
|
||||
Ok(IRegularLink {
|
||||
path: original.path.as_ref().to_owned(),
|
||||
children,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user