Skip to main content

Issues

Struct Issues 

Source
pub struct Issues<'a> { /* private fields */ }

Implementations§

Source§

impl Issues<'_>

Source

pub fn list(&self, filter: &IssueFilter<'_>) -> Result<Vec<Issue>>

Source

pub fn get(&self, number: &str) -> Result<Issue>

Source

pub fn create(&self, req: &CreateIssue<'_>) -> Result<Issue>

Gitee quirk: issue creation is POST /repos/{owner}/issues with repo as a form field (no repo segment in the path).

Source

pub fn set_state(&self, number: &str, state: IssueState) -> Result<Issue>

Gitee quirk: state changes are PATCH /repos/{owner}/issues/{number} with a JSON body {repo, title, state}. The current title must be echoed back or Gitee blanks it.

Writable state values observed on the live v5 API: open, progressing, closed. Sending rejected yields 400. Closing always becomes issue_state 已完成 (not 拒绝 / wontfix).

Source

pub fn set_state_idempotent( &self, number: &str, target: IssueState, ) -> Result<StateChange<Issue>>

Idempotent state change: GETs the current issue first; if it is already in target, returns StateChange::Already(issue) without a PATCH. Otherwise applies the PATCH and returns StateChange::Changed(issue).

Source

pub fn edit(&self, number: &str, req: &EditIssue<'_>) -> Result<Issue>

PATCH metadata. Same JSON quirk as set_state: repo and the current title must always be echoed; only Some fields are added.

Source

pub fn comment(&self, number: &str, body: &str) -> Result<Comment>

Source

pub fn list_comments(&self, number: &str, limit: usize) -> Result<Vec<Comment>>

List comments on an issue. limit caps how many are returned (paging via get_paged).

Source

pub fn latest_comment(&self, number: &str, login: &str) -> Result<Comment>

Resolve --last: the comment by login with the latest created_at. Paginates fully (independent of list --limit). Nothing found ⇒ Usage.

Source

pub fn update_comment(&self, id: i64, body: &str) -> Result<Comment>

PATCH an issue comment by integer id.

Source

pub fn update_latest_comment( &self, number: &str, login: &str, body: &str, ) -> Result<Comment>

--last edit: resolve login’s most-recent comment on the issue, then PATCH.

Source

pub fn delete_comment(&self, id: i64) -> Result<StateChange<()>>

DELETE an issue comment by integer id. Already gone (404) ⇒ Already (idempotent success, silent at the cmd layer).

Source

pub fn delete_latest_comment( &self, number: &str, login: &str, ) -> Result<StateChange<()>>

--last delete: resolve login’s most-recent comment on the issue, then DELETE.

Source

pub fn list_labels(&self, number: &str) -> Result<Vec<Label>>

Labels currently attached to an issue. Gitee’s issue-labels GET is not paginated (unlike PR labels).

Source

pub fn add_labels_idempotent( &self, number: &str, names: &[&str], ) -> Result<StateChange<Vec<Label>>>

Add labels without replacing the rest. GETs current membership first; POSTs only names that are missing. Already-present ⇒ Already (no POST).

Source

pub fn remove_labels_idempotent( &self, number: &str, names: &[&str], ) -> Result<StateChange<()>>

Remove only the named labels. GETs current membership first; DELETEs only names that are present. Absent names and DELETE 404 ⇒ no-op.

GET the issue first; if body already contains tag, returns Ok(false) without PATCH. Otherwise PATCH JSON {repo, title, body} with appended Linked: {tag} and returns Ok(true).

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Issues<'a>

§

impl<'a> !UnwindSafe for Issues<'a>

§

impl<'a> Freeze for Issues<'a>

§

impl<'a> Send for Issues<'a>

§

impl<'a> Sync for Issues<'a>

§

impl<'a> Unpin for Issues<'a>

§

impl<'a> UnsafeUnpin for Issues<'a>

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: Sized + 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: Sized + 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 = !

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

fn try_from(value: U) -> Result<T, !>

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