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 the 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 the 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 the 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 duplicate 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§impl PartialOrd for LinkPreviewOptions
impl PartialOrd for LinkPreviewOptions
Source§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 UnsafeUnpin 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