pub struct Surface {
pub id: String,
pub protocol: ProtocolVersion,
pub schema: String,
pub root: Component,
pub actions: Vec<Action>,
pub metadata: BTreeMap<String, String>,
}Fields§
§id: String§protocol: ProtocolVersion§schema: String§root: Component§actions: Vec<Action>§metadata: BTreeMap<String, String>Implementations§
Source§impl Surface
impl Surface
pub fn new(id: impl Into<String>, root: Component) -> Self
pub fn validate(&self) -> Result<(), GenUiError>
pub fn validate_with(&self, host: &HostCapabilities) -> Result<(), GenUiError>
Sourcepub fn validate_structure(
&self,
host: &HostCapabilities,
) -> Result<(), GenUiError>
pub fn validate_structure( &self, host: &HostCapabilities, ) -> Result<(), GenUiError>
Validate only the structural/protocol portion of a Surface. This is
used by the G5 composition adapter before host-issued action handles
are checked against the real ActionCatalog; it never grants action
admission on its own.
Sourcepub fn validate_with_catalog(
&self,
host: &HostCapabilities,
catalog: &ActionCatalog,
) -> Result<(), GenUiError>
pub fn validate_with_catalog( &self, host: &HostCapabilities, catalog: &ActionCatalog, ) -> Result<(), GenUiError>
Validate a model-proposed surface against the exact host-owned action catalog. Shape validation alone is intentionally insufficient for executable actions.
Sourcepub fn validate_for_host(
&self,
host: &HostCapabilities,
catalog: &ActionCatalog,
) -> Result<(), GenUiError>
pub fn validate_for_host( &self, host: &HostCapabilities, catalog: &ActionCatalog, ) -> Result<(), GenUiError>
Alias used by integrations that make the authority boundary explicit.
pub fn canonical_json(&self) -> Result<Vec<u8>, GenUiError>
pub fn digest(&self) -> Result<String, GenUiError>
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more