[][src]Enum sway_conf::ast::Item

pub enum Item<'a> {
    Comment(Line<'a>),
    Set(SetVar),
    Exec(Exec),
    SwitchMode(SwitchMode),
    BindSym(BindSym<'a>),
    Nested {
        l_brace: Token<'a>,
        r_brace: Token<'a>,
        nested: Vec<Item<'a>>,
    },
    RuntimeResolvable(RuntimeResolvable<'a>),
    Include(Include<'a>),
    Unknown(Stanza<'a>),
}

Represents a sway command. This may not directly correspond to a line in the config, due to possible line continuations or blocks.

Variants

Comment(Line<'a>)

A comment, leading with a pound symbol.

Set(SetVar)

A 'set' command.

Exec(Exec)

An 'exec' command.

SwitchMode(SwitchMode)

A command to switch to the specified mode.

BindSym(BindSym<'a>)

A command which maps a key combination to a sway command.

Nested

A set of commands within a block.

Fields of Nested

l_brace: Token<'a>r_brace: Token<'a>nested: Vec<Item<'a>>
RuntimeResolvable(RuntimeResolvable<'a>)

A command which can only be resolved at runtime (because the first atom references a variable).

Include(Include<'a>)

A command to include configuration from another file.

Unknown(Stanza<'a>)

A stanza which is invalid or not yet supported.

Implementations

impl<'a> Item<'a>[src]

pub fn visit<'b, E, F>(&mut self, visitor: F) -> Result<(), TraversalError<E>> where
    F: FnMut(&mut Item<'_>) -> Result<(), E> + 'b, 
[src]

Calls the provided closure on all nested items and then itself.

Trait Implementations

impl<'a> Clone for Item<'a>[src]

impl<'a> Debug for Item<'a>[src]

impl<'a> Eq for Item<'a>[src]

impl<'a> PartialEq<Item<'a>> for Item<'a>[src]

impl<'a> Serialize for Item<'a>[src]

impl<'a> StructuralEq for Item<'a>[src]

impl<'a> StructuralPartialEq for Item<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Item<'a>[src]

impl<'a> Send for Item<'a>[src]

impl<'a> Sync for Item<'a>[src]

impl<'a> Unpin for Item<'a>[src]

impl<'a> UnwindSafe for Item<'a>[src]

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> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

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

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

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.