Struct LocationMessageEventContent
#[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>,
}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: StringA description of the location e.g. “Big Ben, London, UK”, or some kind of content description for accessibility, e.g. “location attachment”.
geo_uri: StringA 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§
§impl LocationMessageEventContent
impl LocationMessageEventContent
pub 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.
pub 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.
pub 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.
pub fn plain_text_representation(&self) -> &str
pub fn plain_text_representation(&self) -> &str
Get the plain text representation of this LocationMessageEventContent.
pub 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§
§impl Clone for LocationMessageEventContent
impl Clone for LocationMessageEventContent
§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§impl Debug for LocationMessageEventContent
impl Debug for LocationMessageEventContent
§impl<'de> Deserialize<'de> for LocationMessageEventContent
impl<'de> Deserialize<'de> for LocationMessageEventContent
§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>,
§impl From<LocationMessageEventContentSerDeHelper> for LocationMessageEventContent
impl From<LocationMessageEventContentSerDeHelper> for LocationMessageEventContent
§fn from(
value: LocationMessageEventContentSerDeHelper,
) -> LocationMessageEventContent
fn from( value: LocationMessageEventContentSerDeHelper, ) -> LocationMessageEventContent
Source§impl MediaEventContent for LocationMessageEventContent
impl MediaEventContent for LocationMessageEventContent
Source§fn thumbnail_source(&self) -> Option<MediaSource>
fn thumbnail_source(&self) -> Option<MediaSource>
Self. Read more§impl Serialize for LocationMessageEventContent
impl Serialize for LocationMessageEventContent
§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 UnsafeUnpin 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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> DeserialiseFromJs for Twhere
T: DeserializeOwned,
impl<T> DeserialiseFromJs for Twhere
T: DeserializeOwned,
Source§fn deserialise_from_js(js: JsValue) -> Result<T, Error>
fn deserialise_from_js(js: JsValue) -> Result<T, Error>
serde_wasm_bindgen.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SerialiseToJs for Twhere
T: Serialize,
impl<T> SerialiseToJs for Twhere
T: Serialize,
Source§fn serialise_to_js(&self) -> Result<JsValue, Error>
fn serialise_to_js(&self) -> Result<JsValue, Error>
JsValue, most likely using serde_wasm_bindgen.