Enum url_crawler::CrawlerSource[][src]

pub enum CrawlerSource {
    Single(String),
    Multiple(Vec<String>),
}

Defines whether to crawl from a single source, or from multiple sources.

Both the From<String> and From<Vec<String>> traits are implemented for this.

use url_crawler::CrawlerSource;
 
let single: String = "url".into();
let multiple: Vec<String> = vec![
    "url1".into(),
    "url2".into()
];
 
// Get a source from a `String`.
let source: CrawlerSource = single.into();
assert_eq!(CrawlerSource::Single("url".into()), source);
 
// Get a source from a `Vec<String>`.
let source: CrawlerSource = multiple.into();
assert_eq!(
    CrawlerSource::Multiple(vec!["url1".into(), "url2".into()]),
    source
);

Variants

Trait Implementations

impl Debug for CrawlerSource
[src]

Formats the value using the given formatter. Read more

impl Clone for CrawlerSource
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for CrawlerSource
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl From<String> for CrawlerSource
[src]

Performs the conversion.

impl From<Vec<String>> for CrawlerSource
[src]

Performs the conversion.

Auto Trait Implementations