Skip to main content

egml_core/model/base/
ownership_attributes_access.rs

1use crate::model::base::OwnershipAttributes;
2
3/// Read-only access to the `gml:OwnershipAttributeGroup` on a property element.
4pub trait HasOwnershipAttributes {
5    fn ownership(&self) -> &OwnershipAttributes;
6
7    /// `gml:owns` — whether this property owns the referenced object.
8    fn owns(&self) -> bool {
9        self.ownership().owns
10    }
11}
12
13/// Mutable access to the `gml:OwnershipAttributeGroup` on a property element.
14pub trait HasOwnershipAttributesMut: HasOwnershipAttributes {
15    fn ownership_mut(&mut self) -> &mut OwnershipAttributes;
16
17    fn set_owns(&mut self, owns: bool) {
18        self.ownership_mut().owns = owns;
19    }
20}