From 49cf3205c4c3dfe7008394a35fbef5f57b246b9d Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 20 Mar 2024 05:44:40 +0100 Subject: [PATCH] feat: plce and profile --- src/activitystream/object/place.rs | 17 +++++++++++++++++ src/activitystream/object/profile.rs | 8 ++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/activitystream/object/place.rs create mode 100644 src/activitystream/object/profile.rs diff --git a/src/activitystream/object/place.rs b/src/activitystream/object/place.rs new file mode 100644 index 00000000..9c63f35e --- /dev/null +++ b/src/activitystream/object/place.rs @@ -0,0 +1,17 @@ +pub trait Place : super::Object { + fn accuracy(&self) -> Option { None } + fn altitude(&self) -> Option { None } + fn latitude(&self) -> Option { None } + fn longitude(&self) -> Option { None } + fn radius(&self) -> Option { None } + fn units(&self) -> Option<&str> { None } +} + +pub trait PlaceMut : super::ObjectMut { + fn set_accuracy(&mut self, val: Option) -> &mut Self; + fn set_altitude(&mut self, val: Option) -> &mut Self; + fn set_latitude(&mut self, val: Option) -> &mut Self; + fn set_longitude(&mut self, val: Option) -> &mut Self; + fn set_radius(&mut self, val: Option) -> &mut Self; + fn set_units(&mut self, val: Option<&str>) -> &mut Self; +} diff --git a/src/activitystream/object/profile.rs b/src/activitystream/object/profile.rs new file mode 100644 index 00000000..2099b1e4 --- /dev/null +++ b/src/activitystream/object/profile.rs @@ -0,0 +1,8 @@ +pub trait Profile : super::Object { + // not a Node because it's always embedded and one + fn describes(&self) -> Option { None:: } +} + +impl Profile for serde_json::Value { + +}