pub trait SourceGetters {
// Required methods
fn url(&self) -> String;
fn title(&self) -> Option<String>;
}Expand description
The Getter functions for Source
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl SourceGetters for Source
impl SourceGetters for Source
Source§fn url(&self) -> String
fn url(&self) -> String
Get the url that exists under Source.
§Examples
use feed::{SourceBuilder, SourceGetters};
let url = "http://www.tomalak.org/links2.xml";
let source = SourceBuilder::new()
.url(url)
.finalize()
.unwrap();
assert_eq!(url.to_owned(), source.url());Source§fn title(&self) -> Option<String>
fn title(&self) -> Option<String>
Get the source that exists under Source.
§Examples
use feed::{SourceBuilder, SourceGetters};
let title = "Tomalak's Realm";
let url = "http://www.tomalak.org/links2.xml";
let source_obj = SourceBuilder::new()
.title(Some(title.to_owned()))
.url(url)
.finalize()
.unwrap();
assert_eq!(title.to_owned(), source_obj.title().unwrap());