fn try_into(self) -> Result<ForwardedRoomKeyEventContent, Self::Error> {
        if self.sender_claimed_keys.len() != 1 {
            Err(())
        } else {
            let (algorithm, claimed_key) = self.sender_claimed_keys.iter().next().ok_or(())?;

            if algorithm != &DeviceKeyAlgorithm::Ed25519 {
                return Err(());
            }

            Ok(ForwardedRoomKeyEventContent {
                algorithm: self.algorithm,
                room_id: self.room_id,
                sender_key: self.sender_key,
                session_id: self.session_id,
                session_key: self.session_key.0.clone(),
                sender_claimed_ed25519_key: claimed_key.to_owned(),
                forwarding_curve25519_key_chain: self.forwarding_curve25519_key_chain,
            })
        }
    }
/// Convert an exported room key into a content for a forwarded room key
/// event.
///
/// This will fail if the exported room key has multiple sender claimed keys
/// or if the algorithm of the claimed sender key isn't
/// `DeviceKeyAlgorithm::Ed25519`.
Convert an exported room key into a content for a forwarded room key
event.

This will fail if the exported room key has multiple sender claimed keys
or if the algorithm of the claimed sender key isn't
`DeviceKeyAlgorithm::Ed25519`.
Convert an exported room key into a content for a forwarded room key event . This will fail if the exported room key has multiple sender claimed keys or if the algorithm of the claimed sender key isn ' t ` DeviceKeyAlgorithm :: Ed25519 ` .
fn try_into(self) -> Result<ForwardedRoomKeyEventContent, Self::Error> {
        if self.sender_claimed_keys.len() != 1 {
            Err(())
        } else {
            let (algorithm, claimed_key) = self.sender_claimed_keys.iter().next().ok_or(())?;
            if algorithm != &DeviceKeyAlgorithm::Ed25519 {
                return Err(());
            }
            Ok(ForwardedRoomKeyEventContent {
                algorithm: self.algorithm,
                room_id: self.room_id,
                sender_key: self.sender_key,
                session_id: self.session_id,
                session_key: self.session_key.0.clone(),
                sender_claimed_ed25519_key: claimed_key.to_owned(),
                forwarding_curve25519_key_chain: self.forwarding_curve25519_key_chain,
            })
        }
    }
fn try_into ( self ) -> Result < ForwardedRoomKeyEventContent , Self :: Error > { if self . sender_claimed_keys . len ( ) != 1 { Err ( ( ) ) } else { let ( algorithm , claimed_key ) = self . sender_claimed_keys . iter ( ) . next ( ) . ok_or ( ( ) ) ? ; if algorithm != & DeviceKeyAlgorithm :: Ed25519 { return Err ( ( ) ) ; } Ok ( ForwardedRoomKeyEventContent { algorithm : self . algorithm , room_id : self . room_id , sender_key : self . sender_key , session_id : self . session_id , session_key : self . session_key . 0 . clone ( ) , sender_claimed_ed25519_key : claimed_key . to_owned ( ) , forwarding_curve25519_key_chain : self . forwarding_curve25519_key_chain , } ) } }
Convert an exported room key into a content for a forwarded room key
event.
Convert an exported room key into a content for a forwarded room key event .
self
self