reactive_graph_net_http_model/component/
url.rs

1use crate::NAMESPACE_HTTP;
2use reactive_graph_graph::component_model;
3use reactive_graph_graph::component_ty;
4use reactive_graph_graph::properties;
5
6properties!(UrlProperties, (URL, "url", ""));
7
8component_ty!(COMPONENT_URL, NAMESPACE_HTTP, COMPONENT_NAME_URL, "url");
9
10component_model!(
11    Url,
12    data url string,
13);
14
15pub trait ParsedUrl: Url {
16    fn parse_url(&self) -> Option<url::Url> {
17        self.get_url().and_then(|url| url::Url::parse(&url).ok())
18    }
19}