Expand description
Rust bindings for UnQlite library.
As its official site says, UnQlite is
An Embeddable NoSQL Database Engine.
Please see UnQLite C/C++ API Reference for full API documents.
§Usage
This crate provides several features for UnQlite compile-time options:
- enable-threads: equivalent to
UNQLITE_ENABLE_THREADSenabled. - jx9-disable-builtin-func: equivalent to
JX9_DISABLE_BUILTIN_FUNCenabled. - jx9-enable-math-fuc: equivalent to
JX9_ENABLE_MATH_FUNCenabled. - jx9-disable-disk-io: equivalent to
JX9_DISABLE_DISK_IOenabled. - enable-jx9-hash-io: equivalent to
UNQLITE_ENABLE_JX9_HASH_IOenabled.
To provide the same default behavior as original C does, non of the features
is enabled by default. When you want some features, such as enable-threads,
just config in Cargo.toml:
[dependencies.unqlite-sys]
version = "0.3"
features = [ "enable-threads" ]For multiple features just add them in toml features array.
§Threadsafe
Note that even “enable-threads” is featured in your crate, it’s not meant that your code is threadsafe.
When UnQLite has been compiled with threading support then the threading mode can be altered at run-time using the unqlite_lib_config() interface together with one of these verbs:
UNQLITE_LIB_CONFIG_THREAD_LEVEL_SINGLE
UNQLITE_LIB_CONFIG_THREAD_LEVEL_MULTI
Platforms others than Windows and UNIX systems must install their own mutex subsystem via unqlite_lib_config() with a configuration verb set to UNQLITE_LIB_CONFIG_USER_MUTEX. Otherwise the library is not threadsafe.
Note that you must link UnQLite with the POSIX threads library under UNIX systems (i.e: -lpthread).
To use in multithread cases, that is threadsafe, you may use like this:
extern crate unqlite_sys as ffi;
use ffi::constants as ffic;
fn main() {
unsafe {
ffi::unqlite_lib_config(ffic::UNQLITE_LIB_CONFIG_THREAD_LEVEL_MULTI);
ffi::unqlite_lib_init();
assert_eq!(ffi::unqlite_lib_is_threadsafe(), 1);
// do stuff ...
}
}Modules§
Structs§
- Struct_
SyMem Methods - Struct_
SyMutex Methods - Struct_
SyString - Struct_
Sytm - Struct___
va_ list_ tag - Struct_
syiovec - Struct_
unqlite_ file - Struct_
unqlite_ io_ methods - Struct_
unqlite_ kv_ cursor - Struct_
unqlite_ kv_ engine - Struct_
unqlite_ kv_ io - Struct_
unqlite_ kv_ methods - Struct_
unqlite_ page - Struct_
unqlite_ vfs
Enums§
Functions§
- unqlite_
array_ ⚠add_ elem - unqlite_
array_ ⚠add_ strkey_ elem - unqlite_
array_ ⚠count - unqlite_
array_ ⚠fetch - unqlite_
array_ ⚠walk - unqlite_
begin ⚠ - unqlite_
close ⚠ - unqlite_
commit ⚠ - unqlite_
compile ⚠ - unqlite_
compile_ ⚠file - unqlite_
config ⚠ - unqlite_
context_ ⚠alloc_ chunk - unqlite_
context_ ⚠free_ chunk - unqlite_
context_ ⚠new_ array - unqlite_
context_ ⚠new_ scalar - unqlite_
context_ ⚠output - unqlite_
context_ ⚠output_ format - unqlite_
context_ ⚠peek_ aux_ data - unqlite_
context_ ⚠push_ aux_ data - unqlite_
context_ ⚠random_ num - unqlite_
context_ ⚠random_ string - unqlite_
context_ ⚠realloc_ chunk - unqlite_
context_ ⚠release_ value - unqlite_
context_ ⚠result_ buf_ length - unqlite_
context_ ⚠throw_ error - unqlite_
context_ ⚠throw_ error_ format - unqlite_
context_ ⚠user_ data - unqlite_
create_ ⚠constant - unqlite_
create_ ⚠function - unqlite_
delete_ ⚠constant - unqlite_
delete_ ⚠function - unqlite_
function_ ⚠name - unqlite_
kv_ ⚠append - unqlite_
kv_ ⚠append_ fmt - unqlite_
kv_ ⚠config - unqlite_
kv_ ⚠cursor_ data - unqlite_
kv_ ⚠cursor_ data_ callback - unqlite_
kv_ ⚠cursor_ delete_ entry - unqlite_
kv_ ⚠cursor_ first_ entry - unqlite_
kv_ ⚠cursor_ init - unqlite_
kv_ ⚠cursor_ key - unqlite_
kv_ ⚠cursor_ key_ callback - unqlite_
kv_ ⚠cursor_ last_ entry - unqlite_
kv_ ⚠cursor_ next_ entry - unqlite_
kv_ ⚠cursor_ prev_ entry - unqlite_
kv_ ⚠cursor_ release - unqlite_
kv_ ⚠cursor_ reset - unqlite_
kv_ ⚠cursor_ seek - unqlite_
kv_ ⚠cursor_ valid_ entry - unqlite_
kv_ ⚠delete - unqlite_
kv_ ⚠fetch - unqlite_
kv_ ⚠fetch_ callback - unqlite_
kv_ ⚠store - unqlite_
kv_ ⚠store_ fmt - unqlite_
lib_ ⚠config - unqlite_
lib_ ⚠copyright - unqlite_
lib_ ⚠ident - unqlite_
lib_ ⚠init - unqlite_
lib_ ⚠is_ threadsafe - unqlite_
lib_ ⚠shutdown - unqlite_
lib_ ⚠signature - unqlite_
lib_ ⚠version - unqlite_
open ⚠ - unqlite_
result_ ⚠bool - unqlite_
result_ ⚠double - unqlite_
result_ ⚠int - unqlite_
result_ ⚠int64 - unqlite_
result_ ⚠null - unqlite_
result_ ⚠resource - unqlite_
result_ ⚠string - unqlite_
result_ ⚠string_ format - unqlite_
result_ ⚠value - unqlite_
rollback ⚠ - unqlite_
util_ ⚠load_ mmaped_ file - unqlite_
util_ ⚠random_ num - unqlite_
util_ ⚠random_ string - unqlite_
util_ ⚠release_ mmaped_ file - unqlite_
value_ ⚠bool - unqlite_
value_ ⚠compare - unqlite_
value_ ⚠double - unqlite_
value_ ⚠int - unqlite_
value_ ⚠int64 - unqlite_
value_ ⚠is_ bool - unqlite_
value_ ⚠is_ callable - unqlite_
value_ ⚠is_ empty - unqlite_
value_ ⚠is_ float - unqlite_
value_ ⚠is_ int - unqlite_
value_ ⚠is_ json_ array - unqlite_
value_ ⚠is_ json_ object - unqlite_
value_ ⚠is_ null - unqlite_
value_ ⚠is_ numeric - unqlite_
value_ ⚠is_ resource - unqlite_
value_ ⚠is_ scalar - unqlite_
value_ ⚠is_ string - unqlite_
value_ ⚠null - unqlite_
value_ ⚠release - unqlite_
value_ ⚠reset_ string_ cursor - unqlite_
value_ ⚠resource - unqlite_
value_ ⚠string - unqlite_
value_ ⚠string_ format - unqlite_
value_ ⚠to_ bool - unqlite_
value_ ⚠to_ double - unqlite_
value_ ⚠to_ int - unqlite_
value_ ⚠to_ int64 - unqlite_
value_ ⚠to_ resource - unqlite_
value_ ⚠to_ string - unqlite_
vm_ ⚠config - unqlite_
vm_ ⚠dump - unqlite_
vm_ ⚠exec - unqlite_
vm_ ⚠extract_ variable - unqlite_
vm_ ⚠new_ array - unqlite_
vm_ ⚠new_ scalar - unqlite_
vm_ ⚠release - unqlite_
vm_ ⚠release_ value - unqlite_
vm_ ⚠reset
Type Aliases§
- Proc
Consumer - Proc
MemError - SyMem
Methods - SyMutex
- SyMutex
Methods - SyString
- Sytm
- __
builtin_ va_ list - __
gnuc_ va_ list - pgno
- sxi64
- sxu64
- syiovec
- unqlite
- unqlite_
context - unqlite_
file - unqlite_
int64 - unqlite_
io_ methods - unqlite_
io_ stream - unqlite_
kv_ cursor - unqlite_
kv_ engine - unqlite_
kv_ handle - unqlite_
kv_ io - unqlite_
kv_ methods - unqlite_
page - unqlite_
real - unqlite_
value - unqlite_
vfs - unqlite_
vm - va_list