Struct Ast
pub struct Ast { pub value: NodeValue, pub sourcepos: Sourcepos, /* private fields */ }
A single node in the CommonMark AST.
The struct contains metadata about the node's position in the original document, and the core
enum, NodeValue.
Fields
value: NodeValueThe node value itself.
sourcepos: SourceposThe positions in the source document this node comes from.
Implementations
impl Ast
fn new(value: NodeValue, start: LineColumn) -> SelfCreate a new AST node with the given value and starting sourcepos. The end column is set to zero; it is expected this will be set manually or later in the parse. Use
Ast::new_with_sourceposif you have full sourcepos.fn new_with_sourcepos(value: NodeValue, sourcepos: Sourcepos) -> SelfCreate a new AST node with the given value and sourcepos.
Trait Implementations
impl Clone for Ast
fn clone(&self) -> Self
impl Debug for Ast
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Ast
impl PartialEq for Ast
fn eq(&self, other: &Self) -> bool
impl StructuralPartialEq for Ast
Auto Trait Implementations
impl Freeze for Ast
impl RefUnwindSafe for Ast
impl Send for Ast
impl Sync for Ast
impl Unpin for Ast
impl UnsafeUnpin for Ast
impl UnwindSafe for Ast
Blanket Implementations
impl<T> Any for Ast
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Ast
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Ast
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Ast
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Ast
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Ast
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Ast
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Ast
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Ast
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>