Struct ruma_common::events::location::LocationEventContent
source · [−]pub struct LocationEventContent {
pub message: MessageContent,
pub location: LocationContent,
pub asset: AssetContent,
pub ts: Option<MilliSecondsSinceUnixEpoch>,
pub relates_to: Option<Relation>,
}events and unstable-msc3488 only.Expand description
The payload for an extensible location message.
This is the new primary type introduced in MSC3488 and should not be sent before the end of
the transition period. See the documentation of the message module for more information.
LocationEventContent can be converted to a RoomMessageEventContent with a
MessageType::Location. You can convert it back with
LocationEventContent::from_location_room_message().
Fields
message: MessageContentThe text representation of the message.
location: LocationContentThe location info of the message.
asset: AssetContentThe asset this message refers to.
ts: Option<MilliSecondsSinceUnixEpoch>The timestamp this message refers to.
relates_to: Option<Relation>Information about related messages.
Implementations
sourceimpl LocationEventContent
impl LocationEventContent
sourcepub fn plain(message: impl Into<String>, location: LocationContent) -> Self
pub fn plain(message: impl Into<String>, location: LocationContent) -> Self
Creates a new LocationEventContent with the given plain text representation and location.
sourcepub fn with_message(message: MessageContent, location: LocationContent) -> Self
pub fn with_message(message: MessageContent, location: LocationContent) -> Self
Creates a new LocationEventContent with the given text representation and location.
sourcepub fn from_location_room_message(
content: LocationMessageEventContent,
relates_to: Option<Relation>
) -> Self
pub fn from_location_room_message(
content: LocationMessageEventContent,
relates_to: Option<Relation>
) -> Self
Create a new LocationEventContent from the given LocationMessageEventContent and
optional relation.
Trait Implementations
sourceimpl Clone for LocationEventContent
impl Clone for LocationEventContent
sourcefn clone(&self) -> LocationEventContent
fn clone(&self) -> LocationEventContent
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresourceimpl Debug for LocationEventContent
impl Debug for LocationEventContent
sourceimpl<'de> Deserialize<'de> for LocationEventContent
impl<'de> Deserialize<'de> for LocationEventContent
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl EventContent for LocationEventContent
impl EventContent for LocationEventContent
type EventType = MessageLikeEventType
type EventType = MessageLikeEventType
sourcefn event_type(&self) -> Self::EventType
fn event_type(&self) -> Self::EventType
m.room.message.sourceimpl From<LocationEventContent> for AnyMessageLikeEventContent
impl From<LocationEventContent> for AnyMessageLikeEventContent
sourcefn from(c: LocationEventContent) -> Self
fn from(c: LocationEventContent) -> Self
sourceimpl From<LocationEventContent> for RoomMessageEventContent
impl From<LocationEventContent> for RoomMessageEventContent
sourcefn from(content: LocationEventContent) -> Self
fn from(content: LocationEventContent) -> Self
sourceimpl RedactContent for LocationEventContent
impl RedactContent for LocationEventContent
type Redacted = RedactedLocationEventContent
type Redacted = RedactedLocationEventContent
sourcefn redact(self, version: &RoomVersionId) -> RedactedLocationEventContent
fn redact(self, version: &RoomVersionId) -> RedactedLocationEventContent
self into a redacted form (removing most or all fields) according to the spec. Read more