[−][src]Trait canrun::Domain
Manage values for a set of specific types.
Works with the DomainType<T>
trait to allow access to actual
values.
Domains are typically generated with the domain!
macro. There isn't currently much use case for interacting with a domain
directly in user code. The only reason it is public is to allow implementing
custom domains through the macro.
use canrun::{State, Goal, unify, var}; canrun::domain! { MyDomain { i32 } } let x = var(); let state: State<MyDomain> = State::new(); let goal: Goal<MyDomain> = unify(x, 1);
Associated Types
type Value: Debug + Clone + 'a
An individual value that may contain any of the valid types in this domain.
Typically for internal use.
Required methods
fn new() -> Self
Create a new, valid domain.
Typically for internal use.
fn unify_domain_values(
state: State<'a, Self>,
a: Self::Value,
b: Self::Value
) -> Option<State<'a, Self>>
state: State<'a, Self>,
a: Self::Value,
b: Self::Value
) -> Option<State<'a, Self>>
Apply .unify()
to two domain level
values.
The unification will fail if the inner values are not of the same type. This should not be able to happen.
Typically for internal use.
Implementors
impl<'a> Domain<'a> for I32
[src]
type Value = I32Value
fn new() -> Self
[src]
fn unify_domain_values(
state: State<'a, Self>,
a: Self::Value,
b: Self::Value
) -> Option<State<Self>>
[src]
state: State<'a, Self>,
a: Self::Value,
b: Self::Value
) -> Option<State<Self>>