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: boolImplementations§
Source§impl<'a> Autolinker<'a>
impl<'a> Autolinker<'a>
Sourcepub fn new(no_follow: bool) -> Autolinker<'a>
pub fn new(no_follow: bool) -> Autolinker<'a>
An Autolinker with default properties.
pub fn autolink_entities( &self, text: &str, entities: &Vec<Entity<'_>>, ) -> String
Sourcepub fn autolink_usernames_and_lists(&self, text: &str) -> String
pub fn autolink_usernames_and_lists(&self, text: &str) -> String
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.
Sourcepub fn autolink_urls(&self, text: &str) -> String
pub fn autolink_urls(&self, text: &str) -> String
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> 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