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 modify_in_zone( &self, zone_id: ZoneId, 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 list_phantom_notes(&self, limit: Option<usize>) -> Result<Vec<CkRecord>>
pub fn delete_phantom_notes( &self, records: &[CkRecord], ) -> Result<Vec<CkRecord>>
pub fn lookup(&self, record_names: &[&str]) -> Result<Vec<CkRecord>>
Sourcepub fn fetch_note(&self, record_name: &str) -> Result<CkRecord>
pub fn fetch_note(&self, record_name: &str) -> Result<CkRecord>
Fetch a single SFNote by its uniqueIdentifier (which equals its CloudKit recordName).
pub fn fetch_note_by_title( &self, title: &str, include_trashed: bool, include_archived: bool, ) -> Result<CkRecord>
Sourcepub fn fetch_tag(&self, record_name: &str) -> Result<CkRecord>
pub fn fetch_tag(&self, record_name: &str) -> Result<CkRecord>
Fetch a single SFNoteTag by its recordName.
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.
pub fn ensure_tag(&self, title: &str) -> Result<String>
pub fn find_tag_record_name(&self, title: &str) -> Result<Option<CkRecord>>
pub fn resolve_tag_record_names( &self, tag_names: &[String], create_missing: bool, ) -> Result<Vec<String>>
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.
pub fn update_note( &self, record_name: &str, new_text: &str, tag_uuids: Option<Vec<String>>, tag_names: Option<Vec<String>>, ) -> Result<CkRecord>
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.
pub fn delete_note(&self, record_name: &str) -> Result<()>
pub fn delete_tag(&self, record_name: &str) -> Result<()>
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