pub trait ProjectInfo {
Show 14 methods
// Required methods
fn get_id(&self) -> &str;
fn get_slug(&self) -> Option<&str>;
fn get_title(&self) -> Option<&str>;
fn get_description(&self) -> Option<&str>;
fn get_categories(&self) -> Option<&[String]>;
fn get_client_side(&self) -> Option<&str>;
fn get_server_side(&self) -> Option<&str>;
fn get_project_type(&self) -> &str;
fn get_downloads(&self) -> i32;
fn get_versions(&self) -> &[String];
fn get_followers(&self) -> i32;
fn get_author(&self) -> &str;
fn get_date_created(&self) -> &str;
fn get_date_modified(&self) -> &str;
}Expand description
一致的 Project 接口封装,使得无论是直接查询 Project 还是从 SearchHit 返回的结果
都可以用相似的逻辑进行处理。
Required Methods§
fn get_id(&self) -> &str
fn get_slug(&self) -> Option<&str>
fn get_title(&self) -> Option<&str>
fn get_description(&self) -> Option<&str>
fn get_categories(&self) -> Option<&[String]>
fn get_client_side(&self) -> Option<&str>
fn get_server_side(&self) -> Option<&str>
fn get_project_type(&self) -> &str
fn get_downloads(&self) -> i32
fn get_versions(&self) -> &[String]
fn get_followers(&self) -> i32
fn get_date_created(&self) -> &str
fn get_date_modified(&self) -> &str
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".