Branch

Struct Branch 

Source
pub struct Branch(/* private fields */);
Expand description

A Bazaar branch.

Implementations§

Source§

impl Branch

Source

pub fn get<'a>(&self, client: &'a dyn Client) -> Result<BranchFull, Error>

Source

pub fn get_wadl<'a>(&self, client: &'a dyn Client) -> Result<Resource, Error>

Source

pub fn put<'a>( &self, client: &'a dyn Client, representation: &BranchFull, ) -> Result<(), Error>

Source

pub fn patch<'a>( &self, client: &'a dyn Client, representation: &BranchDiff, ) -> Result<(), Error>

Source

pub fn delete<'a>(&self, client: &'a dyn Client) -> Result<(), Error>

Source

pub fn get_merge_proposals<'a>( &self, client: &'a dyn Client, status: Option<&str>, merged_revnos: Option<&str>, ) -> Result<PagedCollection<'a, BranchMergeProposalPage>, Error>

Return matching BranchMergeProposals.

§Arguments
  • status: A list of merge proposal statuses to filter by.
  • merged_revnos
Source

pub fn compose_public_url<'a>( &self, client: &'a dyn Client, scheme: &str, ) -> Result<(), Error>

Return a public URL for the branch using the given protocol.

§Arguments
  • scheme: URL scheme
Source

pub fn is_person_trusted_reviewer<'a>( &self, client: &'a dyn Client, reviewer: &Person, ) -> Result<(), Error>

Return true if the reviewer is a trusted reviewer.

The reviewer is trusted if they are either own the branch, or are in the team that owns the branch, or they are in the review team for the branch.

§Arguments
  • reviewer: A person for which the reviewer status is in question.
Source

pub fn can_be_deleted<'a>(&self, client: &'a dyn Client) -> Result<(), Error>

Can this branch be deleted in its current state.

A branch is considered deletable if it has no revisions and is not linked to any bugs, specs, productseries, or code imports.

§Arguments
Source

pub fn get_subscription<'a>( &self, client: &'a dyn Client, person: &Person, ) -> Result<BranchSubscriptionFull, Error>

Return the BranchSubscription for this person.

§Arguments
  • person: The person to search for
Source

pub fn set_owner<'a>( &self, client: &'a dyn Client, new_owner: &Person, ) -> Result<(), Error>

Set the owner of the branch to be new_owner.

§Arguments
  • new_owner: The new owner of the branch.
Source

pub fn set_target<'a>( &self, client: &'a dyn Client, project: Option<&Project>, source_package: Option<&SourcePackage>, ) -> Result<(), Error>

Set the target of the branch to be project or source_package.

Only one of project or source_package can be set, and if neither is set, the branch gets moved into the junk namespace of the branch owner.

§Arguments
  • project: The project the branch belongs to.
  • source_package: The source package the branch belongs to.

Link a bug to this branch.

§Arguments
  • bug: IBug to link.

Unlink a bug to this branch.

§Arguments
  • bug: IBug to unlink.

Link an ISpecification to a branch.

§Arguments
  • spec: ISpecification to link.

Unlink an ISpecification to a branch.

§Arguments
  • spec: ISpecification to unlink.
Source

pub fn create_merge_proposal<'a>( &self, client: &'a dyn Client, target_branch: &Branch, prerequisite_branch: Option<&Branch>, needs_review: Option<&str>, initial_comment: Option<&str>, commit_message: Option<&str>, reviewers: Option<&str>, review_types: Option<&str>, ) -> Result<Option<BranchMergeProposal>, Error>

Create a new BranchMergeProposal with this branch as the source.

Both the target_branch and the prerequisite_branch, if it is there, must be branches with the same target as the source branch.

Personal branches (a.k.a. junk branches) cannot specify landing targets.

§Arguments
  • target_branch

  • prerequisite_branch

  • needs_review: Needs review

    If True the proposal needs review.Otherwise, it will be work in progress.

  • initial_comment: Initial comment

    Registrant’s initial description of proposal.

  • commit_message: Commit message

    Message to use when committing this merge.

  • reviewers

  • review_types

Source

pub fn subscribe<'a>( &self, client: &'a dyn Client, person: &Person, notification_level: &NotificationLevel, max_diff_lines: &MaxDiffLines, code_review_level: &CodeReviewLevel, ) -> Result<BranchSubscriptionFull, Error>

Subscribe this person to the branch.

§Arguments
  • person: The person to subscribe.
  • notification_level: The level of notification to subscribe to.
  • max_diff_lines: The max number of lines for diff email.
  • code_review_level: The level of code review notification emails.
Source

pub fn unsubscribe<'a>( &self, client: &'a dyn Client, person: &Person, ) -> Result<(), Error>

Remove the person’s subscription to this branch.

§Arguments
  • person: The person to unsubscribe
Source

pub fn request_mirror<'a>(&self, client: &'a dyn Client) -> Result<(), Error>

Request that this branch be mirrored on the next run of the branch puller.

§Arguments

Trait Implementations§

Source§

impl Resource for Branch

Source§

fn url(&self) -> &Url

The URL of the resource

Auto Trait Implementations§

§

impl Freeze for Branch

§

impl RefUnwindSafe for Branch

§

impl Send for Branch

§

impl Sync for Branch

§

impl Unpin for Branch

§

impl UnwindSafe for Branch

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: 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: 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 = 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