pub trait Instance:
ToIOMacro<Output = Self>
+ Sized
+ 'static {
type Params: ItfcParams;
Show 14 methods
// Required methods
fn type_name() -> &'static str;
fn from_itfc(module: ModuleMold, params: Self::Params) -> Self;
fn as_instance(&mut self, views: &mut InstanceViewIter);
fn as_nested_itfc_io(
&self,
name: String,
views: &mut InstanceViewIter,
) -> Self;
fn make_nested_methods(
&self,
name: String,
__cmt_gen: ContextItfc<impl Itfc>,
);
fn module_mut(&mut self) -> &mut ModuleMold;
fn module(&self) -> &ModuleMold;
fn nested_names(&self) -> Vec<String>;
fn invoke(
&self,
name: &str,
args: &[&Var],
num_res: usize,
span: Option<MySpan>,
) -> Vars;
// Provided methods
fn get_name(&self) -> &str { ... }
fn set_name(&mut self, name: String) { ... }
fn make_modules(&mut self) -> Vec<Module> { ... }
fn add_generated_io_methods(
&self,
prefix_name: String,
exist_ins: HashSet<String>,
exist_outs: HashSet<String>,
exist_meths: HashSet<String>,
__cmt_gen: ContextItfc<impl Itfc>,
) { ... }
fn to_cmtir(self) -> Circuit { ... }
}Required Associated Types§
Required Methods§
fn type_name() -> &'static str
fn from_itfc(module: ModuleMold, params: Self::Params) -> Self
fn as_instance(&mut self, views: &mut InstanceViewIter)
fn as_nested_itfc_io(&self, name: String, views: &mut InstanceViewIter) -> Self
fn make_nested_methods(&self, name: String, __cmt_gen: ContextItfc<impl Itfc>)
fn module_mut(&mut self) -> &mut ModuleMold
fn module(&self) -> &ModuleMold
fn nested_names(&self) -> Vec<String>
fn invoke( &self, name: &str, args: &[&Var], num_res: usize, span: Option<MySpan>, ) -> Vars
Provided Methods§
fn get_name(&self) -> &str
fn set_name(&mut self, name: String)
fn make_modules(&mut self) -> Vec<Module>
fn add_generated_io_methods( &self, prefix_name: String, exist_ins: HashSet<String>, exist_outs: HashSet<String>, exist_meths: HashSet<String>, __cmt_gen: ContextItfc<impl Itfc>, )
fn to_cmtir(self) -> Circuit
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.