Skip to main content

TurnInputPart

Struct TurnInputPart 

Source
pub struct TurnInputPart {
    pub part_type: TurnInputPartType,
    pub text: Option<String>,
    pub media_type: Option<String>,
    pub base64_data: Option<String>,
    pub width: Option<u64>,
    pub height: Option<u64>,
    pub selector: Option<String>,
    pub arguments: Option<String>,
    pub source: Option<SkillInvocationSource>,
    pub upload_id: Option<String>,
}
Expand description

One ordered content part of a turn submission. File mentions are text, not a part type: write @relative/path in a text part. A structured mention part is reserved and currently rejected, and an unknown part type is invalidParams — which is what closes TurnInputPartType.

Modelled as a discriminated flat object rather than a Rust enum, the convention crate::msp::view::approval::ApprovalSubject already established for a wire union in this crate: the v1 schema model names no object-variant union shape and fails closed on one. The serialized JSON is the same either way; what a flat object cannot express is “mediaType is required exactly when type is image”.

Fields§

§part_type: TurnInputPartType

The part type.

§text: Option<String>

User prompt text, on a text part. Multiple text parts are joined in order into the turn’s prompt.

§media_type: Option<String>

Media type, required on an image part.

§base64_data: Option<String>

Base64 payload, required on an image part. Invalid base64 or an empty payload is rejected with invalid params.

§width: Option<u64>

Pixel width; must be provided together with height or not at all. Published as a dependentRequired pair.

§height: Option<u64>

Pixel height; must be provided together with width or not at all.

§selector: Option<String>

The skill to invoke, required on a skill part: a bare or plugin-qualified shortcut token from skill/list. The HOST resolves and expands; an unknown selector is the typed -32032 skillNotFound request error.

§arguments: Option<String>

Free-text skill arguments, optional on a skill part — the wire twin of what the TUI accepts after the shortcut token.

§source: Option<SkillInvocationSource>

The picked copy’s source, optional on a skill part: one of the catalog rows’ source values. When present the host resolves the exact (selector, source) row; when absent it resolves the selector, bare or plugin-qualified, against the session’s skill catalog, as the TUI shortcut does. Closed: an unknown value is invalidParams, never a fall-through.

§upload_id: Option<String>

The upload receipt, required on a video part: the client-minted id media/upload echoed.

Trait Implementations§

Source§

impl Clone for TurnInputPart

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TurnInputPart

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TurnInputPart

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for TurnInputPart

Source§

impl PartialEq for TurnInputPart

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for TurnInputPart

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TurnInputPart

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.