Skip to content

Commit

Permalink
Tweak documents
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed Jul 2, 2024
1 parent 0ea3542 commit 21dfd30
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- [Handling Scalar](./scalar.md)
- [Optional Argument](./optional_arg.md)
- [Type-specific Topics](./type-overview.md)
- [Integer, Real, String, Logical, And Complex](./atomic_types.md)
- [Integer, Real, String, Logical, Raw, And Complex](./atomic_types.md)
- [List](./list.md)
- [Struct](./struct.md)
- [Enum](./enum.md)
Expand Down
9 changes: 8 additions & 1 deletion book/src/atomic_types.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Integer, Real, String, Logical, And Complex
# Integer, Real, String, Logical, Raw, And Complex

## Integer and real

Expand Down Expand Up @@ -213,6 +213,13 @@ very unsafe.
[Rf_translateCharUTF8]: https://github.com/wch/r-source/blob/c3423d28830acbbbf7b38daa58f436fb06d91381/src/main/sysutils.c#L1284-L1296


## Raw

A raw vector is the sequence of `u8`, which can be used for representing various
binary data. But, please be aware that you can use a Rust struct (see [the
section about struct](./struct.md)) to store the data instead of copying the
whole data into R's memory.

## Complex

Complex is optionally supported under feature flag `complex`. If it's enabled,
Expand Down
1 change: 1 addition & 0 deletions book/src/scalar.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fn scalar_input_int(x: i32) -> savvy::Result<()> {
| integer | `i32` |
| double | `f64` |
| logical | `bool` |
| raw | `u8` |
| character | `&str` |
| complex | `num_complex::Complex64` |
| integer or double | `savvy::NumericScalar` |
Expand Down
1 change: 1 addition & 0 deletions book/src/type-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ You can use these types as an argument of a `#[savvy]` function.
| double | `RealSexp` | `f64` |
| integer or double | `NumericSexp` | `NumericScalar` |
| logical | `LogicalSexp` | `bool` |
| raw | `RawSexp` | `u8` |
| character | `StringSexp` | `&str` |
| complex[^1] | `ComplexSexp` | `Complex64` |
| list | `ListSexp` | n/a |
Expand Down

0 comments on commit 21dfd30

Please sign in to comment.