feat(rust): implement sled support

Signed-off-by: hackerchai <i@hackerchai.com>
This commit is contained in:
hackerchai
2024-07-04 16:20:57 +08:00
parent 4c7f3f7972
commit 2c14dc16dd

35
rust/sled/sled.go Normal file
View File

@@ -0,0 +1,35 @@
package sled
import "github.com/goplus/llgo/c"
// Write the .pc file for the dylib generated by the Rust library and copy it to pkg-config for proper location.
const (
LLGoPackage = "link: $(pkg-config --libs sled); -lsled"
)
type SledConfig struct {
Unused [8]byte
}
type SledDb struct {
Unused [8]byte
}
//llgo:link (*SledConfig).SetPath C.sled_config_set_path
func (conf *SledConfig) SetPath(char *c.Char) *SledConfig {
return nil
}
//llgo:link (*SledConfig).OpenDB C.sled_open_db
func (conf *SledConfig) OpenDB(sledConfig *SledConfig) *SledDb {
return nil
}
//llgo:link (*SledDb).Set C.sled_set
func (db *SledDb) Set(key *c.Char, keyLen c.Ulong, value *c.Char, valueLen c.Ulong) {
}
//llgo:link (*SledDb).Get C.sled_get
func (db *SledDb) Get(key *c.Char, keyLen c.Ulong) *c.Char {
return nil
}