Skip to main content

ProjectHandler

Struct ProjectHandler 

Source
pub struct ProjectHandler<'octo> { /* private fields */ }
Expand description

A struct to access GitHub’s projects API.

Created with Octocrab::projects.

Implementations§

Source§

impl<'octo> ProjectHandler<'octo>

Source

pub fn get_project( &self, project_id: impl Into<u32>, ) -> GetProjectBuilder<'_, '_>

Get a project by its id.

§Arguments
  • project_id - id of the project to fetch
let project_id: u32 = 1002604;
let project = octocrab::instance()
    .projects()
    .get_project(project_id)
    .send()
    .await?;
Source

pub fn update_project<B>( &self, project_id: impl Into<u32>, ) -> UpdateProjectBuilder<'_, '_, B>
where B: Serialize + ?Sized,

Updates a project given its project id.

§Arguments
  • project_id - id of the project to update
let body = serde_json::json!({ "name": "Week One Sprint", "state": "open" });
let project_id: u32 = 1002604;
let project = octocrab::instance()
    .projects()
    .update_project(project_id)
    .body(&body)
    .send()
    .await?;
Source

pub fn delete_project( &self, project_id: impl Into<u32>, ) -> DeleteProjectBuilder<'_, '_>

Deletes a project board.

§Arguments
  • project_id - id of the project to delete
let project_id: u32 = 1002604;
let project = octocrab::instance()
    .projects()
    .delete_project(project_id)
    .send()
    .await?;
Source

pub fn create_user_project( &self, username: impl Into<String>, ) -> CreateUserProjectBuilder<'_, '_>

Creates a user project board given its name.

§Arguments
  • username - account username
let username = "octocat";
let description = "Project Overview";
let project = octocrab::instance()
    .projects()
    .create_user_project(username)
    .body(description)
    .send()
    .await?;
Source

pub fn list_user_projects( &self, username: impl Into<String>, ) -> ListUserProjectsBuilder<'_, '_>

List a user’s projects the username of the user

§Arguments
  • username - account unsername
let username = "octocat";
let project = octocrab::instance()
    .projects()
    .list_user_projects(username)
    .send()
    .await?;
Source

pub fn list_organization_projects( &self, org: impl Into<String>, ) -> ListOrgProjectsBuilder<'_, '_>

List the projects of an organization.

§Notes

Only users with sufficient privileges can list an organization’s projects.

§Arguments
  • org - name of the organization
let org = "octocrab";
let projects = octocrab::instance()
    .projects()
    .list_organization_projects(org)
    .state("all")
    .send()
    .await?;
Source

pub fn create_organization_project( &self, org: impl Into<String>, name: impl Into<String>, ) -> CreateOrgProjectsBuilder<'_, '_>

Create an organization project board.

§Arguments
  • org - organization name.
  • name - name of the project.
let org = "octocrab";
let name = "Organization Roadmap";
let project = octocrab::instance()
    .projects()
    .create_organization_project(org, name)
    .send()
    .await?;
Source

pub fn create_repository_project( &self, owner: impl Into<String>, repo: impl Into<String>, ) -> CreateRepositoryProjectsBuilder<'_, '_, NotNamed>

Creates a repository project board.

§Arguments
  • owner - repository owner.
  • repo - repository name.
let owner = "octocat";
let repo = "octocrab";
let name = "My Project";
let description = "Project Overview";
let tags = octocrab::instance()
    .projects()
    .create_repository_project("owner", "repo")
    .project_name(name)
    .body(description)
    .send()
    .await?;
Source

pub fn list_repository_projects( &self, owner: impl Into<String>, repo: impl Into<String>, ) -> ListRepositoryProjectsBuilder<'_, '_>

Lists the projects in a repository.

§Arguments
  • owner - repository owner.
  • repo - repository name.
let owner = "octocat";
let repo = "octocrab";
let tags = octocrab::instance()
    .projects()
    .list_repository_projects("owner", "repo")
    .send()
    .await?;

Auto Trait Implementations§

§

impl<'octo> !RefUnwindSafe for ProjectHandler<'octo>

§

impl<'octo> !UnwindSafe for ProjectHandler<'octo>

§

impl<'octo> Freeze for ProjectHandler<'octo>

§

impl<'octo> Send for ProjectHandler<'octo>

§

impl<'octo> Sync for ProjectHandler<'octo>

§

impl<'octo> Unpin for ProjectHandler<'octo>

§

impl<'octo> UnsafeUnpin for ProjectHandler<'octo>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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