pub enum VisibilityTier {
Public,
Internal,
TeamScoped {
team_id: String,
},
Restricted {
scope_label: String,
},
Private {
scope_label: String,
},
}Expand description
Content-side visibility tier. Shared by annotations, discussions, and states so the per-commit visibility tiers and annotation/discussion visibility draw from one vocabulary rather than parallel enums.
Variants§
Public
Internal
TeamScoped
Restricted
Private
The strictest tier: withheld from every audience — including the
otherwise all-seeing Internal audience — except the one holder of
the matching Restricted(scope_label). Used for embargoed per-state
commit visibility, where even internal callers must not see the
content. The who-sees-what arm lives in repo::visibility::visible,
placed above the (_, Internal) => true arm so the embargo holds.
Implementations§
Source§impl VisibilityTier
impl VisibilityTier
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Stable wire/storage token for the tier discriminant. The labelled variants collapse to their kind name here; the label travels in a separate field. Shared by the discussion RPC vocabulary and the state-visibility signing payload, so it must stay stable.
Sourcepub fn restrictiveness_rank(&self) -> u8
pub fn restrictiveness_rank(&self) -> u8
Restrictiveness ordering used by the visibility promote monotonicity
check (heddle#317). Lower rank = LESS restrictive (the tier reaches a
broader audience):
| tier | rank | audience reach |
|---|---|---|
Public | 0 | every audience (least restrictive) |
Internal | 1 | the workspace-internal set (+ every team) |
TeamScoped | 2 | one named team |
Restricted | 3 | one named scope label |
Private | 4 | only the matching scope holder (most restrictive, even Internal is excluded) |
This is the defined total order for “less restrictive”, consistent with
spike #266 §5.2 (Internal content is one of the least-restrictive
values; Private the most — it is the embargo tier that withholds from
every audience including Internal). The labelled variants compare by
rank only — a lateral move between two teams / two scope labels is the
same rank, hence not strictly less restrictive, and must go through
set rather than promote.
Sourcepub fn is_strictly_less_restrictive_than(&self, other: &Self) -> bool
pub fn is_strictly_less_restrictive_than(&self, other: &Self) -> bool
true iff self is strictly less restrictive than other — i.e. a
promote from other to self is a valid opening transition. A
narrowing (self more restrictive) or lateral (equal rank, including a
different team/scope label at the same rank) change returns false and
must be expressed with set. See restrictiveness_rank.
Trait Implementations§
Source§impl Clone for VisibilityTier
impl Clone for VisibilityTier
Source§fn clone(&self) -> VisibilityTier
fn clone(&self) -> VisibilityTier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VisibilityTier
impl Debug for VisibilityTier
Source§impl Default for VisibilityTier
impl Default for VisibilityTier
Source§fn default() -> VisibilityTier
fn default() -> VisibilityTier
Source§impl<'de> Deserialize<'de> for VisibilityTier
impl<'de> Deserialize<'de> for VisibilityTier
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>,
impl Eq for VisibilityTier
Source§impl PartialEq for VisibilityTier
impl PartialEq for VisibilityTier
Source§fn eq(&self, other: &VisibilityTier) -> bool
fn eq(&self, other: &VisibilityTier) -> bool
self and other values to be equal, and is used by ==.