fn try_from(room_id_or_alias_id: &'a str) -> Result<Self, Error> {
        validate_id(room_id_or_alias_id)?;

        let mut chars = room_id_or_alias_id.chars();

        let sigil = chars.nth(0).expect("ID missing first character.");

        match sigil {
            '#' => {
                let room_alias_id = RoomAliasId::try_from(room_id_or_alias_id)?;
                Ok(RoomIdOrAliasId::RoomAliasId(room_alias_id))
            }
            '!' => {
                let room_id = RoomId::try_from(room_id_or_alias_id)?;
                Ok(RoomIdOrAliasId::RoomId(room_id))
            }
            _ => Err(Error::MissingSigil)
        }
    }
/// Attempts to create a new Matrix room ID or a room alias ID from a string representation.
///
/// The string must either
/// include the leading ! sigil, the opaque ID, a literal colon, and a valid server name or
/// include the leading # sigil, the alias, a literal colon, and a valid server name.
Attempts to create a new Matrix room ID or a room alias ID from a string representation.
The string must either
include the leading . sigil, the opaque ID, a literal colon, and a valid server name or
include the leading # sigil, the alias, a literal colon, and a valid server name.
Attempts to create a new Matrix room ID or a room alias ID from a string representation . The string must either include the leading . sigil the opaque ID a literal colon and a valid server name or include the leading # sigil the alias a literal colon and a valid server name .
fn try_from(room_id_or_alias_id: &'a str) -> Result<Self, Error> {
        validate_id(room_id_or_alias_id)?;
        let mut chars = room_id_or_alias_id.chars();
        let sigil = chars.nth(0).expect("ID missing first character.");
        match sigil {
            '#' => {
                let room_alias_id = RoomAliasId::try_from(room_id_or_alias_id)?;
                Ok(RoomIdOrAliasId::RoomAliasId(room_alias_id))
            }
            '!' => {
                let room_id = RoomId::try_from(room_id_or_alias_id)?;
                Ok(RoomIdOrAliasId::RoomId(room_id))
            }
            _ => Err(Error::MissingSigil)
        }
    }
fn try_from ( room_id_or_alias_id : & ' a str ) -> Result < Self , Error > { validate_id ( room_id_or_alias_id ) ? ; let mut chars = room_id_or_alias_id . chars ( ) ; let sigil = chars . nth ( 0 ) . expect ( " " ) ; match sigil { '#' => { let room_alias_id = RoomAliasId :: try_from ( room_id_or_alias_id ) ? ; Ok ( RoomIdOrAliasId :: RoomAliasId ( room_alias_id ) ) } '!' => { let room_id = RoomId :: try_from ( room_id_or_alias_id ) ? ; Ok ( RoomIdOrAliasId :: RoomId ( room_id ) ) } _ => Err ( Error :: MissingSigil ) } }
Attempts to create a new Matrix room ID or a room alias ID from a string representation.
Attempts to create a new Matrix room ID or a room alias ID from a string representation .
room_id_or_alias_id
&'a str