natter/src/intermediate/regular_link.rs

25 lines
613 B
Rust
Raw Normal View History

use super::macros::intermediate;
2023-10-27 21:48:19 +00:00
use super::registry::Registry;
2023-10-28 00:43:57 +00:00
use super::IObject;
use crate::error::CustomError;
2023-10-27 21:48:19 +00:00
2023-10-29 19:36:15 +00:00
#[derive(Debug, Clone)]
2023-10-28 00:43:57 +00:00
pub(crate) struct IRegularLink {
pub(crate) raw_link: String,
2023-10-28 00:43:57 +00:00
pub(crate) children: Vec<IObject>,
}
2023-10-27 21:48:19 +00:00
intermediate!(IRegularLink, RegularLink, |registry, original| async {
let children = {
let mut ret = Vec::new();
for obj in original.children.iter() {
ret.push(IObject::new(registry, obj).await?);
}
ret
};
Ok(IRegularLink {
raw_link: original.get_raw_link().into_owned(),
children,
})
});