// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: sh.weaver.edit.cursor // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, bon::Builder )] #[serde(rename_all = "camelCase")] pub struct ContainerId<'a> { #[serde(borrow)] pub value: ContainerIdValue<'a>, } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ContainerIdValue<'a> { #[serde(rename = "sh.weaver.edit.cursor#normalContainerId")] NormalContainerId(Box>), #[serde(rename = "sh.weaver.edit.cursor#rootContainerId")] RootContainerId(Box>), } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, bon::Builder )] #[serde(rename_all = "camelCase")] pub struct CursorSide<'a> { /// The side of an item the cursor is on (left = -1, right = 1, middle = 0) pub value: i64, } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, bon::Builder )] #[serde(rename_all = "camelCase")] pub struct Id<'a> { pub counter: i64, pub peer: i64, } /// An edit record for a notebook. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, bon::Builder )] #[serde(rename_all = "camelCase")] pub struct Cursor<'a> { #[serde(borrow)] pub container: crate::sh_weaver::edit::cursor::ContainerId<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[builder(into)] #[serde(borrow)] pub id: Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[builder(into)] #[serde(borrow)] pub side: Option>, } /// Typed wrapper for GetRecord response with this collection's record type. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct CursorGetRecordOutput<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub cid: std::option::Option>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, #[serde(borrow)] pub value: Cursor<'a>, } /// Marker type for deserializing records from this collection. pub struct CursorRecord; impl jacquard_common::xrpc::XrpcResp for CursorRecord { const NSID: &'static str = "sh.weaver.edit.cursor"; const ENCODING: &'static str = "application/json"; type Output<'de> = CursorGetRecordOutput<'de>; type Err<'de> = jacquard_common::types::collection::RecordError<'de>; } impl jacquard_common::types::collection::Collection for Cursor<'_> { const NSID: &'static str = "sh.weaver.edit.cursor"; type Record = CursorRecord; } impl From> for Cursor<'_> { fn from(output: CursorGetRecordOutput<'_>) -> Self { use jacquard_common::IntoStatic; output.value.into_static() } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, bon::Builder )] #[serde(rename_all = "camelCase")] pub struct NormalContainerId<'a> { #[serde(borrow)] #[builder(into)] pub container_type: jacquard_common::CowStr<'a>, pub counter: i64, pub peer: i64, } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, Default )] #[serde(rename_all = "camelCase")] pub struct RootContainerId<'a> { #[serde(borrow)] pub container_type: jacquard_common::CowStr<'a>, #[serde(borrow)] pub name: jacquard_common::CowStr<'a>, }