pub trait LinkFormatter:
Debug
+ Send
+ Sync {
// Required methods
fn validate_link(&self, url: &str) -> Option<()>;
fn normalize_link(&self, url: &str) -> String;
fn normalize_link_text(&self, url: &str) -> String;
}
Required Methods§
Sourcefn validate_link(&self, url: &str) -> Option<()>
fn validate_link(&self, url: &str) -> Option<()>
Validate the link url, return Some(())
if it is allowed
and None
if it is a security risk.
Sourcefn normalize_link(&self, url: &str) -> String
fn normalize_link(&self, url: &str) -> String
Encode link url to a machine-readable format, which includes url-encoding, punycode, etc.
Sourcefn normalize_link_text(&self, url: &str) -> String
fn normalize_link_text(&self, url: &str) -> String
Decode link url to a human-readable format.