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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl EventContent for LocationEventContent
impl EventContent for LocationEventContent
type EventType = MessageLikeEventType
type EventType = MessageLikeEventType
events only.The Rust enum for the event kind’s known types.
sourcefn event_type(&self) -> Self::EventType
fn event_type(&self) -> Self::EventType
events only.Get the event’s type, like m.room.message.
sourceimpl From<LocationEventContent> for AnyMessageLikeEventContent
impl From<LocationEventContent> for AnyMessageLikeEventContent
sourcefn from(c: LocationEventContent) -> Self
fn from(c: LocationEventContent) -> Self
Converts to this type from the input type.
sourceimpl From<LocationEventContent> for RoomMessageEventContent
impl From<LocationEventContent> for RoomMessageEventContent
sourcefn from(content: LocationEventContent) -> Self
fn from(content: LocationEventContent) -> Self
Converts to this type from the input type.
sourceimpl RedactContent for LocationEventContent
impl RedactContent for LocationEventContent
type Redacted = RedactedLocationEventContent
type Redacted = RedactedLocationEventContent
events only.The redacted form of the event’s content.
sourcefn redact(self, version: &RoomVersionId) -> RedactedLocationEventContent
fn redact(self, version: &RoomVersionId) -> RedactedLocationEventContent
events only.Transform self into a redacted form (removing most or all fields) according to the spec. Read more
sourceimpl Serialize for LocationEventContent
impl Serialize for LocationEventContent
Auto Trait Implementations
impl RefUnwindSafe for LocationEventContent
impl Send for LocationEventContent
impl Sync for LocationEventContent
impl Unpin for LocationEventContent
impl UnwindSafe for LocationEventContent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
