#[non_exhaustive]pub struct LocationMessageEventContent {
pub body: String,
pub geo_uri: String,
pub info: Option<Box<LocationInfo>>,
pub message: Option<TextContentBlock>,
pub location: Option<LocationContent>,
pub asset: Option<AssetContent>,
pub ts: Option<MilliSecondsSinceUnixEpoch>,
}
events
only.Expand description
The payload for a location message.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.body: String
A description of the location e.g. “Big Ben, London, UK”, or some kind of content description for accessibility, e.g. “location attachment”.
geo_uri: String
A geo URI representing the location.
info: Option<Box<LocationInfo>>
Info about the location being represented.
message: Option<TextContentBlock>
unstable-msc3488
only.Extensible-event text representation of the message.
If present, this should be preferred over the body
field.
location: Option<LocationContent>
unstable-msc3488
only.Extensible-event location info of the message.
If present, this should be preferred over the geo_uri
field.
asset: Option<AssetContent>
unstable-msc3488
only.Extensible-event asset this message refers to.
ts: Option<MilliSecondsSinceUnixEpoch>
unstable-msc3488
only.Extensible-event timestamp this message refers to.
Implementations§
Source§impl LocationMessageEventContent
impl LocationMessageEventContent
Sourcepub fn new(body: String, geo_uri: String) -> LocationMessageEventContent
pub fn new(body: String, geo_uri: String) -> LocationMessageEventContent
Creates a new LocationMessageEventContent
with the given body and geo URI.
Sourcepub fn with_asset_type(self, asset: AssetType) -> LocationMessageEventContent
Available on crate feature unstable-msc3488
only.
pub fn with_asset_type(self, asset: AssetType) -> LocationMessageEventContent
unstable-msc3488
only.Set the asset type of this LocationMessageEventContent
.
Sourcepub fn with_ts(
self,
ts: MilliSecondsSinceUnixEpoch,
) -> LocationMessageEventContent
Available on crate feature unstable-msc3488
only.
pub fn with_ts( self, ts: MilliSecondsSinceUnixEpoch, ) -> LocationMessageEventContent
unstable-msc3488
only.Set the timestamp of this LocationMessageEventContent
.
Sourcepub fn plain_text_representation(&self) -> &str
pub fn plain_text_representation(&self) -> &str
Get the plain text representation of this LocationMessageEventContent
.
Sourcepub fn asset_type(&self) -> AssetType
Available on crate feature unstable-msc3488
only.
pub fn asset_type(&self) -> AssetType
unstable-msc3488
only.Get the asset type of this LocationMessageEventContent
.
Trait Implementations§
Source§impl Clone for LocationMessageEventContent
impl Clone for LocationMessageEventContent
Source§fn clone(&self) -> LocationMessageEventContent
fn clone(&self) -> LocationMessageEventContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more