#[non_exhaustive]pub struct CanvasDeclaration {
pub id: String,
pub display_name: String,
pub description: String,
pub input_schema: Option<Value>,
pub actions: Option<Vec<CanvasAction>>,
}Expand description
Declarative metadata for a single canvas, sent over the wire on
session.create / session.resume.
Experimental. This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringCanvas identifier, unique within the declaring connection.
display_name: StringHuman-readable name shown in host UI and canvas pickers.
description: StringShort, single-sentence description shown to the agent in canvas catalogs.
input_schema: Option<Value>JSON Schema for the input payload accepted by canvas.open.
actions: Option<Vec<CanvasAction>>Agent-callable actions this canvas exposes.
Implementations§
Source§impl CanvasDeclaration
impl CanvasDeclaration
Sourcepub fn new(
id: impl Into<String>,
display_name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, display_name: impl Into<String>, description: impl Into<String>, ) -> Self
Construct a canvas declaration with the required fields set.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description surfaced in discovery and agent context.
Trait Implementations§
Source§impl Clone for CanvasDeclaration
impl Clone for CanvasDeclaration
Source§fn clone(&self) -> CanvasDeclaration
fn clone(&self) -> CanvasDeclaration
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CanvasDeclaration
impl Debug for CanvasDeclaration
Source§impl Default for CanvasDeclaration
impl Default for CanvasDeclaration
Source§fn default() -> CanvasDeclaration
fn default() -> CanvasDeclaration
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CanvasDeclaration
impl<'de> Deserialize<'de> for CanvasDeclaration
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
Auto Trait Implementations§
impl Freeze for CanvasDeclaration
impl RefUnwindSafe for CanvasDeclaration
impl Send for CanvasDeclaration
impl Sync for CanvasDeclaration
impl Unpin for CanvasDeclaration
impl UnsafeUnpin for CanvasDeclaration
impl UnwindSafe for CanvasDeclaration
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