#[non_exhaustive]pub struct Link<'a> {
pub text: Vec<InlineNode<'a>>,
pub target: Source<'a>,
pub attributes: ElementAttributes<'a>,
pub location: Location,
}Expand description
A Link represents an inline link in a document.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: Vec<InlineNode<'a>>§target: Source<'a>§attributes: ElementAttributes<'a>§location: LocationImplementations§
Source§impl<'a> Link<'a>
impl<'a> Link<'a>
Sourcepub fn new(target: Source<'a>, location: Location) -> Self
pub fn new(target: Source<'a>, location: Location) -> Self
Creates a new Link with the given target.
Sourcepub fn with_text(self, text: Vec<InlineNode<'a>>) -> Self
pub fn with_text(self, text: Vec<InlineNode<'a>>) -> Self
Sets the link text as inline nodes.
Sourcepub fn with_attributes(self, attributes: ElementAttributes<'a>) -> Self
pub fn with_attributes(self, attributes: ElementAttributes<'a>) -> Self
Sets the link attributes.
Trait Implementations§
impl<'a> StructuralPartialEq for Link<'a>
Auto Trait Implementations§
impl<'a> Freeze for Link<'a>
impl<'a> RefUnwindSafe for Link<'a>
impl<'a> Send for Link<'a>
impl<'a> Sync for Link<'a>
impl<'a> Unpin for Link<'a>
impl<'a> UnsafeUnpin for Link<'a>
impl<'a> UnwindSafe for Link<'a>
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