#[non_exhaustive]pub struct CursorUpdate {
pub cursor_id: CursorId,
pub capabilities: MaybeUndefined<CursorCapabilities>,
pub anchor: Option<CursorAnchor>,
pub meta: MaybeUndefined<Map<String, Value>>,
}unstable_protocol_v2 only.Expand description
UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
A session cursor upsert. A cursor names one position in the session’s timeline.
The first update for a cursorId MUST include anchor. The anchor is fixed
after that, and later updates change only capabilities.
capabilities and _meta have patch semantics: omission leaves the stored
value unchanged, null clears it, and an object replaces capabilities as a
whole. A concrete _meta object patches the stored metadata by top-level key
instead of replacing it.
See the Session Cursors RFD.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cursor_id: CursorIdThe Agent-owned ID of this cursor, unique within the session.
capabilities: MaybeUndefined<CursorCapabilities>The methods that currently accept this cursor.
Omission leaves the capabilities unchanged, null clears them, and an object replaces
the whole previous value. A new cursor starts with none.
anchor: Option<CursorAnchor>Where the cursor is, relative to an entity the Client holds.
Required on the first update for a cursor. The Agent MUST NOT change it afterwards.
A later update can omit it or repeat the same anchor. Omitted and null are
equivalent and leave the stored anchor unchanged.
meta: MaybeUndefined<Map<String, Value>>The _meta property is reserved by ACP to allow clients and agents to attach additional
metadata to their interactions. Omitted leaves the stored metadata unchanged. null
clears it. An object patches the stored metadata by top-level key: keys it omits are
unchanged, a key set to null is removed, and any other value replaces that key’s
stored value without merging nested objects. Beyond this patch rule, implementations
MUST NOT assign meaning to keys they do not recognize.
See protocol docs: Metadata Patches
Implementations§
Source§impl CursorUpdate
impl CursorUpdate
Sourcepub fn new(cursor_id: impl Into<CursorId>) -> CursorUpdate
Available on crate feature unstable_session_cursors only.
pub fn new(cursor_id: impl Into<CursorId>) -> CursorUpdate
unstable_session_cursors only.Builds a cursor update with the anchor and patch fields omitted.
Sourcepub fn capabilities(
self,
capabilities: impl IntoMaybeUndefined<CursorCapabilities>,
) -> CursorUpdate
Available on crate feature unstable_session_cursors only.
pub fn capabilities( self, capabilities: impl IntoMaybeUndefined<CursorCapabilities>, ) -> CursorUpdate
unstable_session_cursors only.Replaces, clears, or leaves unchanged the methods that accept this cursor.
Sourcepub fn anchor(self, anchor: impl IntoOption<CursorAnchor>) -> CursorUpdate
Available on crate feature unstable_session_cursors only.
pub fn anchor(self, anchor: impl IntoOption<CursorAnchor>) -> CursorUpdate
unstable_session_cursors only.Sets the anchor. The first update for a cursor MUST carry one.
Sourcepub fn meta(
self,
meta: impl IntoMaybeUndefined<Map<String, Value>>,
) -> CursorUpdate
Available on crate feature unstable_session_cursors only.
pub fn meta( self, meta: impl IntoMaybeUndefined<Map<String, Value>>, ) -> CursorUpdate
unstable_session_cursors only.Patches, clears, or leaves unchanged cursor metadata.
A concrete object patches stored metadata by top-level key. See
apply_meta_update.
Trait Implementations§
Source§impl Clone for CursorUpdate
impl Clone for CursorUpdate
Source§fn clone(&self) -> CursorUpdate
fn clone(&self) -> CursorUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CursorUpdate
impl Debug for CursorUpdate
Source§impl<'de> Deserialize<'de> for CursorUpdate
impl<'de> Deserialize<'de> for CursorUpdate
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CursorUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CursorUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for CursorUpdate
Source§impl JsonSchema for CursorUpdate
impl JsonSchema for CursorUpdate
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 PartialEq for CursorUpdate
impl PartialEq for CursorUpdate
Source§impl Serialize for CursorUpdate
impl Serialize for CursorUpdate
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CursorUpdate
Auto Trait Implementations§
impl Forget for CursorUpdate
impl Freeze for CursorUpdate
impl Move for CursorUpdate
impl RefUnwindSafe for CursorUpdate
impl Send for CursorUpdate
impl Sync for CursorUpdate
impl Unpin for CursorUpdate
impl UnsafeUnpin for CursorUpdate
impl UnwindSafe for CursorUpdate
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
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§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
key and return true if they are equal.