Setting up ServiceItem to lisp Value

This commit is contained in:
Chris Cochrun 2025-02-18 17:03:08 -06:00
parent 31a18fd9e1
commit 614630bea8

View file

@ -56,13 +56,23 @@ impl AsMimeTypes for ServiceItem {
&self, &self,
mime_type: &str, mime_type: &str,
) -> Option<std::borrow::Cow<'static, [u8]>> { ) -> Option<std::borrow::Cow<'static, [u8]>> {
todo!();
debug!(?self); debug!(?self);
debug!(mime_type); debug!(mime_type);
Some(Cow::from( let val = Value::from(self);
r#"(slide :background (image :source "~/pics/frodo.jpg" :fit fill) let val = String::from(val);
(text "This is frodo" :font-size 70))"#.to_string().into_bytes() Some(Cow::from(val.into_bytes()))
)) }
}
impl From<&ServiceItem> for Value {
fn from(value: &ServiceItem) -> Self {
match &value.kind {
ServiceItemKind::Song(song) => todo!(),
ServiceItemKind::Video(video) => todo!(),
ServiceItemKind::Image(image) => todo!(),
ServiceItemKind::Presentation(presentation) => todo!(),
ServiceItemKind::Content(slide) => todo!(),
}
} }
} }