pub struct LibertyAst(pub Vec<GroupItem>);Expand description
Liberty file AST representation
Each liberty file can have one or more librarys defined in it, which are represented as a
GroupItem::Group variant.
Tuple Fields§
§0: Vec<GroupItem>Implementations§
Source§impl LibertyAst
impl LibertyAst
Sourcepub fn from_string(input: &str) -> ParseResult<'_, Self>
pub fn from_string(input: &str) -> ParseResult<'_, Self>
Parse a Liberty file’s string representation into the AST
Sourcepub fn into_liberty(self) -> Liberty
pub fn into_liberty(self) -> Liberty
Convert an AST into a Liberty struct
Sourcepub fn from_liberty(lib: Liberty) -> Self
pub fn from_liberty(lib: Liberty) -> Self
Convert a Liberty struct into an AST
Trait Implementations§
Source§impl Clone for LibertyAst
impl Clone for LibertyAst
Source§fn clone(&self) -> LibertyAst
fn clone(&self) -> LibertyAst
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LibertyAst
impl Debug for LibertyAst
Source§impl Display for LibertyAst
impl Display for LibertyAst
Source§impl From<Liberty> for LibertyAst
impl From<Liberty> for LibertyAst
Source§impl From<LibertyAst> for Liberty
impl From<LibertyAst> for Liberty
Source§fn from(ast: LibertyAst) -> Self
fn from(ast: LibertyAst) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LibertyAst
impl RefUnwindSafe for LibertyAst
impl Send for LibertyAst
impl Sync for LibertyAst
impl Unpin for LibertyAst
impl UnsafeUnpin for LibertyAst
impl UnwindSafe for LibertyAst
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more