Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
rust-rocksdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangzongwu
rust-rocksdb
Commits
e36d9892
Commit
e36d9892
authored
Feb 24, 2016
by
Ceri Storey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add DB#write variant with WriteOptions.
parent
14d02a36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
rocksdb.rs
src/rocksdb.rs
+6
-4
No files found.
src/rocksdb.rs
View file @
e36d9892
...
...
@@ -366,16 +366,14 @@ impl DB {
Ok
(())
}
pub
fn
write
(
&
self
,
batch
:
WriteBatch
)
->
Result
<
(),
String
>
{
let
writeopts
=
unsafe
{
rocksdb_ffi
::
rocksdb_writeoptions_create
()
};
pub
fn
write_opt
(
&
self
,
batch
:
WriteBatch
,
writeopts
:
&
WriteOptions
)
->
Result
<
(),
String
>
{
let
mut
err
:
*
const
i8
=
0
as
*
const
i8
;
let
err_ptr
:
*
mut
*
const
i8
=
&
mut
err
;
unsafe
{
rocksdb_ffi
::
rocksdb_write
(
self
.inner
,
writeopts
.
clone
()
,
writeopts
.
inner
,
batch
.inner
,
err_ptr
);
rocksdb_ffi
::
rocksdb_writeoptions_destroy
(
writeopts
);
}
if
!
err
.is_null
()
{
return
Err
(
error_message
(
err
));
...
...
@@ -383,6 +381,10 @@ impl DB {
return
Ok
(());
}
pub
fn
write
(
&
self
,
batch
:
WriteBatch
)
->
Result
<
(),
String
>
{
self
.write_opt
(
batch
,
&
WriteOptions
::
new
())
}
pub
fn
get
(
&
self
,
key
:
&
[
u8
])
->
Result
<
Option
<
DBVector
>
,
String
>
{
unsafe
{
let
readopts
=
rocksdb_ffi
::
rocksdb_readoptions_create
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment