feat: implement RepositoryMeta

This commit is contained in:
RobWalt 2023-10-22 11:22:52 +02:00
parent 4973971996
commit d1e5fd27ca
No known key found for this signature in database
GPG key ID: 333C6AC0CEF0CE68

View file

@ -1,9 +1,22 @@
// RepositoryMeta{
// description:
// RepositoryMeta basic repository information
//
// full_name string
// id integer($int64)
// name string
// owner string
// }
use std::fmt::Display;
use serde::{Deserialize, Serialize};
/// Represents basic repository information.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RepositoryMeta {
/// The full name of the repository.
pub full_name: String,
/// The unique identifier of the repository.
pub id: usize,
/// The name of the repository.
pub name: String,
/// The owner of the repository.
pub owner: String,
}
impl Display for RepositoryMeta {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.full_name)
}
}