pub struct CloudKitClient { /* private fields */ }Implementations§
Source§impl CloudKitClient
impl CloudKitClient
pub fn new(auth: AuthConfig) -> Result<Self>
pub fn modify(&self, ops: Vec<ModifyOperation>) -> Result<Vec<CkRecord>>
pub fn query(&self, req: QueryRequest) -> Result<QueryResponse>
pub fn list_notes( &self, include_trashed: bool, include_archived: bool, limit: Option<usize>, ) -> Result<Vec<CkRecord>>
pub fn lookup(&self, record_names: &[&str]) -> Result<Vec<CkRecord>>
pub fn fetch_note(&self, record_name: &str) -> Result<CkRecord>
Sourcepub fn upload_asset(
&self,
record_name: &str,
record_type: &str,
data: &[u8],
mime_type: &str,
) -> Result<AssetReceipt>
pub fn upload_asset( &self, record_name: &str, record_type: &str, data: &[u8], mime_type: &str, ) -> Result<AssetReceipt>
Upload a file to CloudKit asset storage. Returns the receipt to embed in a record field.
Sourcepub fn create_note(
&self,
text: &str,
tag_uuids: Vec<String>,
tag_names: Vec<String>,
) -> Result<CkRecord>
pub fn create_note( &self, text: &str, tag_uuids: Vec<String>, tag_names: Vec<String>, ) -> Result<CkRecord>
Create a brand-new note. Returns the created record.
Sourcepub fn update_note_text(
&self,
record_name: &str,
new_text: &str,
) -> Result<CkRecord>
pub fn update_note_text( &self, record_name: &str, new_text: &str, ) -> Result<CkRecord>
Update a note’s text. Fetches the current record first to obtain the recordChangeTag and existing vector clock, then writes back the updated content.
Sourcepub fn attach_file(
&self,
note_record_name: &str,
filename: &str,
data: &[u8],
position: AttachPosition,
) -> Result<()>
pub fn attach_file( &self, note_record_name: &str, filename: &str, data: &[u8], position: AttachPosition, ) -> Result<()>
Attach a file to a note. Uploads the asset, creates the file record, and
updates the note’s markdown — all in one atomic records/modify call.
Sourcepub fn trash_note(&self, record_name: &str) -> Result<()>
pub fn trash_note(&self, record_name: &str) -> Result<()>
Move a note to trash (sets trashed=1, trashedDate=now, increments vector clock).
Sourcepub fn archive_note(&self, record_name: &str) -> Result<()>
pub fn archive_note(&self, record_name: &str) -> Result<()>
Archive a note.
Auto Trait Implementations§
impl Freeze for CloudKitClient
impl !RefUnwindSafe for CloudKitClient
impl Send for CloudKitClient
impl Sync for CloudKitClient
impl Unpin for CloudKitClient
impl UnsafeUnpin for CloudKitClient
impl !UnwindSafe for CloudKitClient
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