pub struct Database { /* private fields */ }Expand description
database: querying a database, when the host has one.
Implementations§
Source§impl Database
impl Database
Sourcepub fn recorded(rows: BTreeMap<String, Vec<String>>) -> Self
pub fn recorded(rows: BTreeMap<String, Vec<String>>) -> Self
A fake that answers each query from a table of canned rows, for tests.
The key is the query text exactly as the program writes it. This is a recorded answer, not a query engine: a fake that interpreted SQL would be a database this project did not write and cannot vouch for.
Sourcepub fn denied() -> Self
pub fn denied() -> Self
A host with no database, which refuses every query and says so.
The Language Card lists a denied implementation beside the real, fake,
and filtered ones. Denying here rather than leaving the module out
means the interface is still visible — query’s signature is in the
schema — and a run that asks is told what is missing instead of being
told that database is not a host module.
Trait Implementations§
Source§impl HostApi for Database
impl HostApi for Database
Source§fn module_schema(&self) -> ModuleSchema
fn module_schema(&self) -> ModuleSchema
The whole of what this module declares about itself: the name Cove
source uses, the capability a host must grant for it, the operations
it exposes, the types it declares, and the kinds of resource it can
open. Read more
Source§fn call(&self, op: &str, args: Vec<Value>) -> Result<Value, RuntimeError>
fn call(&self, op: &str, args: Vec<Value>) -> Result<Value, RuntimeError>
Invokes one operation.
Source§fn call_resource(
&self,
handle: &ResourceHandle,
op: &str,
args: Vec<Value>,
_back: &mut dyn Reentry,
) -> Result<Value, RuntimeError>
fn call_resource( &self, handle: &ResourceHandle, op: &str, args: Vec<Value>, _back: &mut dyn Reentry, ) -> Result<Value, RuntimeError>
Invokes one operation on a handle this module issued. Read more
Auto Trait Implementations§
impl !Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnsafeUnpin for Database
impl UnwindSafe for Database
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