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>>> { ... } fn find_all_u32(&self, name: &str) -> Result<Vec<Loc<RpNumber>>> { ... } fn find_all_identifiers(&self, name: &str) -> Result<Vec<Loc<String>>> { ... } fn find_one_identifier(&self, name: &str) -> Result<Option<Loc<String>>> { ... } fn find_one_string(&self, name: &str) -> Result<Option<Loc<String>>> { ... } fn find_one_u32(&self, name: &str) -> Result<Option<Loc<RpNumber>>> { ... } }
Helper for looking up and dealing with options.
Associated Types
type Item: OptionEntry
Required Methods
Provided Methods
fn lookup(&self, name: &str) -> Vec<Loc<&Self::Item>>
fn find_all_strings(&self, name: &str) -> Result<Vec<Loc<String>>>
Find all strings matching the given name.
This enforces that all found values are strings, otherwise the lookup will cause an error.
fn find_all_u32(&self, name: &str) -> Result<Vec<Loc<RpNumber>>>
fn find_all_identifiers(&self, name: &str) -> Result<Vec<Loc<String>>>
Find all identifiers matching the given name.
This enforces that all found values are identifiers, otherwise the lookup will cause an error.
fn find_one_identifier(&self, name: &str) -> Result<Option<Loc<String>>>
Optionally find exactly one identifier matching the given name.
This enforces that all found values are identifiers, otherwise the lookup will cause an error.
fn find_one_string(&self, name: &str) -> Result<Option<Loc<String>>>
fn find_one_u32(&self, name: &str) -> Result<Option<Loc<RpNumber>>>
Implementations on Foreign Types
impl<T> Options for Vec<Loc<T>> where
T: OptionEntry,
[src]
T: OptionEntry,