Skip to main content

Autolinker

Struct Autolinker 

Source
pub struct Autolinker<'a> {
Show 15 fields pub no_follow: bool, pub url_class: &'a str, pub url_target: &'a str, pub symbol_tag: &'a str, pub text_with_symbol_tag: &'a str, pub list_class: &'a str, pub username_class: &'a str, pub hashtag_class: &'a str, pub cashtag_class: &'a str, pub username_url_base: &'a str, pub list_url_base: &'a str, pub hashtag_url_base: &'a str, pub cashtag_url_base: &'a str, pub invisible_tag_attrs: &'a str, pub username_include_symbol: bool, /* private fields */
}
Expand description

Adds HTML links to hashtag, username and list references in Tweet text.

Fields§

§no_follow: bool§url_class: &'a str§url_target: &'a str§symbol_tag: &'a str§text_with_symbol_tag: &'a str§list_class: &'a str§username_class: &'a str§hashtag_class: &'a str§cashtag_class: &'a str§username_url_base: &'a str§list_url_base: &'a str§hashtag_url_base: &'a str§cashtag_url_base: &'a str§invisible_tag_attrs: &'a str§username_include_symbol: bool

Implementations§

Source§

impl<'a> Autolinker<'a>

Source

pub fn new(no_follow: bool) -> Autolinker<'a>

An Autolinker with default properties.

Auto-link all entities.

Auto-link the @username and @username/list references in the provided text. Links to @username references will have the username_class CSS classes added. Links to @username/list references will have the list_class CSS class added.

Auto-link #hashtag references in the provided Tweet text. The #hashtag links will have the hashtag_class CSS class added.

Auto-link URLs in the Tweet text provided. This only auto-links URLs with protocol.

Auto-link $cashtag references in the provided Tweet text. The $cashtag links will have the cashtag_class CSS class added.

Auto Trait Implementations§

§

impl<'a> Freeze for Autolinker<'a>

§

impl<'a> RefUnwindSafe for Autolinker<'a>

§

impl<'a> Send for Autolinker<'a>

§

impl<'a> Sync for Autolinker<'a>

§

impl<'a> Unpin for Autolinker<'a>

§

impl<'a> UnsafeUnpin for Autolinker<'a>

§

impl<'a> UnwindSafe for Autolinker<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.