pub struct Link {
pub id: Option<String>,
pub values: Vec<Link>,
pub children: Vec<Link>,
pub is_indented_id: bool,
pub nested: Option<Vec<Link>>,
pub id_span: Option<Range<usize>>,
}Fields§
§id: Option<String>§values: Vec<Link>§children: Vec<Link>§is_indented_id: bool§nested: Option<Vec<Link>>Body of a parenthesized group, kept unflattened until the whole document
is transformed. None for every link that is not a parenthesized group.
id_span: Option<Range<usize>>Where the ID was written: the byte range of the reference, quotes,
escapes and literal syntax included, in the document that was parsed.
The parser reads a copy of the document with its comments blanked, which
keeps every byte where it was, so the range also locates the ID in the
document as the caller wrote it. None when the link has no ID.
Implementations§
Source§impl Link
impl Link
pub fn new_singlet(id: String) -> Self
pub fn new_indented_id(id: String) -> Self
pub fn new_value(values: Vec<Link>) -> Self
pub fn new_link(id: Option<String>, values: Vec<Link>) -> Self
Sourcepub fn new_nested(body: Vec<Link>) -> Self
pub fn new_nested(body: Vec<Link>) -> Self
Creates a link that stands for a parenthesized group, keeping the links parsed inside the parentheses as they were written.
pub fn with_children(self, children: Vec<Link>) -> Self
Sourcepub fn with_id_span(self, span: Range<usize>) -> Self
pub fn with_id_span(self, span: Range<usize>) -> Self
The same link, recording where its ID was written.
Trait Implementations§
impl StructuralPartialEq for Link
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnsafeUnpin 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