pub trait ModelInterface: Debug + Sized {
type Fact: FactInterface;
type Runnable: RunnableInterface;
type Tensor: TensorInterface;
Show 14 methods
// Required methods
fn input_count(&self) -> Result<usize>;
fn output_count(&self) -> Result<usize>;
fn input_name(&self, id: usize) -> Result<String>;
fn output_name(&self, id: usize) -> Result<String>;
fn set_output_names(
&mut self,
outputs: impl IntoIterator<Item = impl AsRef<str>>,
) -> Result<()>;
fn input_fact(&self, id: usize) -> Result<Self::Fact>;
fn output_fact(&self, id: usize) -> Result<Self::Fact>;
fn into_runnable(self) -> Result<Self::Runnable>;
fn transform(&mut self, spec: impl Into<TransformSpec>) -> Result<()>;
fn property_keys(&self) -> Result<Vec<String>>;
fn property(&self, name: impl AsRef<str>) -> Result<Self::Tensor>;
fn parse_fact(&self, spec: &str) -> Result<Self::Fact>;
// Provided methods
fn input_facts(&self) -> Result<impl Iterator<Item = Self::Fact>> { ... }
fn output_facts(&self) -> Result<impl Iterator<Item = Self::Fact>> { ... }
}Required Associated Types§
type Fact: FactInterface
type Runnable: RunnableInterface
type Tensor: TensorInterface
Required Methods§
fn input_count(&self) -> Result<usize>
fn output_count(&self) -> Result<usize>
fn input_name(&self, id: usize) -> Result<String>
fn output_name(&self, id: usize) -> Result<String>
fn set_output_names( &mut self, outputs: impl IntoIterator<Item = impl AsRef<str>>, ) -> Result<()>
fn input_fact(&self, id: usize) -> Result<Self::Fact>
fn output_fact(&self, id: usize) -> Result<Self::Fact>
fn into_runnable(self) -> Result<Self::Runnable>
fn transform(&mut self, spec: impl Into<TransformSpec>) -> Result<()>
fn property_keys(&self) -> Result<Vec<String>>
fn property(&self, name: impl AsRef<str>) -> Result<Self::Tensor>
fn parse_fact(&self, spec: &str) -> Result<Self::Fact>
Provided Methods§
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.