Skip to main content

GraphParam

Enum GraphParam 

Source
pub enum GraphParam {
    Start,
    Neighbours,
    Weight,
    Heuristic,
    Goal,
}
Expand description

One parameter of a graph helper, as a shape rather than as a type.

praxis-stdlib cannot name a Type — that is praxis-typeck, which depends on this crate — so the signature is written as the shapes inference then builds the types from. The match on this in seed_builtin_schemes is exhaustive, so a new shape is a compile error there rather than a parameter that silently gets the wrong type.

Variants§

§

Start

The state the walk starts from: a T.

§

Neighbours

(T) -> Vec[T] — the states reachable in one step from a given one. Returning a Vec rather than a lazy sequence is what makes the helper callable from the runtime, which has no way to drive a pipeline.

§

Weight

(T, T) -> Int — the cost of the edge between two adjacent states.

§

Heuristic

(T) -> Int — the estimated remaining cost from a state to a goal.

§

Goal

(T) -> Bool — whether a state is a goal. A predicate rather than a goal value so a search can stop on a property (|s| s.0 == n), which is what §6.5’s own example writes.

Trait Implementations§

Source§

impl Clone for GraphParam

Source§

fn clone(&self) -> GraphParam

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for GraphParam

Source§

impl Debug for GraphParam

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for GraphParam

Source§

impl PartialEq for GraphParam

Source§

fn eq(&self, other: &GraphParam) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GraphParam

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.