pub trait RunnableInterface:
Debug
+ Send
+ Sync {
type Tensor: TensorInterface;
type Fact: FactInterface;
type State: StateInterface<Tensor = Self::Tensor>;
// 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::Tensor>;
fn spawn_state(&self) -> Result<Self::State>;
fn cost_json(&self) -> Result<String>;
fn profile_json<I, IV, IE>(&self, inputs: Option<I>) -> Result<String>
where I: IntoIterator<Item = IV>,
IV: TryInto<Self::Tensor, Error = IE>,
IE: Into<Error> + Debug;
// Provided methods
fn run(
&self,
inputs: impl IntoInputs<Self::Tensor>,
) -> Result<Vec<Self::Tensor>> { ... }
fn input_facts(&self) -> Result<impl Iterator<Item = Self::Fact>> { ... }
fn output_facts(&self) -> Result<impl Iterator<Item = Self::Fact>> { ... }
}Required Associated Types§
type Tensor: TensorInterface
type Fact: FactInterface
type State: StateInterface<Tensor = Self::Tensor>
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::Tensor>
fn spawn_state(&self) -> Result<Self::State>
fn cost_json(&self) -> Result<String>
fn profile_json<I, IV, IE>(&self, inputs: Option<I>) -> Result<String>
Provided Methods§
fn run( &self, inputs: impl IntoInputs<Self::Tensor>, ) -> Result<Vec<Self::Tensor>>
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.