DblTheoryKind

Trait DblTheoryKind 

Source
pub trait DblTheoryKind: Debug {
    type Wrap<T>;

    // Required methods
    fn into_option<T>(wrapped: Self::Wrap<T>) -> Option<T>;
    fn pure<T>(value: T) -> Self::Wrap<T>;
}
Expand description

The kind of a double theory, determining whether hom types are guaranteed.

This trait uses a generic associated type (Wrap) to control the return type of DblTheory::hom_type and DblTheory::hom_op. For Unital theories, Wrap<T> is just T (hom types always exist). For NonUnital theories, Wrap<T> is Option<T> (hom types may not exist).

Required Associated Types§

Source

type Wrap<T>

Wraps a type to reflect whether values are guaranteed to exist.

For Unital, this is the identity (T). For NonUnital, this is Option<T>.

Required Methods§

Source

fn into_option<T>(wrapped: Self::Wrap<T>) -> Option<T>

Converts a wrapped value into an Option, for code generic over the kind.

Source

fn pure<T>(value: T) -> Self::Wrap<T>

Wraps a value that is known to exist.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§