pub fn into_key_received(
        self,
        event: &mut ToDeviceEvent<KeyEventContent>,
    ) -> Result<SasState<KeyReceived>, SasState<Canceled>> {
        self.check_event(&event.sender, &event.content.transaction_id)
            .map_err(|c| self.clone().cancel(c))?;

        let accepted_protocols = AcceptedProtocols::default();

        let their_pubkey = mem::take(&mut event.content.key);

        self.inner
            .lock()
            .unwrap()
            .set_their_public_key(their_pubkey.clone())
            .expect("Can't set public key");

        Ok(SasState {
            inner: self.inner,
            ids: self.ids,
            verification_flow_id: self.verification_flow_id,
            creation_time: self.creation_time,
            last_event_time: self.last_event_time,
            state: Arc::new(KeyReceived {
                we_started: false,
                their_pubkey,
                accepted_protocols: Arc::new(accepted_protocols),
            }),
        })
    }
/// Receive a m.key.verification.key event, changing the state into
/// a `KeyReceived` one
///
/// # Arguments
///
/// * `event` - The m.key.verification.key event that was sent to us by
/// the other side. The event will be modified so it doesn't contain any key
/// anymore.
Receive a m.key.verification.key event, changing the state into
a `KeyReceived` one
Receive a m . key . verification . key event changing the state into a ` KeyReceived ` one
pub fn into_key_received(
        self,
        event: &mut ToDeviceEvent<KeyEventContent>,
    ) -> Result<SasState<KeyReceived>, SasState<Canceled>> {
        self.check_event(&event.sender, &event.content.transaction_id)
            .map_err(|c| self.clone().cancel(c))?;
        let accepted_protocols = AcceptedProtocols::default();
        let their_pubkey = mem::take(&mut event.content.key);
        self.inner
            .lock()
            .unwrap()
            .set_their_public_key(their_pubkey.clone())
            .expect("Can't set public key");
        Ok(SasState {
            inner: self.inner,
            ids: self.ids,
            verification_flow_id: self.verification_flow_id,
            creation_time: self.creation_time,
            last_event_time: self.last_event_time,
            state: Arc::new(KeyReceived {
                we_started: false,
                their_pubkey,
                accepted_protocols: Arc::new(accepted_protocols),
            }),
        })
    }
pub fn into_key_received ( self , event : & mut ToDeviceEvent < KeyEventContent > , ) -> Result < SasState < KeyReceived > , SasState < Canceled > > { self . check_event ( & event . sender , & event . content . transaction_id ) . map_err ( | c | self . clone ( ) . cancel ( c ) ) ? ; let accepted_protocols = AcceptedProtocols :: default ( ) ; let their_pubkey = mem :: take ( & mut event . content . key ) ; self . inner . lock ( ) . unwrap ( ) . set_their_public_key ( their_pubkey . clone ( ) ) . expect ( " " ) ; Ok ( SasState { inner : self . inner , ids : self . ids , verification_flow_id : self . verification_flow_id , creation_time : self . creation_time , last_event_time : self . last_event_time , state : Arc :: new ( KeyReceived { we_started : false , their_pubkey , accepted_protocols : Arc :: new ( accepted_protocols ) , } ) , } ) }
Receive a m.key.verification.key event, changing the state into
a `KeyReceived` one
Receive a m . key . verification . key event changing the state into a ` KeyReceived ` one
self
event
&mut ToDeviceEvent<KeyEventContent>
self
event
&mut ToDeviceEvent<KeyEventContent>