diff --git a/atrium-xrpc/src/traits.rs b/atrium-xrpc/src/traits.rs index 78493137..60ca0527 100644 --- a/atrium-xrpc/src/traits.rs +++ b/atrium-xrpc/src/traits.rs @@ -14,12 +14,22 @@ pub trait HttpClient { fn send_http( &self, request: Request>, - ) -> impl Future>, Box>>; + ) -> impl Future< + Output = core::result::Result< + Response>, + Box, + >, + >; #[cfg(not(target_arch = "wasm32"))] fn send_http( &self, request: Request>, - ) -> impl Future>, Box>> + Send; + ) -> impl Future< + Output = core::result::Result< + Response>, + Box, + >, + > + Send; } type XrpcResult = core::result::Result, self::Error>; @@ -39,7 +49,10 @@ pub trait XrpcClient: HttpClient { } #[allow(unused_variables)] #[cfg(not(target_arch = "wasm32"))] - fn authentication_token(&self, is_refresh: bool) -> impl Future> + Send { + fn authentication_token( + &self, + is_refresh: bool, + ) -> impl Future> + Send { async { None } } /// Get the `atproto-proxy` header. @@ -62,7 +75,10 @@ pub trait XrpcClient: HttpClient { } /// Send an XRPC request and return the response. #[cfg(target_arch = "wasm32")] - fn send_xrpc(&self, request: &XrpcRequest) -> impl Future> + fn send_xrpc( + &self, + request: &XrpcRequest, + ) -> impl Future> where P: Serialize + Send + Sync, I: Serialize + Send + Sync, @@ -72,7 +88,10 @@ pub trait XrpcClient: HttpClient { send_xrpc(self, request) } #[cfg(not(target_arch = "wasm32"))] - fn send_xrpc(&self, request: &XrpcRequest) -> impl Future> + Send + fn send_xrpc( + &self, + request: &XrpcRequest, + ) -> impl Future> + Send where P: Serialize + Send + Sync, I: Serialize + Send + Sync, @@ -85,7 +104,10 @@ pub trait XrpcClient: HttpClient { } #[inline(always)] -async fn send_xrpc(client: &C, request: &XrpcRequest) -> XrpcResult +async fn send_xrpc( + client: &C, + request: &XrpcRequest, +) -> XrpcResult where P: Serialize + Send + Sync, I: Serialize + Send + Sync, @@ -148,4 +170,4 @@ where error: serde_json::from_slice::>(&body).ok(), })) } -} \ No newline at end of file +} diff --git a/bsky-sdk/src/agent/config.rs b/bsky-sdk/src/agent/config.rs index 85454ac3..a804e729 100644 --- a/bsky-sdk/src/agent/config.rs +++ b/bsky-sdk/src/agent/config.rs @@ -51,7 +51,9 @@ pub trait Loader { /// Loads the configuration data. fn load( &self, - ) -> impl Future>> + Send; + ) -> impl Future< + Output = core::result::Result>, + > + Send; } /// The trait for saving configuration data. @@ -60,5 +62,7 @@ pub trait Saver { fn save( &self, config: &Config, - ) -> impl Future>> + Send; + ) -> impl Future< + Output = core::result::Result<(), Box>, + > + Send; } diff --git a/bsky-sdk/src/record.rs b/bsky-sdk/src/record.rs index 8c97c5ec..9cf814ea 100644 --- a/bsky-sdk/src/record.rs +++ b/bsky-sdk/src/record.rs @@ -30,21 +30,45 @@ where limit: Option>, ) -> impl Future> + Send; #[cfg(target_arch = "wasm32")] - fn get(agent: &BskyAgent, rkey: String) -> impl Future>; + fn get( + agent: &BskyAgent, + rkey: String, + ) -> impl Future>; #[cfg(not(target_arch = "wasm32"))] - fn get(agent: &BskyAgent, rkey: String) -> impl Future> + Send; + fn get( + agent: &BskyAgent, + rkey: String, + ) -> impl Future> + Send; #[cfg(target_arch = "wasm32")] - fn put(self, agent: &BskyAgent, rkey: String) -> impl Future>; + fn put( + self, + agent: &BskyAgent, + rkey: String, + ) -> impl Future>; #[cfg(not(target_arch = "wasm32"))] - fn put(self, agent: &BskyAgent, rkey: String) -> impl Future> + Send; + fn put( + self, + agent: &BskyAgent, + rkey: String, + ) -> impl Future> + Send; #[cfg(target_arch = "wasm32")] - fn create(self, agent: &BskyAgent) -> impl Future>; + fn create(self, agent: &BskyAgent) + -> impl Future>; #[cfg(not(target_arch = "wasm32"))] - fn create(self, agent: &BskyAgent) -> impl Future> + Send; + fn create( + self, + agent: &BskyAgent, + ) -> impl Future> + Send; #[cfg(target_arch = "wasm32")] - fn delete(agent: &BskyAgent, rkey: String) -> impl Future>; + fn delete( + agent: &BskyAgent, + rkey: String, + ) -> impl Future>; #[cfg(not(target_arch = "wasm32"))] - fn delete(agent: &BskyAgent, rkey: String) -> impl Future> + Send; + fn delete( + agent: &BskyAgent, + rkey: String, + ) -> impl Future> + Send; } macro_rules! record_impl {