File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,11 @@ impl Client {
218
218
self . pool . relays ( ) . await
219
219
}
220
220
221
+ /// Get [`Relay`]
222
+ pub async fn relay ( & self , url : & Url ) -> Result < Relay , Error > {
223
+ Ok ( self . pool . relay ( url) . await ?)
224
+ }
225
+
221
226
/// Add new relay
222
227
///
223
228
/// # Example
Original file line number Diff line number Diff line change @@ -177,6 +177,12 @@ impl RelayPool {
177
177
relays. clone ( )
178
178
}
179
179
180
+ /// Get [`Relay`]
181
+ pub async fn relay ( & self , url : & Url ) -> Result < Relay , Error > {
182
+ let relays = self . relays . lock ( ) . await ;
183
+ relays. get ( url) . cloned ( ) . ok_or ( Error :: RelayNotFound )
184
+ }
185
+
180
186
/// Get subscription filters
181
187
pub async fn subscription_filters ( & self ) -> Vec < Filter > {
182
188
self . filters . lock ( ) . await . clone ( )
You can’t perform that action at this time.
0 commit comments