Skip to content

Commit ef185e1

Browse files
committed
feat(sdk): Implement IntoFuture for SendStateEvent
Signed-off-by: Skye Elliot <[email protected]>
1 parent e254011 commit ef185e1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

crates/matrix-sdk/src/room/futures.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,20 @@ impl<'a> SendStateEvent<'a> {
356356
}
357357
}
358358

359+
impl<'a> IntoFuture for SendStateEvent<'a> {
360+
type Output = Result<send_state_event::v3::Response>;
361+
boxed_into_future!(extra_bounds: 'a);
362+
363+
fn into_future(self) -> Self::IntoFuture {
364+
let Self { room, state_key, event_type, content, request_config } = self;
365+
Box::pin(async move {
366+
let content = content?;
367+
assign!(room.send_state_event_raw(&event_type, &state_key, content), { request_config })
368+
.await
369+
})
370+
}
371+
}
372+
359373
/// Future returned by [`Room::send_state_event_raw`].
360374
#[allow(missing_debug_implementations)]
361375
pub struct SendStateEventRaw<'a> {

0 commit comments

Comments
 (0)