Skip to content

Commit e9d6191

Browse files
committed
fix: wasm trait bounds
1 parent 1dda8ef commit e9d6191

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

libsql/src/hrana/stream.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ use crate::hrana::cursor::{Cursor, CursorReq};
22
use crate::hrana::proto::{Batch, BatchResult, DescribeResult, Stmt, StmtResult};
33
use crate::hrana::{CursorResponseError, HranaError, HttpSend, Result};
44
use bytes::{Bytes, BytesMut};
5-
use futures::{Stream, StreamExt};
5+
use futures::Stream;
66
use libsql_hrana::proto::{
77
BatchStreamReq, CloseSqlStreamReq, CloseStreamReq, CloseStreamResp, DescribeStreamReq,
88
GetAutocommitStreamReq, PipelineReqBody, PipelineRespBody, SequenceStreamReq,
99
StoreSqlStreamReq, StreamRequest, StreamResponse, StreamResult,
1010
};
11-
use std::pin::pin;
1211
use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU64, Ordering};
1312
use std::sync::Arc;
1413
use tokio::sync::Mutex;

libsql/src/wasm/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ cfg_cloudflare! {
4848
#[derive(Debug, Clone)]
4949
pub struct Connection<T>
5050
where
51-
T: HttpSend,
51+
T: HttpSend + Sync + Send + 'static,
5252
{
5353
conn: HttpConnection<T>,
5454
}
@@ -65,7 +65,7 @@ cfg_cloudflare! {
6565

6666
impl<T> Connection<T>
6767
where
68-
T: HttpSend,
68+
T: HttpSend + Sync + Send + 'static,
6969
<T as HttpSend>::Stream: 'static,
7070
{
7171
pub async fn execute(&self, sql: &str, params: impl IntoParams) -> crate::Result<u64> {
@@ -126,14 +126,14 @@ where
126126
#[derive(Debug, Clone)]
127127
pub struct Transaction<T>
128128
where
129-
T: HttpSend,
129+
T: HttpSend + Sync + Send + 'static,
130130
{
131131
inner: HttpTransaction<T>,
132132
}
133133

134134
impl<T> Transaction<T>
135135
where
136-
T: HttpSend,
136+
T: HttpSend + Sync + Send + 'static,
137137
<T as HttpSend>::Stream: 'static,
138138
{
139139
pub async fn query(&self, sql: &str, params: impl IntoParams) -> crate::Result<Rows> {

libsql/src/wasm/rows.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::hrana::HranaRows;
2+
use crate::hrana::HttpSend;
23
use crate::Row;
34
use bytes::Bytes;
45
use futures::Stream;
@@ -42,8 +43,9 @@ pub(super) trait RowsInner {
4243
}
4344

4445
#[async_trait::async_trait(?Send)]
45-
impl<S> RowsInner for HranaRows<S>
46+
impl<S, T> RowsInner for HranaRows<S, T>
4647
where
48+
T: HttpSend + Sync + Send + 'static,
4749
S: Stream<Item = std::io::Result<Bytes>> + Unpin,
4850
{
4951
async fn next(&mut self) -> crate::Result<Option<Row>> {

0 commit comments

Comments
 (0)