pub struct Labels<'a> { /* private fields */ }Implementations§
Source§impl Labels<'_>
impl Labels<'_>
Sourcepub fn list(&self, limit: usize) -> Result<Vec<Label>>
pub fn list(&self, limit: usize) -> Result<Vec<Label>>
GET /repos/{owner}/{repo}/labels returns a plain array. The swagger
documents no page/per_page params, so we fetch the full list with
get and truncate to limit client-side.
pub fn create(&self, req: &CreateLabel<'_>) -> Result<Label>
Sourcepub fn create_idempotent(
&self,
req: &CreateLabel<'_>,
) -> Result<StateChange<Label>>
pub fn create_idempotent( &self, req: &CreateLabel<'_>, ) -> Result<StateChange<Label>>
Idempotent create: list existing labels first. If a label with the
same name already exists with the requested color, return
StateChange::Already(label) and exit 0. If it exists with a
different color, return a Usage error suggesting label edit. If it
doesn’t exist, create it and return StateChange::Changed(label).
pub fn edit(&self, original_name: &str, req: &EditLabel<'_>) -> Result<Label>
pub fn delete(&self, name: &str) -> Result<()>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Labels<'a>
impl<'a> !UnwindSafe for Labels<'a>
impl<'a> Freeze for Labels<'a>
impl<'a> Send for Labels<'a>
impl<'a> Sync for Labels<'a>
impl<'a> Unpin for Labels<'a>
impl<'a> UnsafeUnpin for Labels<'a>
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