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
44efc60b
Commit
44efc60b
authored
Jan 05, 2015
by
Tyler Neely
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3 from AndreyG/master
compilation fixes for upstream rustc
parents
0111d295
06437007
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
ffi.rs
src/ffi.rs
+9
-0
rocksdb.rs
src/rocksdb.rs
+11
-8
No files found.
src/ffi.rs
View file @
44efc60b
...
...
@@ -33,6 +33,15 @@ pub struct RocksDBCache(pub *const c_void);
#[repr(C)]
pub
struct
RocksDBFilterPolicy
(
pub
*
const
c_void
);
impl
Copy
for
RocksDBOptions
{}
impl
Copy
for
RocksDBInstance
{}
impl
Copy
for
RocksDBWriteOptions
{}
impl
Copy
for
RocksDBReadOptions
{}
impl
Copy
for
RocksDBMergeOperator
{}
impl
Copy
for
RocksDBBlockBasedTableOptions
{}
impl
Copy
for
RocksDBCache
{}
impl
Copy
for
RocksDBFilterPolicy
{}
pub
fn
new_bloom_filter
(
bits
:
c_int
)
->
RocksDBFilterPolicy
{
unsafe
{
rocksdb_filterpolicy_create_bloom
(
bits
)
...
...
src/rocksdb.rs
View file @
44efc60b
...
...
@@ -22,7 +22,7 @@ use std::str::from_utf8;
use
std
::
string
::
raw
::
from_buf_len
;
use
std
::
ptr
;
use
std
::
mem
;
use
std
::
slic
e
;
use
std
::
ptr
::
Uniqu
e
;
use
rocksdb_ffi
;
...
...
@@ -31,6 +31,8 @@ pub struct RocksDBOptions {
block_options
:
rocksdb_ffi
::
RocksDBBlockBasedTableOptions
,
}
impl
Copy
for
RocksDBOptions
{}
impl
RocksDBOptions
{
pub
fn
new
()
->
RocksDBOptions
{
unsafe
{
...
...
@@ -463,10 +465,11 @@ pub struct RocksDBVector {
impl
RocksDBVector
{
pub
fn
from_c
(
val
:
*
mut
u8
,
val_len
:
size_t
)
->
RocksDBVector
{
unsafe
{
let
val
=
Unique
(
val
);
RocksDBVector
{
inner
:
CVec
::
new_with_dtor
(
val
,
val_len
as
uint
,
proc
(){
libc
::
free
(
val
as
*
mut
c_void
);
}
)
CVec
::
new_with_dtor
(
val
.
0
,
val_len
as
uint
,
move
|:|
libc
::
free
(
val
.
0
as
*
mut
libc
::
c_void
)
)
}
}
}
...
...
@@ -475,8 +478,8 @@ impl RocksDBVector {
self
.inner
.as_slice
()
}
pub
fn
to_utf8
<
'a
>
(
&
'a
self
)
->
Option
<&
'a
str
>
{
from_utf8
(
self
.inner
.as_slice
())
pub
fn
to_utf8
(
&
self
)
->
Option
<&
str
>
{
from_utf8
(
self
.inner
.as_slice
())
.ok
()
}
}
...
...
@@ -577,9 +580,9 @@ pub struct MergeOperands<'a> {
}
impl
<
'a
>
MergeOperands
<
'a
>
{
fn
new
<
'a
>
(
operands_list
:
*
const
*
const
c_char
,
operands_list_len
:
*
const
size_t
,
num_operands
:
c_int
)
->
MergeOperands
<
'a
>
{
fn
new
(
operands_list
:
*
const
*
const
c_char
,
operands_list_len
:
*
const
size_t
,
num_operands
:
c_int
)
->
MergeOperands
<
'a
>
{
assert
!
(
num_operands
>=
0
);
MergeOperands
{
operands_list
:
operands_list
,
...
...
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