#[repr(C)]pub struct CoreLib<Client: Requester, Docs: DocumentService> {
pub inner: Arc<Mutex<CoreState<Client, Docs>>>,
}Fields§
§inner: Arc<Mutex<CoreState<Client, Docs>>>Implementations§
source§impl CoreLib<Network, OnDiskDocuments>
impl CoreLib<Network, OnDiskDocuments>
pub fn init(config: &Config) -> Result<Self, UnexpectedError>
source§impl<Client: Requester, Docs: DocumentService> CoreLib<Client, Docs>
impl<Client: Requester, Docs: DocumentService> CoreLib<Client, Docs>
pub fn in_tx<F, Out>(&self, f: F) -> LbResult<Out>
pub fn create_account( &self, username: &str, api_url: &str, welcome_doc: bool, ) -> LbResult<Account>
sourcepub fn logout_and_exit(self) -> !
pub fn logout_and_exit(self) -> !
This function is used to log out and delete the user’s data from the local filesystem. Don’t call it without warning the user to back up their private key.
pub fn import_account(&self, account_string: &str) -> LbResult<Account>
pub fn export_account(&self) -> Result<String, LbError>
pub fn export_account_qr(&self) -> Result<Vec<u8>, LbError>
pub fn get_account(&self) -> Result<Account, LbError>
pub fn get_config(&self) -> Result<Config, UnexpectedError>
pub fn create_file( &self, name: &str, parent: Uuid, file_type: FileType, ) -> Result<File, LbError>
pub fn write_document(&self, id: Uuid, content: &[u8]) -> Result<(), LbError>
pub fn get_root(&self) -> Result<File, LbError>
pub fn get_children(&self, id: Uuid) -> Result<Vec<File>, UnexpectedError>
pub fn get_and_get_children_recursively( &self, id: Uuid, ) -> Result<Vec<File>, LbError>
pub fn get_file_by_id(&self, id: Uuid) -> Result<File, LbError>
pub fn delete_file(&self, id: Uuid) -> Result<(), LbError>
pub fn read_document(&self, id: Uuid) -> Result<DecryptedDocument, LbError>
pub fn list_metadatas(&self) -> Result<Vec<File>, UnexpectedError>
pub fn rename_file(&self, id: Uuid, new_name: &str) -> Result<(), LbError>
pub fn move_file(&self, id: Uuid, new_parent: Uuid) -> Result<(), LbError>
pub fn create_link_at_path( &self, path_and_name: &str, target_id: Uuid, ) -> Result<File, LbError>
pub fn create_at_path(&self, path_and_name: &str) -> Result<File, LbError>
pub fn get_by_path(&self, path: &str) -> Result<File, LbError>
pub fn get_path_by_id(&self, id: Uuid) -> Result<String, UnexpectedError>
pub fn list_paths( &self, filter: Option<Filter>, ) -> Result<Vec<String>, UnexpectedError>
pub fn get_local_changes(&self) -> Result<Vec<Uuid>, UnexpectedError>
pub fn calculate_work(&self) -> Result<SyncStatus, LbError>
pub fn sync( &self, f: Option<Box<dyn Fn(SyncProgress)>>, ) -> Result<SyncStatus, LbError>
pub fn get_last_synced(&self) -> Result<i64, UnexpectedError>
pub fn get_last_synced_human_string(&self) -> Result<String, UnexpectedError>
pub fn suggested_docs( &self, settings: RankingWeights, ) -> Result<Vec<Uuid>, UnexpectedError>
pub fn get_usage(&self) -> Result<UsageMetrics, LbError>
pub fn get_uncompressed_usage_breakdown( &self, ) -> Result<HashMap<Uuid, usize>, UnexpectedError>
pub fn get_uncompressed_usage(&self) -> Result<UsageItemMetric, LbError>
pub fn get_drawing(&self, id: Uuid) -> Result<Drawing, LbError>
pub fn save_drawing(&self, id: Uuid, d: &Drawing) -> Result<(), LbError>
pub fn export_drawing( &self, id: Uuid, format: SupportedImageFormats, render_theme: Option<HashMap<ColorAlias, ColorRGB>>, ) -> Result<Vec<u8>, LbError>
pub fn export_drawing_to_disk( &self, id: Uuid, format: SupportedImageFormats, render_theme: Option<HashMap<ColorAlias, ColorRGB>>, location: &str, ) -> Result<(), LbError>
pub fn import_files<F: Fn(ImportStatus)>( &self, sources: &[PathBuf], dest: Uuid, update_status: &F, ) -> Result<(), LbError>
pub fn export_file( &self, id: Uuid, destination: PathBuf, edit: bool, export_progress: Option<Box<dyn Fn(ExportFileInfo)>>, ) -> Result<(), LbError>
pub fn search_file_paths( &self, input: &str, ) -> Result<Vec<SearchResultItem>, UnexpectedError>
pub fn start_search(&self, search_type: SearchType) -> StartSearchInfo
pub fn validate(&self) -> Result<Vec<Warning>, TestRepoError>
pub fn upgrade_account_stripe( &self, account_tier: StripeAccountTier, ) -> Result<(), LbError>
pub fn upgrade_account_google_play( &self, purchase_token: &str, account_id: &str, ) -> Result<(), LbError>
pub fn upgrade_account_app_store( &self, original_transaction_id: String, app_account_token: String, ) -> Result<(), LbError>
pub fn cancel_subscription(&self) -> Result<(), LbError>
pub fn get_subscription_info(&self) -> Result<Option<SubscriptionInfo>, LbError>
pub fn delete_account(&self) -> Result<(), LbError>
pub fn admin_disappear_account(&self, username: &str) -> Result<(), LbError>
pub fn admin_disappear_file(&self, id: Uuid) -> Result<(), LbError>
pub fn admin_list_users( &self, filter: Option<AccountFilter>, ) -> Result<Vec<Username>, LbError>
pub fn admin_get_account_info( &self, identifier: AccountIdentifier, ) -> Result<AccountInfo, LbError>
pub fn admin_validate_account( &self, username: &str, ) -> Result<AdminValidateAccount, LbError>
pub fn admin_validate_server(&self) -> Result<AdminValidateServer, LbError>
pub fn admin_file_info( &self, id: Uuid, ) -> Result<AdminFileInfoResponse, LbError>
pub fn admin_rebuild_index(&self, index: ServerIndex) -> Result<(), LbError>
pub fn admin_set_user_tier( &self, username: &str, info: AdminSetUserTierInfo, ) -> Result<(), LbError>
pub fn debug_info(&self, os_info: String) -> String
Trait Implementations§
Auto Trait Implementations§
impl<Client, Docs> Freeze for CoreLib<Client, Docs>
impl<Client, Docs> RefUnwindSafe for CoreLib<Client, Docs>
impl<Client, Docs> Send for CoreLib<Client, Docs>
impl<Client, Docs> Sync for CoreLib<Client, Docs>
impl<Client, Docs> Unpin for CoreLib<Client, Docs>
impl<Client, Docs> UnwindSafe for CoreLib<Client, Docs>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more