Skip to content

How to generically call methods? #6

@evbo

Description

@evbo

I am trying to call the get method but can't seem to import the trait. How can this be done?

// fails to resolve GetterSetter (how do I import it?)
impl<T: GetterSetter> Beak for T {
    fn blah(&self) {
        // this works for a similar crate:
        // println!("heyttttt: {:?}", T::FIELD_NAMES_AS_SLICE);
        println!("heyttttt: {:?}", T::get("id"));
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions