Struct wit_parser::Document

source ·
pub struct Document<'a> {
    pub worlds: Vec<World>,
    pub interfaces: Vec<Interface>,
    /* private fields */
}
Expand description

Represents the result of parsing a wit document.

Fields

worlds: Vec<World>

The worlds contained in the document.

interfaces: Vec<Interface>

The top-level interfaces contained in the document.

Implementations

Parses the given string as a wit document.

The path argument is used for error reporting.

Converts the document into a single world definition.

Returns an error if there were no worlds defined in the document or if there were multiple worlds defined.

Converts the document into a single interface definition.

Returns an error if there were no worlds defined in the document or if there were multiple worlds defined.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.