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
2 changes: 1 addition & 1 deletion scylla-rust-wrapper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "scylla-cpp-driver-rust"
version = "0.3.0"
edition = "2021"
edition = "2024"
description = "Wrapper for Scylla's Rust driver, exports functions to be used by C"
repository = "https://github.com/scylladb/scylla-rust-driver"
readme = "./README.md"
Expand Down
24 changes: 12 additions & 12 deletions scylla-rust-wrapper/src/batch.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::argconv::{
ArcFFI, BoxFFI, CMut, CassBorrowedExclusivePtr, CassBorrowedSharedPtr, CassOwnedExclusivePtr,
FromBox, FFI,
FFI, FromBox,
};
use crate::cass_error::CassError;
use crate::cass_types::CassConsistency;
use crate::cass_types::{make_batch_type, CassBatchType};
use crate::cass_types::{CassBatchType, make_batch_type};
use crate::exec_profile::PerStatementExecProfile;
use crate::retry_policy::CassRetryPolicy;
use crate::statement::{BoundStatement, CassStatement};
Expand Down Expand Up @@ -32,7 +32,7 @@ pub struct CassBatchState {
pub bound_values: Vec<Vec<MaybeUnset<Option<CassCqlValue>>>>,
}

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn cass_batch_new(
type_: CassBatchType,
) -> CassOwnedExclusivePtr<CassBatch, CMut> {
Expand All @@ -50,12 +50,12 @@ pub unsafe extern "C" fn cass_batch_new(
}
}

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn cass_batch_free(batch: CassOwnedExclusivePtr<CassBatch, CMut>) {
BoxFFI::free(batch);
}

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn cass_batch_set_consistency(
batch: CassBorrowedExclusivePtr<CassBatch, CMut>,
consistency: CassConsistency,
Expand All @@ -72,7 +72,7 @@ pub unsafe extern "C" fn cass_batch_set_consistency(
CassError::CASS_OK
}

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn cass_batch_set_serial_consistency(
batch: CassBorrowedExclusivePtr<CassBatch, CMut>,
serial_consistency: CassConsistency,
Expand All @@ -89,7 +89,7 @@ pub unsafe extern "C" fn cass_batch_set_serial_consistency(
CassError::CASS_OK
}

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn cass_batch_set_retry_policy(
batch: CassBorrowedExclusivePtr<CassBatch, CMut>,
retry_policy: CassBorrowedSharedPtr<CassRetryPolicy, CMut>,
Expand All @@ -112,7 +112,7 @@ pub unsafe extern "C" fn cass_batch_set_retry_policy(
CassError::CASS_OK
}

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn cass_batch_set_timestamp(
batch: CassBorrowedExclusivePtr<CassBatch, CMut>,
timestamp: cass_int64_t,
Expand All @@ -126,7 +126,7 @@ pub unsafe extern "C" fn cass_batch_set_timestamp(
CassError::CASS_OK
}

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn cass_batch_set_request_timeout(
batch: CassBorrowedExclusivePtr<CassBatch, CMut>,
timeout_ms: cass_uint64_t,
Expand All @@ -137,7 +137,7 @@ pub unsafe extern "C" fn cass_batch_set_request_timeout(
CassError::CASS_OK
}

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn cass_batch_set_is_idempotent(
batch: CassBorrowedExclusivePtr<CassBatch, CMut>,
is_idempotent: cass_bool_t,
Expand All @@ -150,7 +150,7 @@ pub unsafe extern "C" fn cass_batch_set_is_idempotent(
CassError::CASS_OK
}

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn cass_batch_set_tracing(
batch: CassBorrowedExclusivePtr<CassBatch, CMut>,
enabled: cass_bool_t,
Expand All @@ -163,7 +163,7 @@ pub unsafe extern "C" fn cass_batch_set_tracing(
CassError::CASS_OK
}

#[no_mangle]
#[unsafe(no_mangle)]
pub unsafe extern "C" fn cass_batch_add_statement(
batch: CassBorrowedExclusivePtr<CassBatch, CMut>,
statement: CassBorrowedSharedPtr<CassStatement, CMut>,
Expand Down
8 changes: 4 additions & 4 deletions scylla-rust-wrapper/src/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

macro_rules! make_index_binder {
($this:ty, $consume_v:expr, $fn_by_idx:ident, $e:expr, [$($arg:ident @ $t:ty), *]) => {
#[no_mangle]
#[unsafe(no_mangle)]
#[allow(clippy::redundant_closure_call)]
pub unsafe extern "C" fn $fn_by_idx(
this: CassBorrowedExclusivePtr<$this, CMut>,
Expand All @@ -70,7 +70,7 @@ macro_rules! make_index_binder {

macro_rules! make_name_binder {
($this:ty, $consume_v:expr, $fn_by_name:ident, $e:expr, [$($arg:ident @ $t:ty), *]) => {
#[no_mangle]
#[unsafe(no_mangle)]
#[allow(clippy::redundant_closure_call)]
pub unsafe extern "C" fn $fn_by_name(
this: CassBorrowedExclusivePtr<$this, CMut>,
Expand All @@ -91,7 +91,7 @@ macro_rules! make_name_binder {

macro_rules! make_name_n_binder {
($this:ty, $consume_v:expr, $fn_by_name_n:ident, $e:expr, [$($arg:ident @ $t:ty), *]) => {
#[no_mangle]
#[unsafe(no_mangle)]
#[allow(clippy::redundant_closure_call)]
pub unsafe extern "C" fn $fn_by_name_n(
this: CassBorrowedExclusivePtr<$this, CMut>,
Expand All @@ -113,7 +113,7 @@ macro_rules! make_name_n_binder {

macro_rules! make_appender {
($this:ty, $consume_v:expr, $fn_append:ident, $e:expr, [$($arg:ident @ $t:ty), *]) => {
#[no_mangle]
#[unsafe(no_mangle)]
#[allow(clippy::redundant_closure_call)]
pub unsafe extern "C" fn $fn_append(
this: CassBorrowedExclusivePtr<$this, CMut>,
Expand Down
Loading