Private
Public Access
1
0

cargo fix

This commit is contained in:
2025-06-06 16:35:51 -07:00
parent 9e8c976a0e
commit 8cd72d9417
8 changed files with 8 additions and 12 deletions

View File

@@ -16,7 +16,7 @@ use tokio::net::TcpStream;
use futures_util::stream::{BoxStream, Stream};
use futures_util::task::Context;
use futures_util::{SinkExt, StreamExt, TryStreamExt};
use futures_util::{StreamExt, TryStreamExt};
use tokio_tungstenite::connect_async;
use tokio_tungstenite::{MaybeTlsStream, WebSocketStream};

View File

@@ -16,8 +16,7 @@ pub mod event_socket;
pub use event_socket::EventSocket;
use self::http_client::Credentials;
use core::error::Error as StdError;
use std::{fmt::Debug, io::BufRead};
use std::fmt::Debug;
#[async_trait]
pub trait APIInterface {

View File

@@ -16,6 +16,7 @@ use crate::{
use futures_util::stream::BoxStream;
use futures_util::StreamExt;
use bytes::Bytes;
pub struct TestClient {
pub version: &'static str,
@@ -67,6 +68,7 @@ impl EventSocket for TestEventSocket {
#[async_trait]
impl APIInterface for TestClient {
type Error = TestError;
type ResponseStream = BoxStream<'static, Result<Bytes, TestError>>;
async fn authenticate(&mut self, _credentials: Credentials) -> Result<JwtToken, Self::Error> {
Ok(JwtToken::dummy())
@@ -118,7 +120,7 @@ impl APIInterface for TestClient {
Ok(TestEventSocket::new())
}
async fn fetch_attachment_data(&mut self, guid: &String) -> Result<Vec<u8>, Self::Error> {
Ok(vec![])
async fn fetch_attachment_data(&mut self, guid: &String, preview: bool) -> Result<Self::ResponseStream, Self::Error> {
Ok(futures_util::stream::iter(vec![Ok(Bytes::from_static(b"test"))]).boxed())
}
}