MCPcopy Index your code
hub / github.com/endbasic/endbasic / get_program

Method get_program

std/src/lib.rs:448–453  ·  view source on GitHub ↗

Lazily initializes the `program` field with a default value and returns it.

(&mut self)

Source from the content-addressed store, hash-verified

446
447 /// Lazily initializes the `program` field with a default value and returns it.
448 pub fn get_program(&mut self) -> Rc<RefCell<dyn program::Program>> {
449 if self.program.is_none() {
450 self.program = Some(Rc::from(RefCell::from(program::ImmutableProgram::default())));
451 }
452 self.program.clone().unwrap()
453 }
454
455 /// Returns the storage subsystem that will be used for the machine.
456 pub fn get_storage(&mut self) -> Rc<RefCell<storage::Storage>> {

Calls

no outgoing calls