pub struct RestClient { /* private fields */ }Expand description
A wrapper struct around a REST API client.
Underneath, the client may support various Git servers and CI platforms. Currently, the client supports GitHub and GitHub Actions.
Implementations§
Source§impl RestClient
impl RestClient
Sourcepub fn new() -> Result<Self, ClientError>
pub fn new() -> Result<Self, ClientError>
Initializes the REST API client and sets the UserAgent header.
See git_bot_feedback::client::init_client for details on possible errors during initialization.
Sourcepub async fn get_list_of_changed_files(
&self,
file_filter: &FileFilter,
lines_changed_only: &LinesChangedOnly,
base_diff: &Option<String>,
ignore_index: bool,
) -> Result<Vec<FileObj>, ClientError>
pub async fn get_list_of_changed_files( &self, file_filter: &FileFilter, lines_changed_only: &LinesChangedOnly, base_diff: &Option<String>, ignore_index: bool, ) -> Result<Vec<FileObj>, ClientError>
Gets a list of changed files.
Use the FileFilter and LinesChangedOnly to filter out files
that might be negligible.
Sourcepub fn is_debug_enabled(&self) -> bool
pub fn is_debug_enabled(&self) -> bool
Should debug logs be enabled?
Sourcepub fn start_log_group(&self, name: &str)
pub fn start_log_group(&self, name: &str)
Start a log group with the given name.
Sourcepub fn end_log_group(&self, name: &str)
pub fn end_log_group(&self, name: &str)
End a log group with the given name.
Sourcepub async fn post_feedback(
&mut self,
files: &[Arc<Mutex<FileObj>>],
feedback_inputs: FeedbackInput,
clang_versions: ClangVersions,
) -> Result<u64, ClientError>
pub async fn post_feedback( &mut self, files: &[Arc<Mutex<FileObj>>], feedback_inputs: FeedbackInput, clang_versions: ClangVersions, ) -> Result<u64, ClientError>
Post various forms of feedback.
Use FeedbackInput to configure feedback behavior.
The given ClangVersions is used in thread comments, step summaries, and PR reviews’ summary comment.
Sourcepub fn make_annotations(
files: &[Arc<Mutex<FileObj>>],
style: &str,
) -> Result<Vec<FileAnnotation>, ClientError>
pub fn make_annotations( files: &[Arc<Mutex<FileObj>>], style: &str, ) -> Result<Vec<FileAnnotation>, ClientError>
Post file annotations.
Auto Trait Implementations§
impl !RefUnwindSafe for RestClient
impl !UnwindSafe for RestClient
impl Freeze for RestClient
impl Send for RestClient
impl Sync for RestClient
impl Unpin for RestClient
impl UnsafeUnpin for RestClient
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