natter/src/intermediate/regular_link.rs

35 lines
855 B
Rust
Raw Normal View History

2023-12-21 14:56:58 -05:00
use organic::types::StandardProperties;
use super::macros::intermediate;
2023-10-29 22:31:29 -04:00
2023-10-27 20:43:57 -04:00
use super::IObject;
use crate::error::CustomError;
2023-10-27 17:48:19 -04:00
2023-10-29 15:36:15 -04:00
#[derive(Debug, Clone)]
2023-10-27 20:43:57 -04:00
pub(crate) struct IRegularLink {
pub(crate) raw_link: String,
2023-10-27 20:43:57 -04:00
pub(crate) children: Vec<IObject>,
2023-12-21 14:56:58 -05:00
pub(crate) post_blank: organic::types::PostBlank,
2023-10-27 20:43:57 -04:00
}
2023-10-27 17:48:19 -04:00
intermediate!(
IRegularLink,
&'orig organic::types::RegularLink<'parse>,
original,
intermediate_context,
{
let children = {
let mut ret = Vec::new();
for obj in original.children.iter() {
ret.push(IObject::new(intermediate_context.clone(), obj).await?);
}
ret
};
Ok(IRegularLink {
raw_link: original.get_raw_link().into_owned(),
children,
2023-12-21 14:56:58 -05:00
post_blank: original.get_post_blank(),
})
}
);