pub struct Identity;
Expand description
The identity functor for lax open hypergraphs.
Trait Implementations§
Source§impl<O: PartialEq + Clone, A: Clone + PartialEq> Functor<O, A, O, A> for Identity
impl<O: PartialEq + Clone, A: Clone + PartialEq> Functor<O, A, O, A> for Identity
Source§fn map_object(&self, o: &O) -> impl ExactSizeIterator<Item = O>
fn map_object(&self, o: &O) -> impl ExactSizeIterator<Item = O>
Map a generating object of the theory
Source§fn map_operation(
&self,
a: &A,
source: &[O],
target: &[O],
) -> OpenHypergraph<O, A>
fn map_operation( &self, a: &A, source: &[O], target: &[O], ) -> OpenHypergraph<O, A>
Map a single operation of the theory with specified source and target type.
This must be consistent with
map_object
, i.e. we must have:
- F.map_operation(x, s, t).sources == F.map_object(s)
- F.map_operation(x, s, t).targets == F.map_object(t)
This condition is not checked, but may panic if not satisfied.Source§fn map_arrow(&self, f: &OpenHypergraph<O, A>) -> OpenHypergraph<O, A>
fn map_arrow(&self, f: &OpenHypergraph<O, A>) -> OpenHypergraph<O, A>
Apply this functor to an
OpenHypergraph
.
Once map_operation
is defined, this can typically be defined as
define_map_arrow(self, f)
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnwindSafe for Identity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more