pub struct A2uiCapabilities {
pub v1_0: Option<CapabilitySet>,
pub v0_9: Option<CapabilitySet>,
}Expand description
The catalogs a renderer or an agent supports, by A2UI version family: A2UI 1.0
renderer_capabilities.json keys them 1.0, and v0.9.1 client_capabilities.json keys
them v0.9.
§Example
use adk_surface::genui::{A2uiCapabilities, A2uiVersion, FORMS_CATALOG_ID};
let wire = serde_json::to_value(A2uiCapabilities::forms()).unwrap();
assert_eq!(wire["1.0"]["supportedCatalogIds"][0], FORMS_CATALOG_ID);
assert_eq!(wire["v0.9"]["supportedCatalogIds"][0], FORMS_CATALOG_ID);
// A renderer that offers only v0.9 is written to in v0.9.1.
let renderer: A2uiCapabilities = serde_json::from_value(serde_json::json!({
"v0.9": { "supportedCatalogIds": [FORMS_CATALOG_ID] }
})).unwrap();
assert_eq!(renderer.preferred(), Some(A2uiVersion::V0_9_1));Fields§
§v1_0: Option<CapabilitySet>What 1.0 supports.
v0_9: Option<CapabilitySet>What v0.9 and v0.9.1 support.
Implementations§
Source§impl A2uiCapabilities
impl A2uiCapabilities
Sourcepub fn forms() -> Self
pub fn forms() -> Self
The forms 1.0 catalog only, with no inline catalogs, in 1.0 and v0.9.1: what this
home renders.
Sourcepub fn of(catalogs: &Catalogs) -> Self
pub fn of(catalogs: &Catalogs) -> Self
Every catalog in catalogs, forms first, with no inline catalogs, in 1.0 and v0.9.1:
what a home that registers extension catalogs renders.
Sourcepub fn preferred(&self) -> Option<A2uiVersion>
pub fn preferred(&self) -> Option<A2uiVersion>
The newest version these capabilities offer, if any.
Trait Implementations§
Source§impl Clone for A2uiCapabilities
impl Clone for A2uiCapabilities
Source§impl Debug for A2uiCapabilities
impl Debug for A2uiCapabilities
Source§impl Default for A2uiCapabilities
impl Default for A2uiCapabilities
Source§impl<'de> Deserialize<'de> for A2uiCapabilities
impl<'de> Deserialize<'de> for A2uiCapabilities
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 Eq for A2uiCapabilities
Source§impl JsonSchema for A2uiCapabilities
impl JsonSchema for A2uiCapabilities
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for A2uiCapabilities
impl PartialEq for A2uiCapabilities
Source§impl Serialize for A2uiCapabilities
impl Serialize for A2uiCapabilities
impl StructuralPartialEq for A2uiCapabilities
Auto Trait Implementations§
impl Forget for A2uiCapabilities
impl Freeze for A2uiCapabilities
impl Move for A2uiCapabilities
impl RefUnwindSafe for A2uiCapabilities
impl Send for A2uiCapabilitieswhere
RawVecInner: Send,
impl Sync for A2uiCapabilitieswhere
RawVecInner: Sync,
impl Unpin for A2uiCapabilities
impl UnsafeUnpin for A2uiCapabilities
impl UnwindSafe for A2uiCapabilitieswhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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