pub struct ViewScope {
pub kind: ViewScopeKind,
pub project_id: Option<String>,
pub owner: Option<String>,
pub shared_with: Vec<String>,
pub extensions: Table,
}Expand description
Explicit sharing/visibility metadata (data-model §2).
Every optional field is omitted from tix.toml when it is empty, so a
repository view is two lines and a project view names exactly one project.
Unknown keys are preserved in ViewScope::extensions rather than rejected:
a newer tix may have written a scope field this build does not know, and
dropping it would be the metadata loss the mission forbids (NFR-002).
Fields§
§kind: ViewScopeKindWhich scope family this is.
project_id: Option<String>The project this view belongs to; required for ViewScopeKind::Project.
owner: Option<String>The identity a user/share scope belongs to. A label, not an account.
Identities a user/share scope is shared with. Labels, not grants.
extensions: TableScope keys this build does not interpret, preserved verbatim.
Implementations§
Source§impl ViewScope
impl ViewScope
Sourcepub fn repository() -> Self
pub fn repository() -> Self
A repository-wide scope: no sharing metadata at all.
Sourcepub fn project(project_id: impl Into<String>) -> Self
pub fn project(project_id: impl Into<String>) -> Self
A project scope. The id is not resolved here — that needs the project
registry, and ViewScope::conflicts is the structural check.
A user/share scope. owner and shared_with are metadata only.
Sourcepub fn conflicts(&self) -> Vec<ViewDiagnostic>
pub fn conflicts(&self) -> Vec<ViewDiagnostic>
The structural problems with this scope, independent of any project registry. Empty when the scope is internally consistent.
These are the rules a record cannot break and be meaningful under: a project scope with no project, a repository scope that names one, share metadata on a scope that is not a share, and blank or repeated identities.
Sourcepub fn resolution<P: ProjectDirectory + ?Sized>(
&self,
projects: &P,
) -> ScopeResolution
pub fn resolution<P: ProjectDirectory + ?Sized>( &self, projects: &P, ) -> ScopeResolution
Resolve this scope against the project registry (data-model §2).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ViewScope
impl<'de> Deserialize<'de> for ViewScope
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 StructuralPartialEq for ViewScope
Auto Trait Implementations§
impl Freeze for ViewScope
impl RefUnwindSafe for ViewScope
impl Send for ViewScope
impl Sync for ViewScope
impl Unpin for ViewScope
impl UnsafeUnpin for ViewScope
impl UnwindSafe for ViewScope
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more