Struct kodept_ast::Literal
source · pub struct Literal(/* private fields */);Implementations§
source§impl Literal
impl Literal
pub fn as_number(&self) -> Option<&NumberLiteral>
pub fn as_number_mut(&mut self) -> Option<&mut NumberLiteral>
pub fn as_char(&self) -> Option<&CharLiteral>
pub fn as_char_mut(&mut self) -> Option<&mut CharLiteral>
pub fn as_string(&self) -> Option<&StringLiteral>
pub fn as_string_mut(&mut self) -> Option<&mut StringLiteral>
pub fn as_tuple(&self) -> Option<&TupleLiteral>
pub fn as_tuple_mut(&mut self) -> Option<&mut TupleLiteral>
Trait Implementations§
source§impl From<GenericASTNode> for Literal
impl From<GenericASTNode> for Literal
source§fn from(original: GenericASTNode) -> Literal
fn from(original: GenericASTNode) -> Literal
Converts to this type from the input type.
source§impl From<Literal> for GenericASTNode
impl From<Literal> for GenericASTNode
source§impl NodeUnion for Literal
impl NodeUnion for Literal
fn contains(node: &GenericASTNode) -> bool
fn wrap(node: &GenericASTNode) -> &Self
fn wrap_mut(node: &mut GenericASTNode) -> &mut Self
source§impl PartialEq for Literal
impl PartialEq for Literal
source§impl<'a> TryFrom<&'a GenericASTNode> for &'a Literal
impl<'a> TryFrom<&'a GenericASTNode> for &'a Literal
§type Error = <&'a GenericASTNode as TryFrom<&'a GenericASTNode>>::Error
type Error = <&'a GenericASTNode as TryFrom<&'a GenericASTNode>>::Error
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a mut GenericASTNode> for &'a mut Literal
impl<'a> TryFrom<&'a mut GenericASTNode> for &'a mut Literal
§type Error = <&'a mut GenericASTNode as TryFrom<&'a mut GenericASTNode>>::Error
type Error = <&'a mut GenericASTNode as TryFrom<&'a mut GenericASTNode>>::Error
The type returned in the event of a conversion error.
impl StructuralPartialEq for Literal
Auto Trait Implementations§
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnwindSafe for Literal
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