DblTheoryKind

Trait DblTheoryKind 

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

    // Required method
    fn from_option<T>(opt: Option<T>, msg: &str) -> Self::Wrap<T>;
}
Expand description

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).

This trait is sealed and cannot be implemented outside this crate.

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 from_option<T>(opt: Option<T>, msg: &str) -> Self::Wrap<T>

Converts from an Option into a wrapped value.

For Unital, this unwraps with the given message. For NonUnital, this is the identity.

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§