[][src]Trait rbatis::crud::Id

pub trait Id {
    type IdType: Send + Sync + DeserializeOwned + Serialize + Display;
    fn get_id(&self) -> Option<Self::IdType>;
}

fetch id value

for example: impl Id for BizActivity { type IdType = String;

    fn get_id(&self) -> Option<Self::IdType> {
        self.id.clone()
    }
}

let vec = vec![BizActivity { id: Some("12312".to_string()) }]; let ids = vec.to_ids(); println!("{:?}", ids);

Associated Types

Loading content...

Required methods

fn get_id(&self) -> Option<Self::IdType>

Loading content...

Implementors

Loading content...