Trait reproto_core::Options [] [src]

pub trait Options {
    type Item: OptionEntry;
    fn items(&self) -> &Vec<Loc<Self::Item>>;

    fn lookup(&self, name: &str) -> Vec<Loc<&Self::Item>> { ... }
fn find_all_strings(
        &self,
        name: &str
    ) -> Result<Vec<Loc<String>>, (&'static str, Pos)> { ... }
fn find_all_u32(
        &self,
        name: &str
    ) -> Result<Vec<Loc<RpNumber>>, (&'static str, Pos)> { ... }
fn find_all_identifiers(
        &self,
        name: &str
    ) -> Result<Vec<Loc<String>>, (&'static str, Pos)> { ... }
fn find_one_identifier(
        &self,
        name: &str
    ) -> Result<Option<Loc<String>>, (&'static str, Pos)> { ... }
fn find_one_string(
        &self,
        name: &str
    ) -> Result<Option<Loc<String>>, (&'static str, Pos)> { ... }
fn find_one_u32(
        &self,
        name: &str
    ) -> Result<Option<Loc<RpNumber>>, (&'static str, Pos)> { ... } }

Helper for looking up and dealing with options.

Associated Types

Required Methods

Provided Methods

Find all strings matching the given name.

This enforces that all found values are strings, otherwise the lookup will cause an error.

Find all identifiers matching the given name.

This enforces that all found values are identifiers, otherwise the lookup will cause an error.

Optionally find exactly one identifier matching the given name.

This enforces that all found values are identifiers, otherwise the lookup will cause an error.

Implementations on Foreign Types

impl<T> Options for Vec<Loc<T>> where
    T: OptionEntry
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Implementors