You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: Create workspace for developing uplink crate
Create a Cargo workspace for developing the `uplink` crate in this same
repository.
The `uplink` crate is the idiomatic and safe Rust binding for Storj
uplink wrapping the existing `uplink-sys` crate.
The commit
* moves some files or content from the root of the repository to the
"uplink-sys" directory, which is where the crate with the same name
is implemented.
* initializes the `uplink` crate under a subdirectory with the same
name, for implementing it.
* creates a workspace including these two creates as members.
Storj Uplink Rust bindings for the Rust programming language.
5
4
5
+
__NOTE__[`uplink` crate](tree/main/uplink) is __work in progress__.
6
6
7
-
Originally developed and tested using:
8
-
`Ubuntu 20.04`
9
-
`Rust 1.51.0`
10
-
`Go 1.16.2`
11
-
`uplink-c v1.2.3`
7
+
## Repository layout
12
8
13
-
Should work with other versions but has not been extensively tested.
9
+
Following the conventions used for creating Rust bindings through [bindgen][bindgen], this repository contains two crates:
14
10
15
-
See [uplink-sys README](https://github.com/storj-thirdparty/uplink-rust/tree/main/uplink-sys) for build instructions.
11
+
* The [`uplink-sys`](tree/main/uplink-sys) which is the unsafe Rust bindings auto-generated by [bindgen][bindgen].
12
+
* The [`uplink`](tree/main/uplink) which is the safe and idiomatic Rust binding build on top of the `uplink-sys`.
16
13
17
-
# uplink-sys
18
-
The [uplink-sys](https://github.com/storj-thirdparty/uplink-rust/tree/main/uplink-sys) crate provides Rust bindings to [uplink-c](https://github.com/storj/uplink-c).
This crate provides direct unsafe bindings to the C functions provided by uplink-c.
21
-
22
-
## Usage
23
-
See [uplink-sys/examples](https://github.com/storj-thirdparty/uplink-rust/tree/main/uplink-sys/examples) for example projects using the uplink-sys crate. Below is an example showing how to list buckets using the crate's unsafe C bindings.
In the future a safe crate may be added to this repo to wrap the unsafe pointer/memory handling of the sys crate.
98
-
99
-
# Testing
100
-
The project has been tested on the following operating systems:
101
-
```
102
-
* ubuntu
103
-
* Version: 20.04.2 LTS
104
-
* Processor: Intel® Core™ i7-10510U CPU @ 1.80GHz × 8
105
-
* macOS
106
-
* Version: 10.15.7
107
-
* Processor: 2.6 GHz 6-Core Intel Corei7
108
-
```
16
+
Each crate matches a root's child directory with the same name and each directory has its own README which provides more detailed information and its current status.
This crate provides Rust bindings to [uplink-c](https://github.com/storj/uplink-c/), the C interface for the storj uplink API library.
6
-
7
-
[TODO]() is the safe wrapper crate for this library.
6
+
This crate provides auto-generated unsafe Rust bindings, through [bindgen](https://github.com/rust-lang/rust-bindgen/), to C functions provided by [uplink-c](https://github.com/storj/uplink-c/), the C interface for the Storj uplink API library.
# Building (from crates.io) (TODO ONCE CRATE IS PUBLISHED)
29
-
## Linux
30
-
- Install [Go](https://golang.org/doc/install)
31
-
- Install libclang (required by bindgen for generating platform specific c bindings)
28
+
## Linux
29
+
- Install [Go](https://golang.org/doc/install)
30
+
- Install libclang (required by bindgen for generating platform specific c bindings)
32
31
- Add uplink-sys to Cargo.toml
33
32
34
33
# Tests
34
+
35
+
__NOTE__ the project has been tested on the following operating systems:
36
+
```
37
+
* ubuntu
38
+
* Version: 20.04.2 LTS
39
+
* Processor: Intel® Core™ i7-10510U CPU @ 1.80GHz × 8
40
+
* macOS
41
+
* Version: 10.15.7
42
+
* Processor: 2.6 GHz 6-Core Intel Corei7
43
+
```
44
+
35
45
## Setup
36
-
To allow the integrations tests access to the test project, create a file in this directory with the satellite address and api key for running tests.
37
-
Do not commit this file to the repo.
46
+
To allow the integrations tests access to the test project, create a file in this directory with the satellite address and api key for running tests.
47
+
Do not commit this file to the repo.
38
48
`test_secrets.txt`:
39
49
```
40
50
<satellite_addresss>
@@ -43,6 +53,79 @@ Do not commit this file to the repo.
43
53
## Run
44
54
`make test`
45
55
46
-
# Examples
47
-
For a usage example see `examples/list_buckets`. This contains a rust project that lists buckets for a project, you just need to add access parameters.
48
-
[TODO]() is a safe library crate wrapping this sys crate so more examples using the wrapper library can be found there.
56
+
# Usage
57
+
See the [examples directory](https://github.com/storj-thirdparty/uplink-rust/tree/main/uplink-sys/examples) to see how use the `uplink-sys` crate.
58
+
59
+
Below is an example showing how to list buckets using the crate's unsafe C bindings.
0 commit comments