[][src]Struct ruma_identifiers::RoomId

pub struct RoomId { /* fields omitted */ }

A Matrix room ID.

A RoomId is generated randomly or converted from a string slice, and can be converted back into a string as needed.

assert_eq!(
    RoomId::try_from("!n8f893n9:example.com").unwrap().as_ref(),
    "!n8f893n9:example.com"
);

Methods

impl RoomId[src]

pub fn new(server_name: &str) -> Result<Self, Error>[src]

This is supported on feature="rand" only.

Attempts to generate a RoomId for the given origin server with a localpart consisting of 18 random ASCII characters.

Fails if the given homeserver cannot be parsed as a valid host.

pub fn localpart(&self) -> &str[src]

Returns the rooms's unique ID.

pub fn server_name(&self) -> &str[src]

Returns the server name of the room ID.

Trait Implementations

impl<'expr> AsExpression<Nullable<Text>> for &'expr RoomId[src]

type Expression = Bound<Nullable<Text>, Self>

The expression being returned

impl AsExpression<Nullable<Text>> for RoomId[src]

type Expression = Bound<Nullable<Text>, Self>

The expression being returned

impl<'expr> AsExpression<Text> for &'expr RoomId[src]

type Expression = Bound<Text, Self>

The expression being returned

impl AsExpression<Text> for RoomId[src]

type Expression = Bound<Text, Self>

The expression being returned

impl AsRef<str> for RoomId[src]

impl Clone for RoomId[src]

impl Debug for RoomId[src]

impl<'de> Deserialize<'de> for RoomId[src]

impl Display for RoomId[src]

impl Eq for RoomId[src]

impl From<RoomId> for String[src]

impl From<RoomId> for RoomIdOrAliasId[src]

impl<DB> FromSql<Text, DB> for RoomId where
    String: FromSql<Text, DB>,
    DB: Backend, 
[src]

impl<__ST, __DB> FromSqlRow<__ST, __DB> for RoomId where
    __DB: Backend,
    Self: FromSql<__ST, __DB>, 
[src]

impl Hash for RoomId[src]

impl NotNull for RoomId[src]

impl Ord for RoomId[src]

impl<'_> PartialEq<&'_ str> for RoomId[src]

impl PartialEq<RoomId> for RoomId[src]

impl<'_> PartialEq<RoomId> for &'_ str[src]

impl PartialEq<RoomId> for String[src]

impl PartialEq<String> for RoomId[src]

impl PartialOrd<RoomId> for RoomId[src]

impl QueryId for RoomId[src]

type QueryId = RoomId

A type which uniquely represents Self in a SQL query. Read more

impl<__ST, __DB> Queryable<__ST, __DB> for RoomId where
    __DB: Backend,
    Self: FromSql<__ST, __DB>, 
[src]

type Row = Self

The Rust type you'd like to map from. Read more

impl Serialize for RoomId[src]

impl SingleValue for RoomId[src]

impl<__DB> ToSql<Nullable<Text>, __DB> for RoomId where
    __DB: Backend,
    Self: ToSql<Text, __DB>, 
[src]

impl<DB> ToSql<Text, DB> for RoomId where
    DB: Backend, 
[src]

impl<'_> TryFrom<&'_ str> for RoomId[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'_> TryFrom<Cow<'_, str>> for RoomId[src]

type Error = Error

The type returned in the event of a conversion error.

fn try_from(room_id: Cow<str>) -> Result<Self, Error>[src]

Attempts to create a new Matrix room ID from a string representation.

The string must include the leading ! sigil, the localpart, a literal colon, and a server name.

impl TryFrom<RoomIdOrAliasId> for RoomId[src]

type Error = RoomAliasId

The type returned in the event of a conversion error.

impl TryFrom<String> for RoomId[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for RoomId

impl Send for RoomId

impl Sync for RoomId

impl Unpin for RoomId

impl UnwindSafe for RoomId

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoNullable for T where
    T: NotNull, 

type Nullable = Nullable<T>

The nullable representation of this type. Read more

impl<T> IntoSql for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,