Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure modules - purge transport module #1163

Merged
merged 60 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
0eb98bc
appease new clippy requirement
wprzytula Jan 9, 2025
810f5da
statement mod: add docstring
wprzytula Jan 1, 2025
b868606
topology->metadata
wprzytula Aug 30, 2023
49a2e3c
introduce client module
wprzytula Jan 9, 2025
1fb4791
move session & friends to client module
wprzytula Aug 30, 2023
2dab1b5
move caching_session.rs to new client module
wprzytula Aug 30, 2023
1db3585
re-export Compression in client module
wprzytula Dec 29, 2024
515ecbe
re-export PoolSize in client module
wprzytula Jan 9, 2025
9215071
move SelfIdentity to client module
wprzytula Jan 9, 2025
85df192
client: add module docstring
wprzytula Jan 1, 2025
c396e6d
extract network module
wprzytula Jan 9, 2025
39f06c0
move open_connection_to_shard_aware_port() to connection
wprzytula Aug 30, 2023
71e6be4
connection: reduce visibility of some functions
wprzytula Jan 4, 2025
459eb6b
connection: make perform_authenticate a method
wprzytula Jan 4, 2025
103229b
network: add module docstring
wprzytula Jan 1, 2025
7e51679
move metadata.rs to new cluster mod
wprzytula Aug 30, 2023
6568fda
move cluster.rs to new cluster mod
wprzytula Aug 30, 2023
cf2c121
cluster: rename ClusterData -> ClusterState
wprzytula Jan 9, 2025
f86fe33
cluster: extract state.rs
wprzytula Jan 8, 2025
ea2f5f0
cluster: rename cluster.rs -> worker.rs
wprzytula Jan 8, 2025
db23b64
move node.rs to new cluster mod
wprzytula Dec 7, 2024
c6ca6d7
node: fix typo
wprzytula Jan 1, 2025
c9ae2b8
cluster: add module docstring
wprzytula Jan 1, 2025
e4b2aea
metadata: add module docstring
wprzytula Jan 8, 2025
9d06732
introduce policies module
wprzytula Jan 4, 2025
ca39edd
move host_filter.rs to policies module
wprzytula Jan 4, 2025
b3296ad
extract address_translator.rs in policies module
wprzytula Jan 4, 2025
9adf441
move execution_profile.rs to client module
wprzytula Jan 1, 2025
a5acb87
move load_balancing to policies module
wprzytula Jan 1, 2025
e1c14b0
move speculative_execution.rs to new policies mod
wprzytula Dec 18, 2024
2b22aeb
move retry policies to the new policies mod
wprzytula Dec 18, 2024
dc24dc9
extract and restructure retry module
wprzytula Dec 18, 2024
b304840
lib: remove retry reexport
wprzytula Jan 5, 2025
fd698ba
lib: remove speculative_execution reexport
wprzytula Jan 5, 2025
4dbbf47
lib: remove load_balancing reexport
wprzytula Jan 5, 2025
2384aa4
lib: remove host_filter reexport
wprzytula Jan 5, 2025
3169673
lib: remove ExecutionProfile reexport
wprzytula Jan 9, 2025
77b43af
introduce observability module
wprzytula Jan 4, 2025
17a4ae9
move history.rs to observability module
wprzytula Jan 4, 2025
0f1c0f2
move tracing.rs to observability module
wprzytula Jan 4, 2025
9317c93
move metrics.rs to observability module
wprzytula Dec 29, 2024
d3a8289
scylla/lib.rs: remove Metrics re-export
wprzytula Jan 8, 2025
a3106b6
extract driver_tracing.rs with RequestSpan
wprzytula Dec 29, 2024
53708cc
move iterator.rs to session module as pager.rs
wprzytula Dec 29, 2024
d15a8ef
move errors.rs out of transport module
wprzytula Jan 4, 2025
ab0a6f2
make routing.rs a separate directory
wprzytula Dec 29, 2024
13a5948
extract sharding.rs
wprzytula Dec 29, 2024
280921a
move partitioner.rs to routing mod
wprzytula Dec 29, 2024
ff2aa17
partitioner: add module docstring
wprzytula Jan 1, 2025
256ce58
move locator.rs to routing module
wprzytula Jan 1, 2025
5628636
routing: add module docstring
wprzytula Jan 1, 2025
6723dd6
introduce response module
wprzytula Dec 29, 2024
c1580e1
move [NonError]QueryResponse to response module
wprzytula Dec 29, 2024
5f0232d
move [legacy_]query_result.rs to response module
wprzytula Dec 29, 2024
34b6eeb
lib: remove [Legacy]QueryResult reexport
wprzytula Jan 9, 2025
99492dd
re-export PagingState[Response] in response mod
wprzytula Dec 29, 2024
64a683a
statement: remove PagingState[Response] re-export
wprzytula Jan 8, 2025
098b6dd
response: add module docstring
wprzytula Jan 1, 2025
0169f42
re-export Authenticator in authentication module
wprzytula Dec 29, 2024
005354d
finally! annihilate transport module
wprzytula Dec 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/source/connecting/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ To use the default authentication, specify credentials using the `user` method i
# extern crate tokio;
# use std::error::Error;
# async fn check_only_compiles() -> Result<(), Box<dyn Error>> {
use scylla::{Session, SessionBuilder};
use scylla::client::session::Session;
use scylla::client::session_builder::SessionBuilder;

