Struct tldextract::TldOption
[−]
[src]
pub struct TldOption { pub cache_path: Option<String>, pub private_domains: bool, pub update_local: bool, pub naive_mode: bool, }
The option for TldExtractor
.
Examples
use tldextract::{TldExtractor, TldOption, TldResult}; let option = TldOption { cache_path: Some(".tld_cache".to_string()), private_domains: false, update_local: false, naive_mode: false, }; let ext = TldExtractor::new(option); assert_eq!(ext.extract("https://m.facebook.com").unwrap(), TldResult::new("m", "facebook", "com"));
Fields
cache_path: Option<String>
The path to file for storing tld cache
private_domains: bool
Whether to include private domains
update_local: bool
Should tldextract update local cache file if the cache is fetched from remote or from snapshot
naive_mode: bool
When cannot finding valid suffix in PSL, should we naively treat the last piece of URL as the suffix and the last but one piece as the domain?