use crate::error::CustomError; use super::plain_text::IPlainText; use super::registry::Registry; use super::ITarget; #[derive(Debug)] pub(crate) enum IObject { PlainText(IPlainText), Target(ITarget), } impl IObject { pub(crate) fn new<'parse>( registry: &mut Registry<'parse>, obj: &organic::types::Object<'parse>, ) -> Result { match obj { organic::types::Object::Bold(_) => todo!(), organic::types::Object::Italic(_) => todo!(), organic::types::Object::Underline(_) => todo!(), organic::types::Object::StrikeThrough(_) => todo!(), organic::types::Object::Code(_) => todo!(), organic::types::Object::Verbatim(_) => todo!(), organic::types::Object::PlainText(inner) => { Ok(IObject::PlainText(IPlainText::new(registry, inner)?)) } organic::types::Object::RegularLink(_) => todo!(), organic::types::Object::RadioLink(_) => todo!(), organic::types::Object::RadioTarget(_) => todo!(), organic::types::Object::PlainLink(_) => todo!(), organic::types::Object::AngleLink(_) => todo!(), organic::types::Object::OrgMacro(_) => todo!(), organic::types::Object::Entity(_) => todo!(), organic::types::Object::LatexFragment(_) => todo!(), organic::types::Object::ExportSnippet(_) => todo!(), organic::types::Object::FootnoteReference(_) => todo!(), organic::types::Object::Citation(_) => todo!(), organic::types::Object::CitationReference(_) => todo!(), organic::types::Object::InlineBabelCall(_) => todo!(), organic::types::Object::InlineSourceBlock(_) => todo!(), organic::types::Object::LineBreak(_) => todo!(), organic::types::Object::Target(inner) => { Ok(IObject::Target(ITarget::new(registry, inner)?)) } organic::types::Object::StatisticsCookie(_) => todo!(), organic::types::Object::Subscript(_) => todo!(), organic::types::Object::Superscript(_) => todo!(), organic::types::Object::Timestamp(_) => todo!(), } } }