Crate ruma_macros

Source
Expand description

Procedural macros used by ruma crates.

See the documentation for the individual macros for usage details.

Macros§

base64_public_key
Compile-time checked Base64PublicKey construction.
event_enum
Generates an enum to represent the various Matrix event types.
event_id
Compile-time checked EventId construction.
mxc_uri
Compile-time checked MxcUri construction.
room_alias_id
Compile-time checked RoomAliasId construction.
room_id
Compile-time checked RoomId construction.
room_version_id
Compile-time checked RoomVersionId construction.
server_name
Compile-time checked ServerName construction.
server_signing_key_version
Compile-time checked ServerSigningKeyVersion construction.
user_id
Compile-time checked UserId construction.

Attribute Macros§

request
⚠ If this is the only documentation you see, please navigate to the docs for ruma_common::api::request, where actual documentation can be found.
response
⚠ If this is the only documentation you see, please navigate to the docs for ruma_common::api::response, where actual documentation can be found.

Derive Macros§

AsRefStr
Derive the AsRef<str> trait for an enum.
AsStrAsRefStr
Derive the as_str() method using the AsRef<str> implementation of the type.
DebugAsRefStr
Derive the fmt::Debug trait using the AsRef<str> implementation of the type.
DeserializeFromCowStr
Derive the Deserialize trait using the From<Cow<str>> implementation of the type.
DisplayAsRefStr
Derive the fmt::Display trait using the AsRef<str> implementation of the type.
Event
Generates implementations needed to serialize and deserialize Matrix events.
EventContent
Generates an implementation of ruma_events::EventContent.
EventEnumFromEvent
Generates From implementations for event enums.
FromString
Derive the From<T: AsRef<str> + Into<Box<str>>> trait for an enum.
IdZst
Generate methods and trait impl’s for ZST identifier type.
OrdAsRefStr
Derive the Ord trait using the AsRef<str> implementation of the type.
PartialEqAsRefStr
Derive the PartialEq trait using the AsRef<str> implementation of the type.
PartialOrdAsRefStr
Derive the PartialOrd trait using the AsRef<str> implementation of the type.
Request
Internal helper that the request macro delegates most of its work to.
Response
Internal helper that the response macro delegates most of its work to.
SerializeAsRefStr
Derive the Serialize trait using the AsRef<str> implementation of the type.
StringEnum
Shorthand for the derives AsRefStr, FromString, DisplayAsRefStr, DebugAsRefStr, SerializeAsRefStr and DeserializeFromCowStr.