Skip to content

Commit

Permalink
Merge pull request #1163 from wprzytula/restructure-modules
Browse files Browse the repository at this point in the history
Restructure modules - purge `transport` module
  • Loading branch information
wprzytula authored Jan 10, 2025
2 parents 57ad5ad + 005354d commit 7ac4d45
Show file tree
Hide file tree
Showing 156 changed files with 2,151 additions and 1,921 deletions.
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

0 comments on commit 7ac4d45

Please sign in to comment.