Skip to content

Commit 2e3f96e

Browse files
committed
Expose Relay::ban
Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 13e8cc8 commit 2e3f96e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131

3232
* Bump upstream deps to ce2ba11a
3333

34+
## Added
35+
36+
* Expose `Relay::ban`
37+
3438
## 0.40.2
3539

3640
### Fixed

src/relay/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,18 @@ impl JsRelay {
185185
self.inner.try_connect(**timeout).await.map_err(into_err)
186186
}
187187

188-
/// Disconnect from relay and set status to 'Terminated'
188+
/// Disconnect from relay and set status to `Terminated`
189189
pub fn disconnect(&self) {
190190
self.inner.disconnect()
191191
}
192192

193+
/// Ban relay and set status to `Banned`.
194+
///
195+
/// A banned relay can't reconnect again.
196+
pub fn ban(&self) {
197+
self.inner.ban()
198+
}
199+
193200
/// Send msg to relay
194201
#[wasm_bindgen(js_name = sendMsg)]
195202
pub fn send_msg(&self, msg: &JsClientMessage) -> Result<()> {

0 commit comments

Comments
 (0)