Struct tbot::types::location::Live[][src]

#[non_exhaustive]
#[must_use = "a `location::Live` must be used via `SendLocation`, \`input_message_content::Location` or `inline_query::Location`"]
pub struct Live { pub live_period: u32, pub heading: Option<u16>, pub proximity_alert_radius: Option<u32>, }

Information about a live location.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct {{ .. }} syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
live_period: u32

Time relative to the message sending date, during which the location can be updated, in seconds. For active live locations only.

heading: Option<u16>

The direction in which user is moving, in degrees and in range 1..=360. For active live locations only.

proximity_alert_radius: Option<u32>

Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.

Implementations

impl Live[src]

pub fn new(live_period: u32) -> Self[src]

Creates a new live location. The live_period must be in range 60..=86_400; it reflects the live_period parameter.

Panics

Panics if the duration is not in range 60..=86_400.

pub fn heading(self, heading: u16) -> Self[src]

Configures the direction in which the user is headed. The value must be in range 1..=360. Reflects the heading parameter.

Panics

Panics if heading is not in range 1..=360.

pub fn proximity_alert_radius(self, radius: u32) -> Self[src]

Configures the maximum distance for proximity alerts about a user approaching another, in meters. The value must be in range 1..=100_000. Reflects the proximity_alert_radius paramter.

Panics

Panics if the value is not in range 1..=100_000.

Trait Implementations

impl Clone for Live[src]

impl Debug for Live[src]

impl<'de> Deserialize<'de> for Live[src]

impl Hash for Live[src]

impl PartialEq<Live> for Live[src]

impl Serialize for Live[src]

impl Copy for Live[src]

impl Eq for Live[src]

impl StructuralEq for Live[src]

impl StructuralPartialEq for Live[src]

Auto Trait Implementations

impl RefUnwindSafe for Live

impl Send for Live

impl Sync for Live

impl Unpin for Live

impl UnwindSafe for Live

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]