[][src]Struct rune::ast::LitObject

pub struct LitObject {
    pub ident: LitObjectIdent,
    pub open: OpenBrace,
    pub assignments: Vec<LitObjectFieldAssign>,
    pub close: CloseBrace,
    // some fields omitted
}

A number literal.

Fields

ident: LitObjectIdent

An object identifier.

open: OpenBrace

The open bracket.

assignments: Vec<LitObjectFieldAssign>

Items in the object declaration.

close: CloseBrace

The close bracket.

Implementations

impl LitObject[src]

pub fn span(&self) -> Span[src]

Access the span of the expression.

pub fn is_const(&self) -> bool[src]

Test if the entire expression is constant.

pub fn parse_with_ident(
    parser: &mut Parser<'_>,
    ident: LitObjectIdent
) -> Result<Self, ParseError>
[src]

Parse a literal object with the given path.

Trait Implementations

impl Clone for LitObject[src]

impl Debug for LitObject[src]

impl Parse for LitObject[src]

Parse an object literal.

Examples

use rune::{parse_all, ast};

parse_all::<ast::LitObject>("Foo {\"foo\": 42}").unwrap();
parse_all::<ast::LitObject>("#{\"foo\": 42}").unwrap();
parse_all::<ast::LitObject>("#{\"foo\": 42,}").unwrap();

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,