Skip to content

Commit ebd4e78

Browse files
committed
libsql: Make Statement::interrupt() immutable
1 parent a9c66e0 commit ebd4e78

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

libsql/src/hrana/hyper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ impl crate::statement::Stmt for crate::hrana::Statement<HttpSender> {
249249
self.run(params).await
250250
}
251251

252-
fn interrupt(&mut self) -> crate::Result<()> {
252+
fn interrupt(&self) -> crate::Result<()> {
253253
Err(crate::Error::Misuse(
254254
"interrupt is not supported for remote connections".to_string(),
255255
))

libsql/src/local/impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl Stmt for LibsqlStmt {
129129
stmt.run(&params)
130130
}
131131

132-
fn interrupt(&mut self) -> Result<()> {
132+
fn interrupt(&self) -> Result<()> {
133133
self.0.interrupt()
134134
}
135135

libsql/src/replication/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ impl Stmt for RemoteStatement {
749749
Ok(())
750750
}
751751

752-
fn interrupt(&mut self) -> Result<()> {
752+
fn interrupt(&self) -> Result<()> {
753753
Err(Error::Misuse(
754754
"interrupt is not supported for remote connections".to_string(),
755755
))

libsql/src/statement.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) trait Stmt {
1414

1515
async fn run(&mut self, params: &Params) -> Result<()>;
1616

17-
fn interrupt(&mut self) -> Result<()>;
17+
fn interrupt(&self) -> Result<()>;
1818

1919
fn reset(&mut self);
2020

@@ -65,7 +65,7 @@ impl Statement {
6565
}
6666

6767
/// Interrupt the statement.
68-
pub fn interrupt(&mut self) -> Result<()> {
68+
pub fn interrupt(&self) -> Result<()> {
6969
self.inner.interrupt()
7070
}
7171

libsql/src/sync/statement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl Stmt for SyncedStatement {
4747
self.inner.run(params).await
4848
}
4949

50-
fn interrupt(&mut self) -> Result<()> {
50+
fn interrupt(&self) -> Result<()> {
5151
self.inner.interrupt()
5252
}
5353

0 commit comments

Comments
 (0)