pub struct Surface {Show 13 fields
pub id: String,
pub title: String,
pub category: Category,
pub visibility: Visibility,
pub kind: SurfaceKind,
pub mount: Mount,
pub producer: String,
pub feature: Option<Feature>,
pub artifact: Option<PathBuf>,
pub index: Option<String>,
pub availability: Availability,
pub built_from: Option<String>,
pub provenance: BTreeMap<String, Provenance>,
}Expand description
One resolved surface: everything a consumer needs, with the provenance of what it could be surprised by.
Fields§
§id: StringIdentity, unique across the topology; the selector --only and --exclude use it.
title: StringOne line: what a reader sees in a listing.
category: CategoryWhat it is for, which is how a listing groups it.
visibility: VisibilityWhether a person is shown it.
kind: SurfaceKindHow it answers.
mount: MountWhere it answers.
producer: StringWhat produced it: a command, a module, or the generator that writes the directory.
feature: Option<Feature>The runtime capability it needs; absent when the process always has it.
artifact: Option<PathBuf>The generated directory, repository-relative, for a static surface.
index: Option<String>The file served for the mount itself, when the surface has one.
availability: AvailabilityWhere the surface’s files go and who answers for it.
built_from: Option<String>The revision the artifact was built from, when its producer recorded one: what makes a stale build a finding rather than a surprise.
provenance: BTreeMap<String, Provenance>Where each interesting value came from, by field name.
Implementations§
Source§impl Surface
impl Surface
Sourcepub fn served_by(&self, runtime: Runtime) -> bool
pub fn served_by(&self, runtime: Runtime) -> bool
Does a process with these runtime capabilities answer for this surface?
use majordomus_cli::web::discover::Runtime;
use majordomus_cli::web::model::Feature;
let mut s = Surface { id: "mcp".into(), title: "MCP".into(), category: Category::Protocol,
visibility: Visibility::Internal, kind: SurfaceKind::NativeRoute,
mount: Mount::parse("/mcp").unwrap(), producer: "t".into(), feature: Some(Feature::Mcp),
artifact: None, index: None, availability: Availability::ServedOnly,
built_from: None, provenance: BTreeMap::new() };
assert!(s.served_by(Runtime::full()));
assert!(!s.served_by(Runtime::default()));
s.feature = None;
assert!(s.served_by(Runtime::default()));Trait Implementations§
Source§impl<'de> Deserialize<'de> for Surface
impl<'de> Deserialize<'de> for Surface
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 Surface
Source§impl JsonSchema for Surface
impl JsonSchema for Surface
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ordered for Surface
A surface is presented by its id: the composition writes its artifact under that name,
the topology reports it under that name, and the title is prose.
impl Ordered for Surface
A surface is presented by its id: the composition writes its artifact under that name, the topology reports it under that name, and the title is prose.
impl StructuralPartialEq for Surface
Auto Trait Implementations§
impl Freeze for Surface
impl RefUnwindSafe for Surface
impl Send for Surface
impl Sync for Surface
impl Unpin for Surface
impl UnsafeUnpin for Surface
impl UnwindSafe for Surface
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.