Skip to main content

VisibilityTier

Enum VisibilityTier 

Source
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

Fields

§team_id: String
§

Restricted

Fields

§scope_label: String
§

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.

Fields

§scope_label: String

Implementations§

Source§

impl VisibilityTier

Source

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.

Source

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

tierrankaudience reach
Public0every audience (least restrictive)
Internal1the workspace-internal set (+ every team)
TeamScoped2one named team
Restricted3one named scope label
Private4only 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.

Source

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

Source§

fn clone(&self) -> VisibilityTier

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VisibilityTier

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VisibilityTier

Source§

fn default() -> VisibilityTier

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for VisibilityTier

Source§

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 Eq for VisibilityTier

Source§

impl PartialEq for VisibilityTier

Source§

fn eq(&self, other: &VisibilityTier) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for VisibilityTier

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for VisibilityTier

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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<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