pub enum ScaleTarget {
Repository(OwnerRepo),
Organization(Org),
}Expand description
What one policy scales for (D18).
04-subsystem-contracts.md: “The two differ only in which GitHub endpoints
and which App permission the gateway uses; ownership, capacity, and lifecycle
rules are identical.”
That sentence is a design constraint on this crate, and it is why nothing
below branches on the variant: there is no is_repository() shortcut, no
per-variant capacity rule, and no endpoint string. Endpoints belong to c3
and c4; the only thing the domain exposes is ScaleTarget::scope, so a
gateway can select one. policy::tests::repository_and_organization_targets_ are_equivalent runs one body over both variants to keep it that way.
Variants§
Implementations§
Source§impl ScaleTarget
impl ScaleTarget
Sourcepub fn repository(raw: impl AsRef<str>) -> Result<Self, ValidationError>
pub fn repository(raw: impl AsRef<str>) -> Result<Self, ValidationError>
§Errors
A malformed OWNER/REPO.
Sourcepub fn organization(raw: impl AsRef<str>) -> Result<Self, ValidationError>
pub fn organization(raw: impl AsRef<str>) -> Result<Self, ValidationError>
§Errors
A malformed organization login.
pub const fn scope(&self) -> TargetScope
Trait Implementations§
Source§impl Clone for ScaleTarget
impl Clone for ScaleTarget
Source§fn clone(&self) -> ScaleTarget
fn clone(&self) -> ScaleTarget
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScaleTarget
impl Debug for ScaleTarget
Source§impl<'de> Deserialize<'de> for ScaleTarget
impl<'de> Deserialize<'de> for ScaleTarget
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ScaleTarget
impl Display for ScaleTarget
impl Eq for ScaleTarget
Source§impl Hash for ScaleTarget
impl Hash for ScaleTarget
Source§impl Ord for ScaleTarget
impl Ord for ScaleTarget
Source§fn cmp(&self, other: &ScaleTarget) -> Ordering
fn cmp(&self, other: &ScaleTarget) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ScaleTarget
impl PartialEq for ScaleTarget
Source§impl PartialOrd for ScaleTarget
impl PartialOrd for ScaleTarget
Source§impl Serialize for ScaleTarget
impl Serialize for ScaleTarget
impl StructuralPartialEq for ScaleTarget
Auto Trait Implementations§
impl Freeze for ScaleTarget
impl RefUnwindSafe for ScaleTarget
impl Send for ScaleTarget
impl Sync for ScaleTarget
impl Unpin for ScaleTarget
impl UnsafeUnpin for ScaleTarget
impl UnwindSafe for ScaleTarget
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