Skip to main content

FamilySpec

Struct FamilySpec 

Source
pub struct FamilySpec {
Show 16 fields pub family: ApiFamily, pub tag: &'static str, pub pr_sigil: char, pub parse_remote: fn(&str) -> Option<RemoteRef>, pub owns_remote: fn(&Integration, &RemoteRef) -> bool, pub pr_web_url: fn(web_root: &str, project: &str, number: u64) -> Option<String>, pub pr_edit_url: fn(pr_web_url: &str) -> String, pub new_pr_url: fn(web_root: &str, project: &str, source: &str, target: Option<&str>) -> Option<String>, pub new_pr_form_url: fn(web_root: &str, form: &PullRequestForm<'_>) -> Option<String>, pub issue_web_url: fn(web_root: &str, project: &str, reference: &str) -> Option<String>, pub new_issue_url: fn(web_root: &str, project: &str, title: &str, body: &str, labels: &[String]) -> Option<String>, pub branch_url: fn(web_root: &str, project: &str, branch: &str) -> Option<String>, pub commit_url: fn(web_root: &str, project: &str, sha: &str) -> Option<String>, pub checkout: fn(&PullRequestSummary) -> CheckoutSource, pub token_page: fn(&Integration) -> Option<String>, pub well_known: fn(host: &str) -> Option<IntegrationKind>,
}
Expand description

Everything family-specific the app needs to know without a network call.

Fields§

§family: ApiFamily§tag: &'static str

Toolbar chip and list tag: GH GL AZ BB JI TR GT LN YT RM GR.

§pr_sigil: char

The character before a pull request number: # or !.

§parse_remote: fn(&str) -> Option<RemoteRef>

Remote URL to instance root plus project path.

§owns_remote: fn(&Integration, &RemoteRef) -> bool

Does integration answer questions about remote? Default: same hostname. Azure DevOps compares the organization root as well.

§pr_web_url: fn(web_root: &str, project: &str, number: u64) -> Option<String>§pr_edit_url: fn(pr_web_url: &str) -> String§new_pr_url: fn(web_root: &str, project: &str, source: &str, target: Option<&str>) -> Option<String>§new_pr_form_url: fn(web_root: &str, form: &PullRequestForm<'_>) -> Option<String>§issue_web_url: fn(web_root: &str, project: &str, reference: &str) -> Option<String>§new_issue_url: fn(web_root: &str, project: &str, title: &str, body: &str, labels: &[String]) -> Option<String>§branch_url: fn(web_root: &str, project: &str, branch: &str) -> Option<String>§commit_url: fn(web_root: &str, project: &str, sha: &str) -> Option<String>§checkout: fn(&PullRequestSummary) -> CheckoutSource§token_page: fn(&Integration) -> Option<String>

The page that mints a token with the right scopes.

§well_known: fn(host: &str) -> Option<IntegrationKind>

The kind a lowercased web host identifies with no configuration.

Implementations§

Source§

impl FamilySpec

Source

pub const fn none(family: ApiFamily, tag: &'static str, pr_sigil: char) -> Self

A spec with nothing filled in: every URL is None, remotes parse and match by hostname, a pull request is fetched by branch.

Auto Trait Implementations§

§

impl Forget for FamilySpec

§

impl Freeze for FamilySpec
where &'static str: Freeze,

§

impl Move for FamilySpec

§

impl RefUnwindSafe for FamilySpec

§

impl Send for FamilySpec
where &'static str: Send,

§

impl Sync for FamilySpec

§

impl Unpin for FamilySpec
where &'static str: Unpin,

§

impl UnsafeUnpin for FamilySpec
where &'static str: UnsafeUnpin,

§

impl UnwindSafe for FamilySpec
where &'static str: UnwindSafe,

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

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