honeycomb_core/cmap/dim3/links/
two.rs

1//! 2D link implementations
2
3use crate::cmap::{CMap3, DartIdType, LinkError};
4use crate::geometry::CoordsFloat;
5use crate::stm::{Transaction, TransactionClosureResult, atomically_with_err};
6
7/// 2-links
8impl<T: CoordsFloat> CMap3<T> {
9    /// 2-link operation.
10    pub(crate) fn two_link(
11        &self,
12        trans: &mut Transaction,
13        lhs_dart_id: DartIdType,
14        rhs_dart_id: DartIdType,
15    ) -> TransactionClosureResult<(), LinkError> {
16        self.betas.two_link_core(trans, lhs_dart_id, rhs_dart_id)
17    }
18
19    /// 2-link operation.
20    pub(crate) fn force_two_link(
21        &self,
22        lhs_dart_id: DartIdType,
23        rhs_dart_id: DartIdType,
24    ) -> Result<(), LinkError> {
25        atomically_with_err(|trans| self.betas.two_link_core(trans, lhs_dart_id, rhs_dart_id))
26    }
27}
28
29/// 2-unlinks
30impl<T: CoordsFloat> CMap3<T> {
31    /// 2-unlink operation.
32    pub(crate) fn two_unlink(
33        &self,
34        trans: &mut Transaction,
35        lhs_dart_id: DartIdType,
36    ) -> TransactionClosureResult<(), LinkError> {
37        self.betas.two_unlink_core(trans, lhs_dart_id)
38    }
39
40    /// 2-unlink operation.
41    pub(crate) fn force_two_unlink(&self, lhs_dart_id: DartIdType) -> Result<(), LinkError> {
42        atomically_with_err(|trans| self.betas.two_unlink_core(trans, lhs_dart_id))
43    }
44}