From 7787f2ce9eea4eaf6752a21744b0fe51e8d8e0a6 Mon Sep 17 00:00:00 2001 From: UnsignedByte Date: Mon, 7 Oct 2024 20:58:55 +0000 Subject: [PATCH] update documentation comments --- src/context.rs | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/context.rs b/src/context.rs index 31035f8..41b53a1 100644 --- a/src/context.rs +++ b/src/context.rs @@ -176,24 +176,6 @@ pub struct Context { /// underlying solver (via /// [`ContextBuilder::solver`][crate::ContextBuilder::solver]). impl Context { - /// Directly send a command to the solver. - pub fn send(&mut self, cmd: SExpr) -> io::Result<()> { - let solver = self - .solver - .as_mut() - .expect("send requires a running solver"); - solver.send(&self.arena, cmd) - } - - /// Directly receive a response from the solver. - pub fn recv(&mut self) -> io::Result { - let solver = self - .solver - .as_mut() - .expect("recv requires a running solver"); - solver.recv(&self.arena) - } - pub fn set_option(&mut self, name: K, value: SExpr) -> io::Result<()> where K: Into + AsRef, @@ -549,6 +531,32 @@ impl Context { .list(vec![self.atoms.pop, self.arena.atom(n.to_string())]), ) } + + /// Directly send an expression to the solver. + /// This is a low-level API and should be used sparingly, such as + /// for solver-specific commands that this crate does not provide + /// built-in support for. If possible, please use the higher-level + /// interfaces provided by this crate. + pub fn raw_send(&mut self, cmd: SExpr) -> io::Result<()> { + let solver = self + .solver + .as_mut() + .expect("send requires a running solver"); + solver.send(&self.arena, cmd) + } + + /// Directly receive a response from the solver. + /// This is a low-level API and should be used sparingly, such as + /// for solver-specific commands that this crate does not provide + /// built-in support for. If possible, please use the higher-level + /// interfaces provided by this crate. + pub fn raw_recv(&mut self) -> io::Result { + let solver = self + .solver + .as_mut() + .expect("recv requires a running solver"); + solver.recv(&self.arena) + } } /// # Basic S-Expression Construction and Inspection