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§
§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 moresource§impl Debug for LocationMessageEventContent
impl Debug for LocationMessageEventContent
source§impl<'de> Deserialize<'de> for LocationMessageEventContent
impl<'de> Deserialize<'de> for LocationMessageEventContent
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LocationMessageEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LocationMessageEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl From<LocationMessageEventContentSerDeHelper> for LocationMessageEventContent
impl From<LocationMessageEventContentSerDeHelper> for LocationMessageEventContent
source§fn from(
value: LocationMessageEventContentSerDeHelper,
) -> LocationMessageEventContent
fn from( value: LocationMessageEventContentSerDeHelper, ) -> LocationMessageEventContent
source§impl Serialize for LocationMessageEventContent
impl Serialize for LocationMessageEventContent
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for LocationMessageEventContent
impl RefUnwindSafe for LocationMessageEventContent
impl Send for LocationMessageEventContent
impl Sync for LocationMessageEventContent
impl Unpin for LocationMessageEventContent
impl UnwindSafe for LocationMessageEventContent
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more