Struct tldextract::TldResult [−][src]
pub struct TldResult { pub domain: Option<String>, pub subdomain: Option<String>, pub suffix: Option<String>, }
The Tld Result Type
E.g. "https://www.google.com" will be represent into
use tldextract::TldResult; TldResult { domain: Some("google".to_string()), subdomain: Some("www".to_string()), suffix: Some("com".to_string())};
Fields
domain: Option<String>
The "google" part of "www.google.com"
subdomain: Option<String>
The "www" part of "www.google.com"
suffix: Option<String>
The "com" part of "www.google.com"
Methods
impl TldResult
[src]
impl TldResult
pub fn new<'a, O, P, Q>(subdomain: O, domain: P, suffix: Q) -> TldResult where
O: Into<Option<&'a str>>,
P: Into<Option<&'a str>>,
Q: Into<Option<&'a str>>,
[src]
pub fn new<'a, O, P, Q>(subdomain: O, domain: P, suffix: Q) -> TldResult where
O: Into<Option<&'a str>>,
P: Into<Option<&'a str>>,
Q: Into<Option<&'a str>>,
Create a new TldResult
Examples
use tldextract::TldResult; assert_eq!(TldResult::new("www", "google", "com"), TldResult { domain: Some("google".to_string()), subdomain: Some("www".to_string()), suffix: Some("com".to_string()) });
Trait Implementations
impl Debug for TldResult
[src]
impl Debug for TldResult
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for TldResult
[src]
impl Default for TldResult
impl PartialEq for TldResult
[src]
impl PartialEq for TldResult
fn eq(&self, other: &TldResult) -> bool
[src]
fn eq(&self, other: &TldResult) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &TldResult) -> bool
[src]
fn ne(&self, other: &TldResult) -> bool
This method tests for !=
.
impl Eq for TldResult
[src]
impl Eq for TldResult