#[non_exhaustive]pub struct CursorUpdate {
pub cursor_id: CursorId,
pub capabilities: MaybeUndefined<CursorCapabilities>,
pub anchor: Option<CursorAnchor>,
pub meta: MaybeUndefined<Meta>,
}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.
Agents MUST only send this update when the Client advertised
the session.cursors Client capability.
capabilities and _meta have patch semantics: omission leaves the stored
value unchanged, null clears it, and a concrete value replaces 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<Meta>Extensible metadata patch for this cursor.
Implementations§
Source§impl CursorUpdate
impl CursorUpdate
Sourcepub fn new(cursor_id: impl Into<CursorId>) -> Self
Available on crate feature unstable_session_cursors only.
pub fn new(cursor_id: impl Into<CursorId>) -> Self
unstable_session_cursors only.Builds a cursor update with the anchor and patch fields omitted.
Sourcepub fn capabilities(
self,
capabilities: impl IntoMaybeUndefined<CursorCapabilities>,
) -> Self
Available on crate feature unstable_session_cursors only.
pub fn capabilities( self, capabilities: impl IntoMaybeUndefined<CursorCapabilities>, ) -> Self
unstable_session_cursors only.Replaces, clears, or leaves unchanged the methods that accept this cursor.
Sourcepub fn anchor(self, anchor: impl IntoOption<CursorAnchor>) -> Self
Available on crate feature unstable_session_cursors only.
pub fn anchor(self, anchor: impl IntoOption<CursorAnchor>) -> Self
unstable_session_cursors only.Sets the anchor. The first update for a cursor MUST carry one.
Sourcepub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
Available on crate feature unstable_session_cursors only.
pub fn meta(self, meta: impl IntoMaybeUndefined<Meta>) -> Self
unstable_session_cursors only.Sets, clears, or omits the metadata patch.
Trait Implementations§
Source§impl Clone for CursorUpdate
impl Clone for CursorUpdate
Source§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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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
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.