Repository

Struct Repository 

Source
pub struct Repository {
Show 23 fields pub id: String, pub name: String, pub name_with_owner: String, pub description: Option<String>, pub url: String, pub homepage_url: Option<String>, pub created_at: String, pub updated_at: String, pub pushed_at: Option<String>, pub is_private: bool, pub is_fork: bool, pub is_archived: bool, pub stargazer_count: u32, pub fork_count: u32, pub watchers: TotalCount, pub issues: TotalCount, pub pull_requests: TotalCount, pub releases: TotalCount, pub primary_language: Option<Language>, pub languages: LanguageConnection, pub license_info: Option<License>, pub default_branch_ref: Option<Branch>, pub repository_topics: TopicConnection,
}
Expand description

Full repository information from GitHub API.

Contains comprehensive details about a repository including metadata, statistics, and related information.

Fields§

§id: String

GitHub’s internal ID for the repository

§name: String

Repository name (without owner)

§name_with_owner: String

Full repository name in “owner/repo” format

§description: Option<String>

Repository description

§url: String

GitHub URL for the repository

§homepage_url: Option<String>

Custom homepage URL if set

§created_at: String

ISO 8601 timestamp when repository was created

§updated_at: String

ISO 8601 timestamp of last update

§pushed_at: Option<String>

ISO 8601 timestamp of last push

§is_private: bool

Whether the repository is private

§is_fork: bool

Whether the repository is a fork

§is_archived: bool

Whether the repository is archived

§stargazer_count: u32

Number of stars

§fork_count: u32

Number of forks

§watchers: TotalCount

Number of watchers

§issues: TotalCount

Number of open issues

§pull_requests: TotalCount

Number of pull requests

§releases: TotalCount

Number of releases

§primary_language: Option<Language>

Primary programming language

§languages: LanguageConnection

All languages used in the repository

§license_info: Option<License>

License information

§default_branch_ref: Option<Branch>

Default branch reference

§repository_topics: TopicConnection

Repository topics/tags

Implementations§

Source§

impl Repository

Source

pub fn language(&self) -> Option<&str>

Returns the primary language name, or None if not set.

§Example
let service = GitHubService::new()?;
let repo = service.get_repository_info("rust-lang", "rust").await?;

if let Some(lang) = repo.language() {
    println!("Primary language: {}", lang);
}
Source

pub fn license(&self) -> Option<&str>

Returns the license name, or None if not set.

Source

pub fn license_spdx(&self) -> Option<&str>

Returns the SPDX license identifier, or None if not available.

Source

pub fn default_branch(&self) -> Option<&str>

Returns the default branch name, or None if not set.

Source

pub fn topics(&self) -> Vec<&str>

Returns a list of topic names.

§Example
let service = GitHubService::new()?;
let repo = service.get_repository_info("rust-lang", "rust").await?;

for topic in repo.topics() {
    println!("Topic: {}", topic);
}
Source

pub fn owner(&self) -> &str

Returns the owner part of name_with_owner.

Source

pub fn open_issues(&self) -> u32

Returns the number of open issues.

Source

pub fn watcher_count(&self) -> u32

Returns the number of watchers.

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for Repository

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Repository

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,