let session: Session = SessionBuilder::new()
.known_node("127.0.0.1:9042")
Expand All @@ -21,7 +22,8 @@ let session: Session = SessionBuilder::new()
# Ok(())
# }
```
### Custom Authentication

### Custom Authentication

A custom authentication is defined by implementing the `AuthenticatorSession`.
An `AuthenticatorSession` instance is created per session, so it is also necessary to define a `AuthenticatorProvider` for it.
Expand Down Expand Up @@ -79,7 +81,8 @@ impl AuthenticatorProvider for CustomAuthenticatorProvider {
}

async fn authentication_example() -> Result<(), Box<dyn Error>> {
use scylla::{Session, SessionBuilder};
use scylla::client::session::Session;
use scylla::client::session_builder::SessionBuilder;

let _session: Session = SessionBuilder::new()
.known_node("127.0.0.1:9042")
Expand Down
5 changes: 3 additions & 2 deletions docs/source/connecting/compression.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ An example enabling `Snappy` compression algorithm:
```rust
# extern crate scylla;
# extern crate tokio;
use scylla::{Session, SessionBuilder};
use scylla::transport::Compression;
use scylla::client::session::Session;
use scylla::client::session_builder::SessionBuilder;
use scylla::client::Compression;
use std::error::Error;

#[tokio::main]
Expand Down
5 changes: 3 additions & 2 deletions docs/source/connecting/connecting.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ When creating a `Session` you can specify a few known nodes to which the driver
```rust
# extern crate scylla;
# extern crate tokio;
use scylla::{Session, SessionBuilder};
use scylla::client::session::Session;
use scylla::client::session_builder::SessionBuilder;
use std::error::Error;
use std::time::Duration;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
Expand Down Expand Up @@ -66,7 +67,7 @@ specify the secure connection bundle as follows:
# fn check_only_compiles() {
use std::path::Path;
use std::error::Error;
use scylla::CloudSessionBuilder;
use scylla::client::session_builder::CloudSessionBuilder;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
Expand Down
3 changes: 2 additions & 1 deletion docs/source/connecting/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ For example, if database certificate is in the file `ca.crt`:
```rust
# extern crate scylla;
# extern crate openssl;
use scylla::{Session, SessionBuilder};
use scylla::client::session::Session;
use scylla::client::session_builder::SessionBuilder;
use openssl::ssl::{SslContextBuilder, SslMethod, SslVerifyMode};
use std::path::PathBuf;

