~savoy/mailcap

8c156a4705624eca19a94b553d5d23805c875a97 — savoy 2 years ago e11d926
getter methods for Entry

Signed-off-by: savoy <git@liberation.red>
1 files changed, 52 insertions(+), 0 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +52 -0
@@ 205,6 205,58 @@ impl Entry {
        entry
    }

    pub fn mime(&self) -> &String {
        &self.mime_type
    }

    pub fn command(&self) -> &Vec<String> {
        &self.command
    }

    pub fn compose(&self) -> &Option<Vec<String>> {
        &self.compose
    }

    pub fn compose_typed(&self) -> &Option<Vec<String>> {
        &self.compose_typed
    }

    pub fn edit(&self) -> &Option<Vec<String>> {
        &self.edit
    }

    pub fn print(&self) -> &Option<Vec<String>> {
        &self.print
    }

    pub fn test(&self) -> &Option<Vec<String>> {
        &self.test
    }

    pub fn note(&self) -> &Option<String> {
        &self.note
    }

    pub fn description(&self) -> &Option<String> {
        &self.description
    }

    pub fn name_template(&self) -> &Option<String> {
        &self.name_template
    }

    pub fn needs_terminal(&self) -> &bool {
        &self.needs_terminal
    }

    pub fn copious_output(&self) -> &bool {
        &self.copious_output
    }

    pub fn textual_new_lines(&self) -> &bool {
        &self.textual_new_lines
    }

    fn parse_arg(field: &str) -> Option<(&str, &str)> {
        match field.find("=") {
            Some(i) => Some(field.split_at(i)),