pub struct ExternalIdentity {
pub provider: ExternalProvider,
pub instance: String,
pub namespace: Option<String>,
pub kind: ExternalObjectKind,
pub external_id: String,
}Expand description
Identity of an external object, independent of its display label and URL.
Two references name one object when their ObjectKeys are equal, so equal numbers from
different instances, namespaces or number spaces never collide.
Fields§
§provider: ExternalProviderTracker family.
instance: StringLowercase host[:port] of the hosted or self-hosted instance, without scheme or path.
namespace: Option<String>Tenant, owner/repository or project namespace where the provider scopes identifiers.
kind: ExternalObjectKindObject category; it splits identity only between number spaces.
external_id: StringProvider identifier: a number on forges, a PROJECT-N key on Jira and Linear.
Implementations§
Source§impl ExternalIdentity
impl ExternalIdentity
Sourcepub fn canonical(&self) -> Self
pub fn canonical(&self) -> Self
Normalize spelling that providers treat as equal; validation rejects any other form.
Every rule strips to a fixed point, so canonical is idempotent and the spelling a
rejection suggests is always accepted.
Sourcepub fn object_key(&self) -> ObjectKey
pub fn object_key(&self) -> ObjectKey
The key of the object this identity names, computed on its canonical form.
Sourcepub fn permits_kind_change_to(&self, next: &Self) -> bool
pub fn permits_kind_change_to(&self, next: &Self) -> bool
Whether a record of this identity may be restated with next’s kind: unchanged, or
another kind of the same number space unless the record is a pull request. A pull request
is the most specific kind of its number, so it is never downgraded; a kind of another
number space names another object. Linking and reviewed plan changes both apply this rule.
Sourcepub fn refines_kind_of(&self, recorded: &Self) -> bool
pub fn refines_kind_of(&self, recorded: &Self) -> bool
Whether this identity names recorded’s object with a kind the record may be restated to.
Source§impl ExternalIdentity
impl ExternalIdentity
Sourcepub fn validate(&self, id: ExternalReferenceId) -> Result<(), ValidationError>
pub fn validate(&self, id: ExternalReferenceId) -> Result<(), ValidationError>
Check that this identity is canonical and structurally valid; commands check a requested identity with this even when it resolves to an existing record.