Struct mech_program::program::Program
source · pub struct Program {Show 17 fields
pub id: u64,
pub name: String,
pub mech: Core,
pub cores: HashMap<u64, Core>,
pub remote_cores: HashMap<u64, MechSocket>,
pub input_map: HashMap<(TableId, RegisterIndex, RegisterIndex), HashSet<u64>>,
pub libraries: HashMap<String, Option<Library>>,
pub machines: HashMap<u64, Box<dyn Machine>>,
pub mech_functions: HashMap<u64, Box<dyn MechFunctionCompiler>>,
pub machine_repository: HashMap<String, (String, String)>,
pub incoming: Receiver<RunLoopMessage>,
pub outgoing: Sender<RunLoopMessage>,
pub errors: HashSet<MechErrorKind>,
pub listeners: HashMap<(TableId, RegisterIndex, RegisterIndex), HashSet<u64>>,
pub trigger_to_listener: HashMap<(TableId, RegisterIndex, RegisterIndex), ((TableId, RegisterIndex, RegisterIndex), HashSet<u64>)>,
pub registry: String,
pub capability_token: CapabilityToken,
/* private fields */
}Fields§
§id: u64§name: String§mech: Core§cores: HashMap<u64, Core>§remote_cores: HashMap<u64, MechSocket>§input_map: HashMap<(TableId, RegisterIndex, RegisterIndex), HashSet<u64>>§libraries: HashMap<String, Option<Library>>§machines: HashMap<u64, Box<dyn Machine>>§mech_functions: HashMap<u64, Box<dyn MechFunctionCompiler>>§machine_repository: HashMap<String, (String, String)>§incoming: Receiver<RunLoopMessage>§outgoing: Sender<RunLoopMessage>§errors: HashSet<MechErrorKind>§listeners: HashMap<(TableId, RegisterIndex, RegisterIndex), HashSet<u64>>§trigger_to_listener: HashMap<(TableId, RegisterIndex, RegisterIndex), ((TableId, RegisterIndex, RegisterIndex), HashSet<u64>)>§registry: String§capability_token: CapabilityTokenImplementations§
source§impl Program
impl Program
pub fn new( name: &str, capacity: usize, recursion_limit: u64, outgoing: Sender<RunLoopMessage>, incoming: Receiver<RunLoopMessage>, registry: String, default_caps: Option<HashSet<Capability>>, ) -> Program
pub fn trigger_machine( &mut self, register: &(TableId, RegisterIndex, RegisterIndex), ) -> Result<(), MechError>
pub fn compile_program( &mut self, input: String, ) -> Result<Vec<(Vec<BlockId>, Vec<u64>, Vec<MechError>)>, MechError>
pub fn compile_fragment(&mut self, input: String)
pub fn download_dependencies( &mut self, outgoing: Option<Sender<ClientMessage>>, ) -> Result<Vec<MechErrorKind>, MechError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Program
impl !RefUnwindSafe for Program
impl !Send for Program
impl !Sync for Program
impl Unpin for Program
impl !UnwindSafe for Program
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.