pub struct CommonCore { /* private fields */ }Implementations§
Source§impl CommonCore
impl CommonCore
Sourcepub fn new(core: Weak<dyn Core>) -> Rc<Self>
pub fn new(core: Weak<dyn Core>) -> Rc<Self>
Creates a new shared core with a root scope and environment.
The core is initialized with the builtin primitive types:
bool, int, real, and string.
Sourcepub fn read(&self, riddle: &str) -> Result<(), RiddleError>
pub fn read(&self, riddle: &str) -> Result<(), RiddleError>
Parses and executes a RiDDLe problem in this core context.
The parsed problem metadata is registered in the current scope, then each statement is executed in order using this core scope and environment.
Returns an error if parsing or execution fails.
Trait Implementations§
Source§impl Debug for CommonCore
impl Debug for CommonCore
Source§impl Env for CommonCore
impl Env for CommonCore
Source§impl Scope for CommonCore
impl Scope for CommonCore
fn core(self: Rc<Self>) -> Rc<dyn Core>
fn scope(&self) -> Option<Rc<dyn Scope>>
fn get_field(&self, _name: &str) -> Option<Rc<Field>>
fn get_method( &self, _name: &str, _classes: &[Rc<dyn Type>], ) -> Option<Rc<Method>>
fn get_type(&self, name: &str) -> Option<Rc<dyn Type>>
fn get_predicate(&self, _name: &str) -> Option<Rc<Predicate>>
fn as_class(self: Rc<Self>) -> Option<Rc<dyn Class>>
Auto Trait Implementations§
impl Freeze for CommonCore
impl !RefUnwindSafe for CommonCore
impl !Send for CommonCore
impl !Sync for CommonCore
impl Unpin for CommonCore
impl UnsafeUnpin for CommonCore
impl !UnwindSafe for CommonCore
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