Skip to content

Commit

Permalink
update documentation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
UnsignedByte committed Oct 7, 2024
1 parent d589990 commit 7787f2c
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SExpr> {
let solver = self
.solver
.as_mut()
.expect("recv requires a running solver");
solver.recv(&self.arena)
}

pub fn set_option<K>(&mut self, name: K, value: SExpr) -> io::Result<()>
where
K: Into<String> + AsRef<str>,
Expand Down Expand Up @@ -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<SExpr> {
let solver = self
.solver
.as_mut()
.expect("recv requires a running solver");
solver.recv(&self.arena)
}
}

/// # Basic S-Expression Construction and Inspection
Expand Down

0 comments on commit 7787f2c

Please sign in to comment.