pub struct CommitsResource<'c, C: HttpClient> { /* private fields */ }Expand description
Operations on commits within a repository.
Implementations§
Source§impl<'c, C: HttpClient> CommitsResource<'c, C>
impl<'c, C: HttpClient> CommitsResource<'c, C>
Sourcepub async fn create(
&self,
req: &CreateCommitRequest,
) -> Result<CommitSummary, MesaError>
pub async fn create( &self, req: &CreateCommitRequest, ) -> Result<CommitSummary, MesaError>
Sourcepub async fn list(
&self,
params: &ListCommitsParams,
) -> Result<ListCommitsResponse, MesaError>
pub async fn list( &self, params: &ListCommitsParams, ) -> Result<ListCommitsResponse, MesaError>
Sourcepub fn list_all(&self, ref_: Option<&str>) -> PageStream<C, ListCommitsResponse>
pub fn list_all(&self, ref_: Option<&str>) -> PageStream<C, ListCommitsResponse>
Return a PageStream that iterates over all commits.
Optionally filter by ref (branch name or SHA).
Sourcepub async fn create_with_lfs(
&self,
req: &CreateCommitWithLfsRequest,
) -> Result<CommitSummary, MesaError>
pub async fn create_with_lfs( &self, req: &CreateCommitWithLfsRequest, ) -> Result<CommitSummary, MesaError>
Create a new commit with flexible file types (including LFS).
Use this method when you need to include LFS file references in your commit.
§Errors
Returns MesaError if the API request fails.
§Example
use mesa_dev::models::{Author, CommitFileChange, CreateCommitWithLfsRequest};
let commit = client.commits("my-org", "my-repo")
.create_with_lfs(&CreateCommitWithLfsRequest {
branch: "main".to_owned(),
message: "Add large file".to_owned(),
author: Author {
name: "Bot".to_owned(),
email: "bot@example.com".to_owned(),
date: None,
},
files: vec![
CommitFileChange::lfs("models/large.bin", "abc123...", 12345678),
],
base_sha: None,
})
.await?;Auto Trait Implementations§
impl<'c, C> Freeze for CommitsResource<'c, C>
impl<'c, C> RefUnwindSafe for CommitsResource<'c, C>where
C: RefUnwindSafe,
impl<'c, C> Send for CommitsResource<'c, C>
impl<'c, C> Sync for CommitsResource<'c, C>
impl<'c, C> Unpin for CommitsResource<'c, C>
impl<'c, C> UnwindSafe for CommitsResource<'c, C>where
C: RefUnwindSafe,
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