@@ -134,30 +134,30 @@ pub(super) struct ReadEventResponse {
134134}
135135
136136#[ derive( Serialize , Debug ) ]
137- pub struct SendEventResponse {
137+ pub ( crate ) struct SendEventResponse {
138138 /// The room id for the send event.
139- pub room_id : Option < OwnedRoomId > ,
139+ pub ( crate ) room_id : Option < OwnedRoomId > ,
140140 /// The event id of the send event. Its optional because if its a future one
141141 /// does not get the event_id at this point.
142- pub event_id : Option < OwnedEventId > ,
142+ pub ( crate ) event_id : Option < OwnedEventId > ,
143143 /// A token to send/insert the future into the DAG.
144- pub send_token : Option < String > ,
144+ pub ( crate ) send_token : Option < String > ,
145145 /// A token to cancel this future. It will never be send if this is called.
146- pub cancel_token : Option < String > ,
146+ pub ( crate ) cancel_token : Option < String > ,
147147 /// The `future_group_id` generated for this future. Used to connect
148148 /// multiple futures only one of the connected futures will be sent and
149149 /// inserted into the DAG.
150- pub future_group_id : Option < String > ,
150+ pub ( crate ) future_group_id : Option < String > ,
151151 /// A token used to refresh the timer of the future. This allows
152152 /// to implement heartbeat like capabilities. An event is only sent once
153153 /// a refresh in the timeout interval is missed.
154154 ///
155155 /// If the future does not have a timeout this will be `None`.
156- pub refresh_token : Option < String > ,
156+ pub ( crate ) refresh_token : Option < String > ,
157157}
158158
159159impl SendEventResponse {
160- pub fn from_event_id ( event_id : OwnedEventId ) -> Self {
160+ pub ( crate ) fn from_event_id ( event_id : OwnedEventId ) -> Self {
161161 SendEventResponse {
162162 room_id : None ,
163163 event_id : Some ( event_id) ,
@@ -167,32 +167,33 @@ impl SendEventResponse {
167167 refresh_token : None ,
168168 }
169169 }
170- pub fn set_room_id ( & mut self , room_id : OwnedRoomId ) {
170+ pub ( crate ) fn set_room_id ( & mut self , room_id : OwnedRoomId ) {
171171 self . room_id = Some ( room_id) ;
172172 }
173173}
174- impl Into < SendEventResponse > for future:: send_future_message_event:: unstable:: Response {
175- fn into ( self ) -> SendEventResponse {
174+
175+ impl From < future:: send_future_message_event:: unstable:: Response > for SendEventResponse {
176+ fn from ( val : future:: send_future_message_event:: unstable:: Response ) -> Self {
176177 SendEventResponse {
177178 room_id : None ,
178179 event_id : None ,
179- send_token : Some ( self . send_token ) ,
180- cancel_token : Some ( self . cancel_token ) ,
181- future_group_id : Some ( self . future_group_id ) ,
182- refresh_token : self . refresh_token ,
180+ send_token : Some ( val . send_token ) ,
181+ cancel_token : Some ( val . cancel_token ) ,
182+ future_group_id : Some ( val . future_group_id ) ,
183+ refresh_token : val . refresh_token ,
183184 }
184185 }
185186}
186187
187- impl Into < SendEventResponse > for future:: send_future_state_event:: unstable:: Response {
188- fn into ( self ) -> SendEventResponse {
188+ impl From < future:: send_future_state_event:: unstable:: Response > for SendEventResponse {
189+ fn from ( val : future :: send_future_state_event :: unstable :: Response ) -> Self {
189190 SendEventResponse {
190191 room_id : None ,
191192 event_id : None ,
192- send_token : Some ( self . send_token ) ,
193- cancel_token : Some ( self . cancel_token ) ,
194- future_group_id : Some ( self . future_group_id ) ,
195- refresh_token : self . refresh_token ,
193+ send_token : Some ( val . send_token ) ,
194+ cancel_token : Some ( val . cancel_token ) ,
195+ future_group_id : Some ( val . future_group_id ) ,
196+ refresh_token : val . refresh_token ,
196197 }
197198 }
198199}
0 commit comments