]>
piware.de Git - learn-rust.git/log
summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Martin Pitt [Mon, 30 Aug 2021 17:39:44 +0000 (19:39 +0200)]
simple-http: Initial skeleton
Martin Pitt [Sun, 29 Aug 2021 14:45:02 +0000 (16:45 +0200)]
concepts: Add alternative Post implementation with states as types
Martin Pitt [Sun, 29 Aug 2021 14:25:47 +0000 (16:25 +0200)]
concepts: require two Post approvals
Martin Pitt [Sun, 29 Aug 2021 14:21:01 +0000 (16:21 +0200)]
concepts: Add Post.reject() transition
Martin Pitt [Sun, 29 Aug 2021 14:12:41 +0000 (16:12 +0200)]
concepts: Rewrite Post without Option
This gets rid of a lot of extra Option handling code, at the price of
having to rebuild instead of pass through non-changing states.
Martin Pitt [Sun, 29 Aug 2021 13:55:13 +0000 (15:55 +0200)]
concepts: Dynamic trait objects
Martin Pitt [Sun, 29 Aug 2021 08:15:43 +0000 (10:15 +0200)]
concepts: Shared memory and mutex between threads
Martin Pitt [Sun, 29 Aug 2021 07:21:30 +0000 (09:21 +0200)]
concepts: Threads and message passing
Martin Pitt [Sun, 29 Aug 2021 06:49:44 +0000 (08:49 +0200)]
concepts: Rewrite Cacher tests using RefCell
Avoids an external crate.
Martin Pitt [Sun, 29 Aug 2021 05:54:59 +0000 (07:54 +0200)]
Move top-level files into concepts/
As this now contains multiple projects, it was too messy.
Martin Pitt [Fri, 27 Aug 2021 12:49:22 +0000 (14:49 +0200)]
Call Rust function from C: Complex cases
Add three functions which take/return strings and string arrays. This
creates some interesting problems how to combine the C semantics of
returning a char** with the Rust semantics of freeing objects once they
go out of scope.
This now also relies on the Rust standard library, which needs a few
system libraries. Link them.
Martin Pitt [Fri, 27 Aug 2021 09:08:54 +0000 (11:08 +0200)]
Call Rust function from C: Skeleton
Martin Pitt [Fri, 27 Aug 2021 07:27:37 +0000 (09:27 +0200)]
Implement the rest of c-mounts.c in Rust
Use errno crate for human-readable error formatting.
Martin Pitt [Fri, 27 Aug 2021 06:43:12 +0000 (08:43 +0200)]
Initial libmount function call from Rust
Follow "A little C with your Rust" [1].
Set up cargo and main.rs skeleton and call one of the simplest possible
functions from libmount: mnt_get_fstab_path().
Use bindgen [1] to translate libmount's header file into a Rust
interface. This requires a few hacks:
- bindgen does not accept the original header right away, as it can't
find stdarg.h. Avoid this by dropping the (unnecessary) stdio.h
include.
- bindgen does not know about `size_t`. Hack around that with a typedef
for now.
- Suppress warnings about constant/identifier naming.
[1] https://rust-lang.github.io/rust-bindgen/command-line-usage.html
[2] https://docs.rust-embedded.org/book/interoperability/c-with-rust.html
Martin Pitt [Fri, 27 Aug 2021 05:09:50 +0000 (07:09 +0200)]
C from Rust: Reference C programs
Martin Pitt [Fri, 27 Aug 2021 04:56:44 +0000 (06:56 +0200)]
Add .gitignore
Martin Pitt [Thu, 26 Aug 2021 16:30:39 +0000 (18:30 +0200)]
Iterators
Martin Pitt [Thu, 26 Aug 2021 15:23:55 +0000 (17:23 +0200)]
Consistently use into_iter() with collect()
Martin Pitt [Wed, 25 Aug 2021 06:36:47 +0000 (08:36 +0200)]
Replace unsafe test code with global_counter
https://docs.rs/crate/global_counter
Martin Pitt [Wed, 25 Aug 2021 06:25:30 +0000 (08:25 +0200)]
Closures and Cacher object
Martin Pitt [Tue, 24 Aug 2021 07:56:13 +0000 (09:56 +0200)]
Add integration test
Martin Pitt [Tue, 24 Aug 2021 07:51:38 +0000 (09:51 +0200)]
Move helper functions into src/lib.rs
This enables writing integration tests. Pure binary crates can't have
them:
https://doc.rust-lang.org/stable/book/ch11-03-test-organization.html#integration-tests-for-binary-crates
Martin Pitt [Tue, 24 Aug 2021 05:21:03 +0000 (07:21 +0200)]
Generics and Traits
Martin Pitt [Tue, 24 Aug 2021 04:53:24 +0000 (06:53 +0200)]
Return style fix
Martin Pitt [Mon, 23 Aug 2021 12:07:13 +0000 (14:07 +0200)]
File reading with standard fs API
Martin Pitt [Mon, 23 Aug 2021 12:02:33 +0000 (14:02 +0200)]
File reading and error handling using ?
Martin Pitt [Mon, 23 Aug 2021 11:52:54 +0000 (13:52 +0200)]
File reading and simple error handling
Martin Pitt [Mon, 23 Aug 2021 11:18:15 +0000 (13:18 +0200)]
Split into functions
Martin Pitt [Mon, 23 Aug 2021 10:03:33 +0000 (12:03 +0200)]
HashMap
Martin Pitt [Sun, 22 Aug 2021 14:17:51 +0000 (16:17 +0200)]
test word_utils
Martin Pitt [Sun, 22 Aug 2021 14:03:34 +0000 (16:03 +0200)]
Vector iteration
Martin Pitt [Sun, 22 Aug 2021 13:31:47 +0000 (15:31 +0200)]
Move word_utils to separate file
Martin Pitt [Sun, 22 Aug 2021 13:24:27 +0000 (15:24 +0200)]
Put functions into module
Martin Pitt [Sun, 22 Aug 2021 13:21:27 +0000 (15:21 +0200)]
References, slices, Option