Skip to content

Commit

Permalink
docs(session): doc adding features using cargo add
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Aug 7, 2024
1 parent f233997 commit d10b71f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
24 changes: 8 additions & 16 deletions actix-session/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,34 +94,26 @@ By default, `actix-session` does not provide any storage backend to retrieve and

- a purely cookie-based "backend", [`CookieSessionStore`], using the `cookie-session` feature flag.

```toml
[dependencies]
# ...
actix-session = { version = "...", features = ["cookie-session"] }
```console
cargo add actix-session --features=cookie-session
```

- a Redis-based backend via the [`redis`] crate, [`RedisSessionStore`], using the `redis-session` feature flag.

```toml
[dependencies]
# ...
actix-session = { version = "...", features = ["redis-session"] }
```console
cargo add actix-session --features=redis-session
```

Add the `redis-session-native-tls` feature flag if you want to connect to Redis using a secure connection (via the `native-tls` crate):

```toml
[dependencies]
# ...
actix-session = { version = "...", features = ["redis-session-native-tls"] }
```console
cargo add actix-session --features=redis-session-native-tls
```

If you, instead, prefer depending on `rustls`, use the `redis-session-rustls` feature flag:

```toml
[dependencies]
# ...
actix-session = { version = "...", features = ["redis-session-rustls"] }
```console
cargo add actix-session --features=redis-session-rustls
```

You can implement your own session storage backend using the [`SessionStore`] trait.
Expand Down
10 changes: 8 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ msrv_rustup := "+" + msrv
clippy:
cargo {{ toolchain }} clippy --workspace --all-targets --all-features

# Format workspace.
# Format project.
[group("lint")]
fmt: update-readmes
cargo +nightly fmt
fd --hidden --extension=yml --extension=md --exec-batch npx -y prettier --write
fd --type=file --hidden --extension=yml --extension=md --exec-batch npx -y prettier --write

# Check project.
[group("lint")]
check:
cargo +nightly fmt -- --check
fd --type=file --hidden --extension=yml --extension=md --exec-batch npx -y prettier --check

# Update READMEs from crate root documentation.
[group("lint")]
Expand Down

0 comments on commit d10b71f

Please sign in to comment.