Files
natter/src/intermediate/target.rs

27 lines
671 B
Rust
Raw Normal View History

use super::macros::intermediate;
use crate::error::CustomError;
2023-12-21 14:56:58 -05:00
use organic::types::StandardProperties;
2023-10-27 14:54:54 -04:00
2023-10-29 15:36:15 -04:00
#[derive(Debug, Clone)]
2023-10-27 14:54:54 -04:00
pub(crate) struct ITarget {
pub(crate) id: String,
value: String,
2023-12-21 14:56:58 -05:00
pub(crate) post_blank: organic::types::PostBlank,
2023-10-27 14:54:54 -04:00
}
intermediate!(
ITarget,
&'orig organic::types::Target<'parse>,
original,
intermediate_context,
{
let mut registry = intermediate_context.registry.lock().unwrap();
let id = registry.get_target(original.value);
Ok(ITarget {
id: id.clone(),
value: original.value.to_owned(),
2023-12-21 14:56:58 -05:00
post_blank: original.get_post_blank(),
})
}
);