Skip to main content

Composed

Struct Composed 

Source
pub struct Composed<A, B, C, M1, M2> { /* private fields */ }
Expand description

Sequential composition: A -> B followed by B -> C gives A -> C.

Requires Mid: Clone because the intermediate value must be available both to the second morphism and (optionally) to the composed invariant check.

Implementations§

Source§

impl<A, B, C, M1, M2> Composed<A, B, C, M1, M2>
where M1: Morphism<A, B>, M2: Morphism<B, C>,

Source

pub fn new(first: M1, second: M2) -> Self

Construct a composed morphism first; second.

Trait Implementations§

Source§

impl<A, B, C, M1, M2> Morphism<A, C> for Composed<A, B, C, M1, M2>
where M1: Morphism<A, B>, M2: Morphism<B, C>,

Source§

fn name(&self) -> &'static str

Human-readable name for diagnostics, traceability, attestation.
Source§

fn apply(&self, src: &A) -> C

Apply the morphism. Must be total and deterministic.
Source§

impl<A, B, C, M1, M2> ProvenMorphism<A, C> for Composed<A, B, C, M1, M2>
where M1: ProvenMorphism<A, B>, M2: ProvenMorphism<B, C>,

Source§

fn check_invariants(&self, src: &A, dst: &C) -> Vec<String>

Return violations (empty = all invariants hold).

Auto Trait Implementations§

§

impl<A, B, C, M1, M2> Freeze for Composed<A, B, C, M1, M2>
where M1: Freeze, M2: Freeze,

§

impl<A, B, C, M1, M2> RefUnwindSafe for Composed<A, B, C, M1, M2>

§

impl<A, B, C, M1, M2> Send for Composed<A, B, C, M1, M2>
where M1: Send, M2: Send,

§

impl<A, B, C, M1, M2> Sync for Composed<A, B, C, M1, M2>
where M1: Sync, M2: Sync,

§

impl<A, B, C, M1, M2> Unpin for Composed<A, B, C, M1, M2>
where M1: Unpin, M2: Unpin,

§

impl<A, B, C, M1, M2> UnsafeUnpin for Composed<A, B, C, M1, M2>
where M1: UnsafeUnpin, M2: UnsafeUnpin,

§

impl<A, B, C, M1, M2> UnwindSafe for Composed<A, B, C, M1, M2>
where M1: UnwindSafe, M2: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.