Skip to main content

RunnableInterface

Trait RunnableInterface 

Source
pub trait RunnableInterface: Send + Sync {
    type Value: ValueInterface;
    type Fact: FactInterface;
    type State: StateInterface<Value = Self::Value>;

    // Required methods
    fn input_count(&self) -> Result<usize>;
    fn output_count(&self) -> Result<usize>;
    fn input_fact(&self, id: usize) -> Result<Self::Fact>;
    fn output_fact(&self, id: usize) -> Result<Self::Fact>;
    fn property_keys(&self) -> Result<Vec<String>>;
    fn property(&self, name: impl AsRef<str>) -> Result<Self::Value>;
    fn spawn_state(&self) -> Result<Self::State>;
    fn cost_json(&self) -> Result<String>;
    fn profile_json<I, IV, IE, S, SV, SE>(
        &self,
        inputs: Option<I>,
        state_initializers: Option<S>,
    ) -> Result<String>
       where I: IntoIterator<Item = IV>,
             IV: TryInto<Self::Value, Error = IE>,
             IE: Into<Error> + Debug,
             S: IntoIterator<Item = SV>,
             SV: TryInto<Self::Value, Error = SE>,
             SE: Into<Error> + Debug;

    // Provided methods
    fn run<I, V, E>(&self, inputs: I) -> Result<Vec<Self::Value>>
       where I: IntoIterator<Item = V>,
             V: TryInto<Self::Value, Error = E>,
             E: Into<Error> { ... }
    fn input_facts(&self) -> Result<impl Iterator<Item = Self::Fact>> { ... }
    fn output_facts(&self) -> Result<impl Iterator<Item = Self::Fact>> { ... }
}

Required Associated Types§

Required Methods§

Source

fn input_count(&self) -> Result<usize>

Source

fn output_count(&self) -> Result<usize>

Source

fn input_fact(&self, id: usize) -> Result<Self::Fact>

Source

fn output_fact(&self, id: usize) -> Result<Self::Fact>

Source

fn property_keys(&self) -> Result<Vec<String>>

Source

fn property(&self, name: impl AsRef<str>) -> Result<Self::Value>

Source

fn spawn_state(&self) -> Result<Self::State>

Source

fn cost_json(&self) -> Result<String>

Source

fn profile_json<I, IV, IE, S, SV, SE>( &self, inputs: Option<I>, state_initializers: Option<S>, ) -> Result<String>
where I: IntoIterator<Item = IV>, IV: TryInto<Self::Value, Error = IE>, IE: Into<Error> + Debug, S: IntoIterator<Item = SV>, SV: TryInto<Self::Value, Error = SE>, SE: Into<Error> + Debug,

Provided Methods§

Source

fn run<I, V, E>(&self, inputs: I) -> Result<Vec<Self::Value>>
where I: IntoIterator<Item = V>, V: TryInto<Self::Value, Error = E>, E: Into<Error>,

Source

fn input_facts(&self) -> Result<impl Iterator<Item = Self::Fact>>

Source

fn output_facts(&self) -> Result<impl Iterator<Item = Self::Fact>>

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§