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
a1dd3f8f
Commit
a1dd3f8f
authored
Feb 24, 2016
by
Ceri Storey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add DB#put_cf_opt for WriteOptions.
parent
df6d4950
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
rocksdb.rs
src/rocksdb.rs
+18
-11
No files found.
src/rocksdb.rs
View file @
a1dd3f8f
...
@@ -540,37 +540,44 @@ impl DB {
...
@@ -540,37 +540,44 @@ impl DB {
Ok
(())
Ok
(())
}
}
}
}
}
impl
Writable
for
DB
{
fn
put
(
&
self
,
key
:
&
[
u8
],
value
:
&
[
u8
])
->
Result
<
(),
String
>
{
self
.put_opt
(
key
,
value
,
&
WriteOptions
::
new
())
}
fn
put_cf
(
&
self
,
fn
put_cf
_opt
(
&
self
,
cf
:
DBCFHandle
,
cf
:
DBCFHandle
,
key
:
&
[
u8
],
key
:
&
[
u8
],
value
:
&
[
u8
])
value
:
&
[
u8
],
writeopts
:
&
WriteOptions
)
->
Result
<
(),
String
>
{
->
Result
<
(),
String
>
{
unsafe
{
unsafe
{
let
writeopts
=
rocksdb_ffi
::
rocksdb_writeoptions_create
();
let
mut
err
:
*
const
i8
=
0
as
*
const
i8
;
let
mut
err
:
*
const
i8
=
0
as
*
const
i8
;
let
err_ptr
:
*
mut
*
const
i8
=
&
mut
err
;
let
err_ptr
:
*
mut
*
const
i8
=
&
mut
err
;
rocksdb_ffi
::
rocksdb_put_cf
(
self
.inner
,
rocksdb_ffi
::
rocksdb_put_cf
(
self
.inner
,
writeopts
.
clone
()
,
writeopts
.
inner
,
cf
,
cf
,
key
.as_ptr
(),
key
.as_ptr
(),
key
.len
()
as
size_t
,
key
.len
()
as
size_t
,
value
.as_ptr
(),
value
.as_ptr
(),
value
.len
()
as
size_t
,
value
.len
()
as
size_t
,
err_ptr
);
err_ptr
);
rocksdb_ffi
::
rocksdb_writeoptions_destroy
(
writeopts
);
if
!
err
.is_null
()
{
if
!
err
.is_null
()
{
return
Err
(
error_message
(
err
));
return
Err
(
error_message
(
err
));
}
}
Ok
(())
Ok
(())
}
}
}
}
}
impl
Writable
for
DB
{
fn
put
(
&
self
,
key
:
&
[
u8
],
value
:
&
[
u8
])
->
Result
<
(),
String
>
{
self
.put_opt
(
key
,
value
,
&
WriteOptions
::
new
())
}
fn
put_cf
(
&
self
,
cf
:
DBCFHandle
,
key
:
&
[
u8
],
value
:
&
[
u8
])
->
Result
<
(),
String
>
{
self
.put_cf_opt
(
cf
,
key
,
value
,
&
WriteOptions
::
new
())
}
fn
merge
(
&
self
,
key
:
&
[
u8
],
value
:
&
[
u8
])
->
Result
<
(),
String
>
{
fn
merge
(
&
self
,
key
:
&
[
u8
],
value
:
&
[
u8
])
->
Result
<
(),
String
>
{
unsafe
{
unsafe
{
...
...
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