Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions scylla-cql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ keywords = ["database", "scylla", "cql", "cassandra"]
categories = ["database"]
license = "MIT OR Apache-2.0"

[package.metadata."docs.rs"]
all-features = true

[dependencies]
# Important: We use precise version of scylla-macros. This enables
# us to make breaking changes in the doc(hidden) interfaces that are
Expand Down
3 changes: 3 additions & 0 deletions scylla-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ license = "MIT OR Apache-2.0"
[lib]
proc-macro = true

[package.metadata."docs.rs"]
all-features = true

[dependencies]
darling = "0.20.10"
syn = "2.0"
Expand Down
3 changes: 3 additions & 0 deletions scylla-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ keywords = ["database", "scylla", "cql", "cassandra"]
categories = ["database"]
license = "MIT OR Apache-2.0"

[package.metadata."docs.rs"]
all-features = true

[features]
defaults = []

Expand Down
2 changes: 1 addition & 1 deletion scylla/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["database", "scylla", "cql", "cassandra"]
categories = ["database"]
license = "MIT OR Apache-2.0"

[package.metadata.docs.rs]
[package.metadata."docs.rs"]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

Expand Down
49 changes: 28 additions & 21 deletions scylla/src/client/session_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,27 +329,34 @@ impl GenericSessionBuilder<DefaultMode> {
///
/// Default is None.
///
/// # Example
/// ```
/// # use std::fs;
/// # use std::path::PathBuf;
/// # use scylla::client::session::Session;
/// # use scylla::client::session_builder::SessionBuilder;
/// # use openssl::ssl::{SslContextBuilder, SslVerifyMode, SslMethod, SslFiletype};
/// # async fn example() -> Result<(), Box<dyn std::error::Error>> {
/// let certdir = fs::canonicalize(PathBuf::from("./examples/certs/scylla.crt"))?;
/// let mut context_builder = SslContextBuilder::new(SslMethod::tls())?;
/// context_builder.set_certificate_file(certdir.as_path(), SslFiletype::PEM)?;
/// context_builder.set_verify(SslVerifyMode::NONE);
///
/// let session: Session = SessionBuilder::new()
/// .known_node("127.0.0.1:9042")
/// .tls_context(Some(context_builder.build()))
/// .build()
/// .await?;
/// # Ok(())
/// # }
/// ```
#[cfg_attr(
feature = "openssl-010",
doc = r#"
# Example

```
# async fn example() -> Result<(), Box<dyn std::error::Error>> {
use std::fs;
use std::path::PathBuf;
use scylla::client::session::Session;
use scylla::client::session_builder::SessionBuilder;
use openssl::ssl::{SslContextBuilder, SslVerifyMode, SslMethod, SslFiletype};

let certdir = fs::canonicalize(PathBuf::from("./examples/certs/scylla.crt"))?;
let mut context_builder = SslContextBuilder::new(SslMethod::tls())?;
context_builder.set_certificate_file(certdir.as_path(), SslFiletype::PEM)?;
context_builder.set_verify(SslVerifyMode::NONE);

let session: Session = SessionBuilder::new()
.known_node("127.0.0.1:9042")
.tls_context(Some(context_builder.build()))
.build()
.await?;
# Ok(())
# }
```
"#
)]
pub fn tls_context(mut self, tls_context: Option<impl Into<TlsContext>>) -> Self {
self.config.tls_context = tls_context.map(|t| t.into());
self
Expand Down
3 changes: 2 additions & 1 deletion scylla/src/cloud/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ pub enum CloudConfigError {

/// Configuration for creating a session to a serverless cluster.
/// This can be automatically created if you provide the bundle path
/// to the [`CloudSessionBuilder`] constructor.
/// to the [`CloudSessionBuilder`](crate::client::session_builder::CloudSessionBuilder)
/// constructor.
#[derive(Debug)]
pub struct CloudConfig {
datacenters: HashMap<String, Datacenter>,
Expand Down
Loading