Struct tgbot::types::LinkPreviewOptions
source · pub struct LinkPreviewOptions {
pub is_disabled: Option<bool>,
pub prefer_large_media: Option<bool>,
pub prefer_small_media: Option<bool>,
pub show_above_text: Option<bool>,
pub url: Option<String>,
}
Expand description
Represents the options used for link preview generation.
Fields§
§is_disabled: Option<bool>
Whether the link preview is disabled.
prefer_large_media: Option<bool>
Whether the media in the link preview is suppposed to be enlarged.
prefer_small_media: Option<bool>
Whether the media in the link preview is suppposed to be shrunk.
show_above_text: Option<bool>
Whether the link preview must be shown above the message text.
url: Option<String>
URL to use for the link preview.
Implementations§
source§impl LinkPreviewOptions
impl LinkPreviewOptions
sourcepub fn with_is_disabled(self, value: bool) -> Self
pub fn with_is_disabled(self, value: bool) -> Self
sourcepub fn with_prefer_large_media(self, value: bool) -> Self
pub fn with_prefer_large_media(self, value: bool) -> Self
Sets a new value for a prefer_large_media
flag.
§Arguments
value
- Whether the media in the link preview is suppposed to be enlarged; ignored if the URL isn’t explicitly specified or media size change isn’t supported for the preview.
sourcepub fn with_prefer_small_media(self, value: bool) -> Self
pub fn with_prefer_small_media(self, value: bool) -> Self
Sets a new value for a prefer_small_media
flag.
§Arguments
value
- Whether the media in the link preview is suppposed to be shrunk; ignored if the URL isn’t explicitly specified or media size change isn’t supported for the preview.
sourcepub fn with_show_above_text(self, value: bool) -> Self
pub fn with_show_above_text(self, value: bool) -> Self
Sets a new value for a show_above_text
flag.
§Arguments
value
- Whether the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text.
Trait Implementations§
source§impl Clone for LinkPreviewOptions
impl Clone for LinkPreviewOptions
source§fn clone(&self) -> LinkPreviewOptions
fn clone(&self) -> LinkPreviewOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LinkPreviewOptions
impl Debug for LinkPreviewOptions
source§impl Default for LinkPreviewOptions
impl Default for LinkPreviewOptions
source§fn default() -> LinkPreviewOptions
fn default() -> LinkPreviewOptions
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for LinkPreviewOptions
impl<'de> Deserialize<'de> for LinkPreviewOptions
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for LinkPreviewOptions
impl PartialEq for LinkPreviewOptions
source§fn eq(&self, other: &LinkPreviewOptions) -> bool
fn eq(&self, other: &LinkPreviewOptions) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for LinkPreviewOptions
impl PartialOrd for LinkPreviewOptions
source§fn partial_cmp(&self, other: &LinkPreviewOptions) -> Option<Ordering>
fn partial_cmp(&self, other: &LinkPreviewOptions) -> Option<Ordering>
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 LinkPreviewOptions
impl Serialize for LinkPreviewOptions
impl StructuralPartialEq for LinkPreviewOptions
Auto Trait Implementations§
impl Freeze for LinkPreviewOptions
impl RefUnwindSafe for LinkPreviewOptions
impl Send for LinkPreviewOptions
impl Sync for LinkPreviewOptions
impl Unpin for LinkPreviewOptions
impl UnwindSafe for LinkPreviewOptions
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