DeclProvider

Trait DeclProvider 

Source
pub trait DeclProvider {
    // Required methods
    fn get_by_id<'a>(&'a self, id: u64) -> &'a DeclFile;
    fn get_by_name<'a>(&'a self, name: &str) -> Option<&'a DeclFile>;
}
Expand description

trait for types providing decleration files.

decleration providers are used by functions that need access to decleration files.

decleration providers can provide decleration files from any source, guaranteed to be valid and the same for every access.

Required Methods§

Source

fn get_by_id<'a>(&'a self, id: u64) -> &'a DeclFile

get a decleration file by its id.

this method can not fail, it is used for decleration files that were created before.

Source

fn get_by_name<'a>(&'a self, name: &str) -> Option<&'a DeclFile>

get a decleration file by its name.

this method return None on fail, when the requested decleration file can not be found or it cant be parsed.

Implementors§