pub struct GitHubClient { /* private fields */ }Implementations§
Source§impl GitHubClient
impl GitHubClient
pub fn new(cfg: &GitHubConfig) -> Result<Self>
pub fn with_user_agent(cfg: &GitHubConfig, user_agent: &str) -> Result<Self>
Sourcepub fn get_file_content(
&self,
owner: &str,
repo: &str,
path: &str,
ref_sha: &str,
) -> Result<String>
pub fn get_file_content( &self, owner: &str, repo: &str, path: &str, ref_sha: &str, ) -> Result<String>
Fetch raw file content from a repository at a specific ref.
Uses the GitHub raw content media type to avoid base64 encoding.
Sourcepub fn find_files_in_tree(
&self,
owner: &str,
repo: &str,
ref_sha: &str,
filter: impl Fn(&str) -> bool,
) -> Result<TreeSearchResult>
pub fn find_files_in_tree( &self, owner: &str, repo: &str, ref_sha: &str, filter: impl Fn(&str) -> bool, ) -> Result<TreeSearchResult>
List all file paths in a repository tree at a given ref using the Git Tree API.
Returns paths matching filter predicate and a truncated flag.
When truncated is true, the tree exceeded GitHub’s limit and some
files may be missing — callers should treat this as partial evidence.
Sourcepub fn get_with_link(&self, path: &str) -> Result<(String, Option<String>)>
pub fn get_with_link(&self, path: &str) -> Result<(String, Option<String>)>
GET request with pagination support. Returns (body, next_url).
Sourcepub fn paginate<T: DeserializeOwned>(
&self,
initial_path: &str,
) -> Result<Vec<T>>
pub fn paginate<T: DeserializeOwned>( &self, initial_path: &str, ) -> Result<Vec<T>>
Paginate a GitHub API endpoint, collecting all items across pages.
Sourcepub fn paginate_search<T: DeserializeOwned>(
&self,
initial_path: &str,
) -> Result<Vec<T>>
pub fn paginate_search<T: DeserializeOwned>( &self, initial_path: &str, ) -> Result<Vec<T>>
Paginate a GitHub Search API endpoint whose response wraps items in { items: [...] }.
Auto Trait Implementations§
impl Freeze for GitHubClient
impl !RefUnwindSafe for GitHubClient
impl Send for GitHubClient
impl Sync for GitHubClient
impl Unpin for GitHubClient
impl UnsafeUnpin for GitHubClient
impl !UnwindSafe for GitHubClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more