pub enum Url {
Absolute(AbsoluteUrl),
Relative(Relative),
}
Variants§
Absolute(AbsoluteUrl)
Relative(Relative)
Implementations§
Source§impl Url
impl Url
Sourcepub fn absolute_unchecked(text: String) -> Self
pub fn absolute_unchecked(text: String) -> Self
Examples found in repository?
examples/semantic.rs (line 15)
12fn main() {
13 let title = Some(Text::create("Title"));
14 let styles = vec![];
15 let url = Url::absolute_unchecked("http://google.com".into());
16 let script = Script::External(url);
17 let scripts = vec![script];
18 let head = Head {
19 title,
20 styles,
21 scripts,
22 };
23 let content = vec![Text::create("Hello").into()];
24 let body = Body {
25 content,
26 scripts: vec![],
27 id: Some(Id::create("my-id").unwrap()),
28 class: vec![
29 Class::create("test").unwrap(),
30 Class::create("body").unwrap(),
31 ],
32 };
33 let html = Html {
34 head,
35 body,
36 lang: Value::EN,
37 };
38 let doc = Document { html };
39 let string: String = doc.into();
40
41 println!("{}", string);
42}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Url
impl RefUnwindSafe for Url
impl Send for Url
impl Sync for Url
impl Unpin for Url
impl UnwindSafe for Url
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more