pub struct Location {
pub latitude: f32,
pub longitude: f32,
pub heading: Option<i64>,
pub horizontal_accuracy: Option<f32>,
pub live_period: Option<i64>,
pub proximity_alert_radius: Option<i64>,
}
Expand description
Represents a point on a map.
Fields§
§latitude: f32
Latitude as defined by sender.
longitude: f32
Longitude as defined by sender.
heading: Option<i64>
The direction in which user is moving; in degrees; 1-360.
For active live locations only.
horizontal_accuracy: Option<f32>
The radius of uncertainty for the location, measured in meters; 0-1500.
live_period: Option<i64>
Time relative to the message sending date, during which the location can be updated, in seconds.
For active live locations only.
proximity_alert_radius: Option<i64>
Maximum distance for proximity alerts about approaching another chat member; in meters.
For sent live locations only.
Implementations§
source§impl Location
impl Location
sourcepub fn with_heading(self, value: i64) -> Location
pub fn with_heading(self, value: i64) -> Location
sourcepub fn with_horizontal_accuracy(self, value: f32) -> Location
pub fn with_horizontal_accuracy(self, value: f32) -> Location
Sets a new horizontal accuracy.
§Arguments
value
- A radius of uncertainty for the location; in meters; 0-1500.
sourcepub fn with_live_period(self, value: i64) -> Location
pub fn with_live_period(self, value: i64) -> Location
Sets a new live period.
§Arguments
value
- Period in seconds for which the location can be updated; 60-86400.
sourcepub fn with_proximity_alert_radius(self, value: i64) -> Location
pub fn with_proximity_alert_radius(self, value: i64) -> Location
Sets a new proximity alert radius.
§Arguments
value
- A maximum distance for proximity alerts about approaching another chat member; in meters; 1-100000.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Location
impl<'de> Deserialize<'de> for Location
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Location, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Location, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Location> for ExternalReplyData
impl From<Location> for ExternalReplyData
source§fn from(original: Location) -> ExternalReplyData
fn from(original: Location) -> ExternalReplyData
Converts to this type from the input type.
source§impl From<Location> for InputMessageContent
impl From<Location> for InputMessageContent
source§fn from(value: Location) -> InputMessageContent
fn from(value: Location) -> InputMessageContent
Converts to this type from the input type.
source§impl From<Location> for InputMessageContentLocation
impl From<Location> for InputMessageContentLocation
source§fn from(value: Location) -> InputMessageContentLocation
fn from(value: Location) -> InputMessageContentLocation
Converts to this type from the input type.
source§impl PartialEq for Location
impl PartialEq for Location
source§impl PartialOrd for Location
impl PartialOrd for Location
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Location
impl Serialize for Location
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,
Serialize this value into the given Serde serializer. Read more
impl Copy for Location
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl Freeze for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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