upub/apb/src/object/place.rs
alemi 520c8eff3a
feat: separated apb types into crate, reworked
no more "impl ..." hell, each trait has associated types so that we know
it's a "Self::Link" or a "Self::Actor", but in practice they can both be
a "serde_json::Value" and thus we can change its type. also Node::Array
is now a Vec<T> rather than Vec<Node<T>> because it makes more sense.
Node is Iterable and will yield zero (Empty|Link), one (Object) or many
(Array) Ts
2024-04-06 16:56:13 +02:00

17 lines
637 B
Rust

pub trait Place : super::Object {
fn accuracy(&self) -> Option<f64> { None }
fn altitude(&self) -> Option<f64> { None }
fn latitude(&self) -> Option<f64> { None }
fn longitude(&self) -> Option<f64> { None }
fn radius(&self) -> Option<f64> { None }
fn units(&self) -> Option<&str> { None }
}
pub trait PlaceMut : super::ObjectMut {
fn set_accuracy(self, val: Option<f64>) -> Self;
fn set_altitude(self, val: Option<f64>) -> Self;
fn set_latitude(self, val: Option<f64>) -> Self;
fn set_longitude(self, val: Option<f64>) -> Self;
fn set_radius(self, val: Option<f64>) -> Self;
fn set_units(self, val: Option<&str>) -> Self;
}