pub struct LoginUrl { /* private fields */ }
Expand description
Represents a parameter of the inline keyboard button used to automatically authorize a user.
Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram.
Implementations§
source§impl LoginUrl
impl LoginUrl
sourcepub fn new<T>(url: T) -> Self
pub fn new<T>(url: T) -> Self
Creates a new LoginUrl
.
§Arguments
value
- An HTTP URL to be opened with user authorization data added to the query string when the button is pressed.
If the user refuses to provide authorization data, the original URL without information about the user will be opened.
The data added is the same as described in Receiving authorization data.
§Notes
You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
sourcepub fn with_bot_username<T>(self, value: T) -> Self
pub fn with_bot_username<T>(self, value: T) -> Self
Sets a new username of a bot.
§Arguments
value
- The username of the bot, which will be used for user authorization.
See Setting up a bot for more details. If not specified, the current bot username will be assumed. The url domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
sourcepub fn with_forward_text<T>(self, value: T) -> Self
pub fn with_forward_text<T>(self, value: T) -> Self
sourcepub fn with_request_write_access(self, value: bool) -> Self
pub fn with_request_write_access(self, value: bool) -> Self
Sets a new value for a request_write_access
flag.
§Arguments
value
- Indicates whether to request the permission for your bot to send messages to the user.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LoginUrl
impl<'de> Deserialize<'de> for LoginUrl
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for LoginUrl
impl PartialEq for LoginUrl
source§impl PartialOrd for LoginUrl
impl PartialOrd for LoginUrl
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl StructuralPartialEq for LoginUrl
Auto Trait Implementations§
impl Freeze for LoginUrl
impl RefUnwindSafe for LoginUrl
impl Send for LoginUrl
impl Sync for LoginUrl
impl Unpin for LoginUrl
impl UnwindSafe for LoginUrl
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> 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