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§
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>
Provided Methods§
fn run<I, V, E>(&self, inputs: I) -> Result<Vec<Self::Value>>
fn input_facts(&self) -> Result<impl Iterator<Item = Self::Fact>>
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.