Expand Down
2 changes: 1 addition & 1 deletion docs/source/data-types/blob.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
12 changes: 6 additions & 6 deletions docs/source/data-types/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down Expand Up @@ -34,7 +34,7 @@ while let Some((list_value,)) = stream.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand All @@ -59,7 +59,7 @@ while let Some((set_value,)) = stream.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand All @@ -85,7 +85,7 @@ while let Some((set_value,)) = iter.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down Expand Up @@ -114,7 +114,7 @@ while let Some((set_value,)) = iter.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down Expand Up @@ -142,7 +142,7 @@ while let Some((map_value,)) = iter.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data-types/counter.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
6 changes: 3 additions & 3 deletions docs/source/data-types/date.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ However, for most use cases other types are more practical. See following sectio
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use scylla::frame::value::CqlDate;
Expand Down Expand Up @@ -51,7 +51,7 @@ If full range is not required and `chrono-04` feature is enabled,
# extern crate chrono;
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use chrono::NaiveDate;
Expand Down Expand Up @@ -87,7 +87,7 @@ documentation to get more info.
# extern crate scylla;
# extern crate time;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
4 changes: 2 additions & 2 deletions docs/source/data-types/decimal.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Without any feature flags, the user can interact with `decimal` type by making u
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down Expand Up @@ -41,7 +41,7 @@ To make use of `bigdecimal::Bigdecimal` type, user should enable `bigdecimal-04`
# extern crate scylla;
# extern crate bigdecimal;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data-types/duration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data-types/inet.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
14 changes: 7 additions & 7 deletions docs/source/data-types/primitive.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down Expand Up @@ -36,7 +36,7 @@ while let Some((bool_value,)) = iter.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down Expand Up @@ -65,7 +65,7 @@ while let Some((tinyint_value,)) = iter.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down Expand Up @@ -94,7 +94,7 @@ while let Some((smallint_value,)) = iter.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down Expand Up @@ -123,7 +123,7 @@ while let Some((int_value,)) = iter.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down Expand Up @@ -152,7 +152,7 @@ while let Some((bigint_value,)) = iter.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down Expand Up @@ -181,7 +181,7 @@ while let Some((float_value,)) = iter.try_next().await? {
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data-types/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
6 changes: 3 additions & 3 deletions docs/source/data-types/time.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ However, for most use cases other types are more practical. See following sectio
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use scylla::frame::value::CqlTime;
Expand Down Expand Up @@ -51,7 +51,7 @@ second to `CqlTime` or write it to the database will return an error.
# extern crate chrono;
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use chrono::NaiveTime;
Expand Down Expand Up @@ -85,7 +85,7 @@ with the database.
# extern crate scylla;
# extern crate time;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
6 changes: 3 additions & 3 deletions docs/source/data-types/timestamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ However, for most use cases other types are more practical. See following sectio
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use scylla::frame::value::CqlTimestamp;
Expand Down Expand Up @@ -52,7 +52,7 @@ timezone information. Any precision finer than 1ms will be lost.
# extern crate chrono;
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, Utc};
Expand Down Expand Up @@ -93,7 +93,7 @@ than 1ms will also be lost.
# extern crate scylla;
# extern crate time;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
4 changes: 2 additions & 2 deletions docs/source/data-types/timeuuid.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Also, `value::CqlTimeuuid` is a wrapper for `uuid::Uuid` with custom ordering lo
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# use std::str::FromStr;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
Expand Down Expand Up @@ -47,7 +47,7 @@ and now you're gonna be able to use the `uuid::v1` features:
# extern crate uuid;
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# use std::str::FromStr;
use futures::TryStreamExt;
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data-types/tuple.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data-types/udt.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Now it can be sent and received just like any other CQL value:
```rust
# extern crate scylla;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data-types/uuid.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# extern crate scylla;
# extern crate uuid;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data-types/varint.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Without any feature flags, the user can interact with `Varint` type by making us
# extern crate scylla;
# extern crate num_bigint;
# extern crate futures;
# use scylla::Session;
# use scylla::client::session::Session;
# use std::error::Error;
# async fn check_only_compiles(session: &Session) -> Result<(), Box<dyn Error>> {
use futures::TryStreamExt;
Expand Down
Loading
Loading