Returns the main graph of the context if it is already set. # Returns Main graph of the context
(&self)
| 4029 | /// |
| 4030 | /// Main graph of the context |
| 4031 | pub fn get_main_graph(&self) -> Result<Graph> { |
| 4032 | match &self.body.borrow().main_graph { |
| 4033 | Some(g) => Ok(g.upgrade()), |
| 4034 | None => Err(runtime_error!("main graph is not set")), |
| 4035 | } |
| 4036 | } |
| 4037 | |
| 4038 | /// Returns the number of graphs contained in this context. |
| 4039 | /// |