pub struct Link {
pub text: String,
pub url: String,
pub footer: bool,
pub inlined: bool,
}
Expand description
A markdown link.
Fields§
§text: String
The text of the link.
url: String
The url of the link.
Whether the Link
’s url should be rendered as a footer.
inlined: bool
Whether the link should be inlined (no new line).
Implementations§
Source§impl Link
impl Link
Sourcepub fn builder() -> LinkBuilder
pub fn builder() -> LinkBuilder
Examples found in repository?
examples/basic.rs (line 18)
5fn main() {
6 let mut md = Markdown::new();
7 for _ in 1..=10 {
8 md.header1("hello").list(
9 ListBuilder::new()
10 .add("first")
11 .add("second")
12 .add(CheckmarkItem {
13 text: "Buy groceries",
14 checked: true,
15 })
16 .ordered(),
17 );
18 let link = Link::builder()
19 .footer(true)
20 .text("Hello")
21 .inlined()
22 .url("https://hello.world")
23 .build();
24 md.link(link);
25 }
26 println!("{}", md);
27}
Trait Implementations§
Returns the
MarkdownElement
that can be used to render the footer.Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnwindSafe for Link
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